-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add bless
x.py subcommand for easy ui test replacement
#50806
Conversation
cc @ehuss |
With the implementation in this PR, I think it should be a $ ./x.py test src/test/ui --bless In #49815's suggestion the subcommand works like $ ./x.py test src/test/ui
(... fix errors ...)
$ ./x.py test src/test/ui
(... fix errors ...)
$ ./x.py test src/test/ui
(done)
$ ./x.py bless src/test/ui # <- will not run tests again |
In my experience the workflow is
so I'd very much prefer to do the "test-update-test" operation in one command to keeping the "update" logic separate.
I'm not sure about |
Yes that is also my workflow. I changed it to a flag, as that makes the code simpler and I already pass such a mess of flags to
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
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.
Sweet! Sorry I didn't get to this sooner! (BTW, love the branch name.)
Maybe the error message that says "To update references, run this command..." should be updated to the new command?
Also, beware that there are a bunch of path changes coming in #50400. There shouldn't be any fundamental problems, but some of the function names will change.
src/tools/compiletest/src/runtest.rs
Outdated
)), | ||
let mut files = vec![output_file]; | ||
if self.config.bless { | ||
files.push(self.expected_output_path(kind)); |
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.
This doesn't seem to work for nll
files. For an example, copy E0508.rs to src/test/ui
and try to bless it. You should end up with these three files:
E0508.ast.nll.stderr
E0508.ast.stderr
E0508.mir.stderr
I think the issue is that expected_output_path
doesn't include mode if the file doesn't already exist. I think the solution is to call the global expected_output_path
(not the self
version).
@ehuss -- you're the one most familiar with the code at this point, would you be up for tackling the review here? (I can delegate to you from bors) |
@nikomatsakis I don't mind, but I don't have any more comments beyond what I posted. |
@bors delegate=ehuss |
✌️ @ehuss can now approve this pull request |
@oli-obk want to add replacement of |
☔ The latest upstream changes (presumably #50400) made this pull request unmergeable. Please resolve the merge conflicts. |
@killercup that should automagically work with this PR ;) There's no code specific to |
Yea, I was just waiting for travis :) Last time I broke some tests that ran very late in the pipeline. |
@bors: r+ Nice! |
📌 Commit 0ac2fd1 has been approved by |
@bors rollup |
Add `bless` x.py subcommand for easy ui test replacement fixes rust-lang#49815 r? @nikomatsakis
Rollup of 10 pull requests Successful merges: - #50387 (Remove leftover tab in libtest outputs) - #50553 (Add Option::xor method) - #50610 (Improve format string errors) - #50649 (Tweak `nearest_common_ancestor()`.) - #50790 (Fix grammar documentation wrt Unicode identifiers) - #50791 (Fix null exclusions in grammar docs) - #50806 (Add `bless` x.py subcommand for easy ui test replacement) - #50818 (Speed up `opt_normalize_projection_type`) - #50837 (Revert #49767) - #50839 (Make sure people know the book is free oline) Failed merges:
Thank you especially from those of us who run on windows without a shell to run the |
fixes #49815
r? @nikomatsakis