-
Notifications
You must be signed in to change notification settings - Fork 925
Default "make test" fail with errors #4400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you please run these steps:
If you get test failures, please provide the output from the terminal. |
Also, is the test failing, or are you just referring to the console output? That's a negative scenario test, and the parser error output is intentional. However, the test is passing: Note the passing test test test::parser_errors_in_submods_are_surfaced ... ok error: expected `{`, found `println`
--> tests/parser/issue-4126/invalid.rs:5:5
|
2 | if bar && if !baz {
| -- this `if` expression has a condition, but no block
...
5 | println!("foo");
| ^^^^^^^---------
| |
| expected `{`
| help: try placing this code inside a block: `{ println!("foo"); }`
test test::parser_errors_in_submods_are_surfaced ... ok |
Yes, this is the error I see. I didn't notice that there are different
types of errors.
Unless something should be done regarding the default branch
(documentation?), the issue may be closed.
Thanks
…On Fri, Aug 28, 2020, 17:18 Caleb Cartwright ***@***.***> wrote:
Formatting "tests/parser/issue-4126/invalid.rs" fails
Also, is the *test* failing, or are you just referring to the console
output? That's a negative scenario test, and the parser error output is
intentional. However, the test is passing:
Note the passing test *test test::parser_errors_in_submods_are_surfaced
... ok*
error: expected `{`, found `println`
--> tests/parser/issue-4126/invalid.rs:5:5
|
2 | if bar && if !baz {
| -- this `if` expression has a condition, but no block
...
5 | println!("foo");
| ^^^^^^^---------
| |
| expected `{`
| help: try placing this code inside a block: `{ println!("foo"); }`
test test::parser_errors_in_submods_are_surfaced ... ok
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4400 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOSCPP3E76JOVWJQBLZKYV3SC64DLANCNFSM4QOFFW7Q>
.
|
There's a difference between stdout/stderr text on the terminal and the actual result/outcome of a test. In this case the test is passing, not failing. Make sure you look at the test results, which cargo/libtest summarize really well.
I have no idea what you're referring to here. We have the branches configured how we want them, and it is very intentional. There is nothing to change, nor document.
I'm still unclear if you're getting a panic, if you are then that is something I'd like to understand. However, as mentioned elsewhere, there is no such panic happening anywhere else so this almost certainly is related to something in your local environment. Please let me know if you receive a panic when following the exact steps I described above (and only those steps), otherwise I will close this. https://github.com/rust-lang/rustfmt/actions?query=branch%3Amaster+event%3Apush |
The issue I am referring to is that the default master branch builds rustfmt 2.0.0-rc.2-nightly but that caused panic in "cargo make test", and I had to checkout branch rustfmt-1.4.20 (the latest 1.x version) to prevent the panic. It may be that this is because I did something wrong (although I installed from scratch) or that this should have been clear to me and therefore no related documentation is needed. On the other hand it may be that what I did is o.k. and knowing to set branch 1.x instead of 2.x is not trivial, so it may be helpful to add in https://github.com/rust-lang/rustfmt#installing-from-source in addition to "tag or branch for the version of rustfmt you want" that that those that don't develop for version 2.x should install/checkout a 1.x version.
When running "the exact steps I described above" I get the following errors:
|
@davidBar-On - The error message above is different than anything you've shared previously, and the key point comes from lines like this: Do you have a nightly toolchain installed? |
@calebcartwright, as you guessed, I didn't have the nightly toolchain installed. Sorry for that (I assume that I should have known to do that). I installed it now and when running "cargo make test" on the rustfmt source I get the same panic that I get for my fork clone, although in this case version
|
No worries. A recent nightly is required for the majority of the official Rust tools. The nightly requirement is called out explicitly in several places, but I guess folks that are brand new to Rust may not know exactly what that means/what they need to do.
What do you mean when you say "install"? You aren't running a
If you run through the steps I provided previously, and only those steps, there's no way you can be running the tests with v1.4.20. Could you please try again, in a new/clean directory, starting with a fresh clone of the repo? |
I am using "cargo make test". By "install" I mean taking the steps described in https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust, mainly
My mistake, the built version is |
Gotcha, thanks!
What version of rust are you on? ( |
I found and fixed the problem which was a problem in my local machine. I added debug messages before Thanks a lot for spending the effort to help with this issues. |
Sure! Thanks for all the follow ups. It may be worth some tweaks to the test path to avoid any potential future overlaps, especially since The only thing that matters for that particular test is that the second config file is in a subdirectory of the root of the first, doesn't really matter whether the root is Lines 645 to 680 in d7f0d76
|
Should I close the issue or should it remain open for potentially changing |
I'm going to go ahead and close, but feel free to open a new PR if you'd like to suggest a directory name change for that test 👍 |
I installed rustfmt code from scratch and the "cargo make test" failed with errors.
Following are the install process steps to reproduce the problem:
On https://github.com/rust-lang/rustfmt "fork" the repository.
On your local machine clone the repository form the fork: "git clone <forked repository>"
Set environment variables for cargo make:
export CFG_RELEASE_CHANNEL=nightly; export CFG_RELEASE=1.47.0-nightly
("1.47.0-nightly" is from "rustc -vV")
Run "cargo make test" - rustfmt version "2.0.0-rc.2-nightly" is built
Two errors are shown:
Panic at 'config::test::test_merged_config'
I was able to fix this issue by switching to branch "1.4.20". It may be that the default master branch should be the latest 1.x and not 2.x.
Formatting "tests/parser/issue-4126/invalid.rs" fails
This issue happens with both 1.x and 2.x versions and I was not able to fix it. PR handle recoverable submod parse errors correctly #4200 that fixes rustfmt deletes lines instead of detecting a syntax error #4126 is listed as Merged, but when I look in the cloned code I don't see these changes. Also, https://play.rust-lang.org/ fails with the same error.
The text was updated successfully, but these errors were encountered: