Skip to content
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

cargo test gives up compiling after one error #64084

Closed
lopopolo opened this issue Sep 2, 2019 · 7 comments · Fixed by #64746
Closed

cargo test gives up compiling after one error #64084

lopopolo opened this issue Sep 2, 2019 · 7 comments · Fixed by #64746
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-traits Area: Trait system C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lopopolo
Copy link
Contributor

lopopolo commented Sep 2, 2019

I'm making a big refactor. When attempting to clean up my tests, cargo test appears to go file by file, alphabetically when compiling the tests. As soon as one #[test] has a compile error, the build is aborted.

  • #[test]s following the failure do not get compiled.
  • Subsequent compile errors in the #[test] that fails to build are not reported.

This makes finding errors very tedious.


Editing to provide concrete case:

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c040edc58966f3fcc662002e84ec57aa gives up after the first test but should continue to report errors

@Mark-Simulacrum
Copy link
Member

What error specifically? Can you post a build log and a link to a repo (or, ideally, playground) that reproduces this behavior?

@lopopolo
Copy link
Contributor Author

lopopolo commented Sep 2, 2019

I know there are errors in the build. The problem is that cargo test stops compiling all of the tests once it encounters a single error.

@lopopolo
Copy link
Contributor Author

lopopolo commented Sep 2, 2019

@Mark-Simulacrum
Copy link
Member

This has nothing to do with tests and is just a consequence of how type inference errors are currently fatal in this case. Removing the #[test] annotations leads to the exact same error.

I'm going to close this issue as it's not really something that's fixable (well, it is, but not a targeted fix, and there's no real need to track this case separately). Thanks for the bug report, though!

@lopopolo
Copy link
Contributor Author

lopopolo commented Sep 2, 2019

Is there a bug for the broader issue that I can watch?

@Mark-Simulacrum
Copy link
Member

Not really in the sense that it's not a bug just a consequence of the current implementation.

@estebank
Copy link
Contributor

estebank commented Sep 24, 2019

I believe this is a valid bug report. A cursory look at the code tells me that we are being overeager in how much we silence here. At least, we should only silence inside of a given body instead of globally like we do now.

CC #21974

@estebank estebank reopened this Sep 24, 2019
@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints A-traits Area: Trait system C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 24, 2019
@bors bors closed this as completed in 5ed746b Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-traits Area: Trait system C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants