Skip to content

Add a way to ensure tests actually test something #104939

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

Open
jyn514 opened this issue Nov 26, 2022 · 2 comments
Open

Add a way to ensure tests actually test something #104939

jyn514 opened this issue Nov 26, 2022 · 2 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@jyn514
Copy link
Member

jyn514 commented Nov 26, 2022

A common problem I run into with tests is that it's hard to verify they actually do anything. Consider for example #102038: this test had no changes, but before that PR did not actually ensure that the issue didn't reoccur.

We could avoid problems like that by adding a new test annotation, // test-fails-with nightly-YYYY-MM-DD. That will make sure the test actually does something and hasn't always passed.

It will be too expensive to run all those versions on each bors run, so we could instead only run it every 6 weeks before a release (perhaps we can fold this into crater how? at least the automation if not the same codebase.)

@jyn514 jyn514 added the A-testsuite Area: The testsuite used to check the correctness of rustc label Nov 26, 2022
@jruderman
Copy link
Contributor

Instead of every 6 weeks, how about "when the test changes"?

@jyn514
Copy link
Member Author

jyn514 commented Nov 28, 2022

@jruderman hmm, yeah this is harder than I thought. "when the test changes" is a sufficient condition for // test-fails-with-nightly. But that's not actually what went wrong in #102038; what went wrong was that it became harder to trigger the underlying bug even though the test was unchanged.

I think to test it properly it would have needed something like 2 revisions, with and without -Z normalize-docs, to make sure it passed without and failed with. But that seems quite hard to generalize. I think test-fails-with-nightly is more likely to be generally applicable, and there "when the test changes" is good enough.

@Enselic Enselic added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants