-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Migrate compiletest to use ui_test
-style //@
directives
#121370
Migrate compiletest to use ui_test
-style //@
directives
#121370
Conversation
This comment has been minimized.
This comment has been minimized.
ca2df43
to
c76f8c0
Compare
Some changes occurred in GUI tests. |
This comment has been minimized.
This comment has been minimized.
c76f8c0
to
fed1262
Compare
This comment has been minimized.
This comment has been minimized.
fed1262
to
fe24a18
Compare
This comment has been minimized.
This comment has been minimized.
fe24a18
to
57da076
Compare
This comment has been minimized.
This comment has been minimized.
57da076
to
70f084d
Compare
FYI, the coverage tests will need to have their Also watch out, because the part of a coverage test that uses those snapshots doesn't run in PR CI jobs, and by default it doesn't run in local builds either. (See https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Building.20the.20profiler.20runtime.20in.20more.20profiles.2Fjobs.3F for more context on why.) So you will probably need to set |
Thanks for the heads up. I'm also expecting other failures too that'll only get picked up in full build lol (just like in #120881). Since the coverage reports seem to have a reasonably predictable format, I think I might be able to hack up some external script to convert the contained directives. |
This comment has been minimized.
This comment has been minimized.
Yeah, for the changes you're making this approach should work pretty well. |
70f084d
to
235f72f
Compare
This comment has been minimized.
This comment has been minimized.
235f72f
to
d893e1f
Compare
This comment has been minimized.
This comment has been minimized.
d893e1f
to
263fb20
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/// names. This is **not** an exhaustive list of all possible directives. Instead, this is a | ||
/// best-effort approximation for diagnostics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still the case that this is not an exhaustive list? If not can you remove the respective part of this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's as exhaustive as the currently used directives go. It is still possible that some combination e.g. ignore-platform-xxx has never been used else where in the test suite.
☀️ Test successful - checks-actions |
Finished benchmarking commit (f62f490): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 649.98s -> 649.375s (-0.09%) |
Don't see any error now when running compiletest directives in tests/run-make |
The compiletest directives in Makefiles that use |
Preface
There's an on-going effort to rewrite parts of or the entirety of compiletest
(rust-lang/compiler-team#536). A step towards this involve migrating
compiletest tests to use the
ui_test
framework, whichinvolves changing compiletest directives in
// <directive-name>
style toui_test
//@ <directive-name>
style (rust-lang/compiler-team#512).This PR aims to implement the directive-style change from
//
to//@
for the remainingnon-"ui" test suite tests.
Key Changes
tests/
tests now use//@
directives.//@
and issues an error if an old-style directive is detected.// ignore-tidy
and// ignore-tidy-*
are considered tidy directives and are ignored bycompiletest header parsing.
Diff Generation
The diff is generated by:
tests/
via hijacking compiletest to emit successfully parseddirective lines.
(https://github.com/jieyouxu/compiletest-ui_test-header-migration/tree/master) to replace
//
directives in compiletest tests with//@
.Reproduction Steps
Delete the temporary file
$RUSTC_REPO_PATH/build/<target_triple>/test/__directive_lines.txt
,if the collection script was previously ran.
Use the https://github.com/jieyouxu/rust/tree/collect-test-directives collect-test-directives
script, which outputs a temporary file recording headers occuring in each compiletest test.
You need to checkout this branch:
git checkout collect-test-directives
.This needs to be rebased on latest master to ensure up-to-date test directives can be collected.
You need to run
./x test
on each of thetest/*
subfolders once:Checkout the
migrate-compiletest-directives
branch.Run the migration tool https://github.com/jieyouxu/compiletest-ui_test-header-migration.
Check that the migration at least does not cause test failures if you change compiletest to
accept
//@
directives only. This is also required if the test outputs somehow need to beblessed.
RUSTC_TEST_FAIL_FAST=1 ./x test tests/<secondary-directory> --stage 1 --bless
Confirm that there is no difference after running the migration tool when you are on the
migrate-compiletest-directives
branch.Follow Up Work
ui_test
style//@
rustc-dev-guide#1895.