Skip to content

compiletest: changes in compiletest does not trigger test rerun #56280

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

Closed
vakaras opened this issue Nov 27, 2018 · 4 comments · Fixed by #56680
Closed

compiletest: changes in compiletest does not trigger test rerun #56280

vakaras opened this issue Nov 27, 2018 · 4 comments · Fixed by #56680
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@vakaras
Copy link
Contributor

vakaras commented Nov 27, 2018

If I modify a file in the rustc source code (src/librustc_c*), ./x.py test is smart enough to rerun all tests. However, if I modify something in src/tools/compiletest, then ./x.py test still ignores the tests that completed successfully in the previous run.

Steps to reproduce:

  1. Run tests:
git clone [email protected]:rust-lang/rust.git
./x.py test
  1. Modify compiletest. For example, replace the expected_output_path function in runtest.rs with:
    fn expected_output_path(&self, _kind: &str) -> PathBuf {
        panic!();
    }
  1. Run tests again:
./x.py test

Expected output: some tests fail.

Actual output:

Build completed successfully in 0:13:13
@vakaras
Copy link
Contributor Author

vakaras commented Nov 27, 2018

I would be interested in fixing this issue myself if someone could give me some guidance on how to do that. The main thing that I do not understand is how ./x.py test understands that rustc was changed. It seems that it does not use build/x86_64-unknown-linux-gnu/test/ui/*/stamp files for this because they include only the hash of the configuration options which do not include rustc version.

cc @Mark-Simulacrum

@pietroalbini pietroalbini added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Nov 27, 2018
@nagisa
Copy link
Member

nagisa commented Nov 27, 2018

The most likely culprit (that ignores the test files) is fn up_to_date in compiletest::main module. It is called from compiletest::main::make_test and will set the ignore flag for the test depending on its output.

@nagisa
Copy link
Member

nagisa commented Nov 27, 2018

That being said, I find it hard to see how to adjust compiletest itself to take the dependencies into account. rustbuild should probably have some sort of dependency edge and delete the stamp files if/when stuff like compiletest changes.

@vakaras
Copy link
Contributor Author

vakaras commented Dec 10, 2018

Compiletest source code has only 9 files. Would it be acceptable to check that their timestamps are newer than the timestamp of the stamp file?

PR: https://github.com/rust-lang/rust/pull/56680/files

bors added a commit that referenced this issue Dec 22, 2018
Use compiletest timestamp to check if the tests should be rerun.

An attempt to fix  #56280 by checking if timestamps of compile test files are older than the timestamp of the stamp file.

?r nagisa
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-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure 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