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

Fast rerun #156

Closed
wants to merge 3 commits into from
Closed

Fast rerun #156

wants to merge 3 commits into from

Conversation

oli-obk
Copy link
Owner

@oli-obk oli-obk commented Aug 30, 2023

fixes #143

cc @RalfJung

@RalfJung
Copy link
Collaborator

RalfJung commented Sep 4, 2023

So what's the logic here -- ui_test keeps track of a timestamp file, and if a test is older than that file it gets rerun? Also if the test binary changes everything gets rerun? I guess that works for Miri since the compiletest binary actually links against Miri even though it doesn't have to... not sure if it will work in other cases. But I also don't have a better idea.

If a test failed last time, then rustc compiletest always reruns it. That seems preferable since otherwise, the test suite can seem to pass (thanks to ignoring all failed tests) when it shouldn't pass. That logic is currently missing here, or did I misunderstand the code?

src/lib.rs Outdated
Comment on lines 664 to 669

// Make sure the `default_file_filter` recognizes that the test has already been run successfully
// and avoid running it again.
let check_file = config.out_dir.join(path.with_extension("timestamp"));
std::fs::create_dir_all(check_file.parent().unwrap()).unwrap();
std::fs::File::create(check_file).unwrap();
Copy link
Owner Author

@oli-obk oli-obk Sep 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a test failed last time, then rustc compiletest always reruns it.

This also happens here, but I realize now that we have an early success path for run tests 🙃 so run tests are always run again

@oli-obk
Copy link
Owner Author

oli-obk commented Sep 4, 2023

hmm... I just realized that this won't detect if an aux-build file changes 🙃

edit: or if the crates.io dependencies change...

@RalfJung
Copy link
Collaborator

RalfJung commented Sep 4, 2023

Ah, makes sense, thanks! LGTM, though I'll only actually be sure when this gets tested for real...^^

I just realized that this won't detect if an aux-build file changes 🙃

Ah, and that.^^

@Alexendoo
Copy link
Contributor

There's some tricky cases in clippy like the clippy.toml file changing for ui toml tests, and

#[path = auxiliary/foo.rs]
mod foo;
include_str("foo.txt");

This all should be contained in the depinfo file but handling that is a jump in complexity

@RalfJung
Copy link
Collaborator

RalfJung commented Sep 4, 2023

Ah yeah, Miri also uses something like that.

@oli-obk oli-obk closed this Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't rerun tests if nothing changed
3 participants