-
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
On tests that specify --color=always
emit SVG file with stderr output
#121877
Conversation
r? @Nadrieril rustbot has assigned @Nadrieril. Use r? to explicitly pick a reviewer |
All credit to @epage for the library as well as @Muscraft for showing me rust-lang/cargo#13461. |
This comment has been minimized.
This comment has been minimized.
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
src/tools/compiletest/src/runtest.rs
Outdated
@@ -4014,9 +4014,17 @@ impl<'test> TestCx<'test> { | |||
explicit_format: bool, | |||
) -> usize { | |||
let stderr_bits = format!("{}bit.stderr", self.config.get_pointer_width()); | |||
let force_color_svg = self.props.compile_flags.iter().any(|s| s.contains("--color")) | |||
&& !self.config.target.contains("windows"); |
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.
Why is this !windows
necessary?
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 not absolutely necessary, but I don't have access to a windows box to ensure this test ran and the colors for the ANSI escapes is subtly different between windows and non-windows. Can change that and do a full build on CI to get the windows svg file if we want to land it with it.
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.
For annotate-snippets, @Muscraft recently added a testing-colors
feature flag to force the colors the same across all platforms so we don't have to deal with platform-specific colors (except for the places we need to to verify they are platform-specific)
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.
I'm just worried that when ui testing on windows platforms, this will cause test failures since compiletest expects stdout files but there are svg files here.
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.
I believe that the filter I included was for explicit windows
platform request from the test file. I will remove the platform check.
@epage is testing-colors
included in 0.1.3?
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.
testing-colors
is a annotate-snippets feature. Not really relevant until rustc is converted over but just giving an idea of strategies.
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.
I believe that the filter I included was for explicit windows platform request from the test file. I will remove the platform check.
For the record, the variable self.config.target
is set for all UI tests, so I believe this will produce observable behavioral differences in compiletest, and not just for tests tagged // only-windows
/// ignore-windows
.
I will remove the platform check.
Cool, that sounds like the easiest solution.
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.
Another solution to this might be to pull the colors out into a separate crate and share them between rustc
and annotate-snippets
. I have thought about doing this before, but have never talked with enough people to see if it was a good idea. It would make it easier to share the colors during the transition period and allow other crates to match colors in the long run.
@rustbot author should be good to go after fixing and blessing the window test, but i'd like to take a look at the final results |
@bors try |
On tests that specify `--color=always` emit SVG file with stderr output Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.
For the record, I think |
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.
r=me when ci is green
This comment has been minimized.
This comment has been minimized.
Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.
@bors r=compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a09d91b): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 650.632s -> 650.052s (-0.09%) |
Leverage
anstyle-svg
, ascargo
does now, to emit.svg
files instead of.stderr
files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.