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

compiletest failing tests aren't that noisy by default #131182

Closed
wants to merge 1 commit into from

Conversation

dev-ardi
Copy link
Contributor

@dev-ardi dev-ardi commented Oct 3, 2024

This suppresses the whole block if the env var is not set.

I don't think that it's very useful to have that information, especially when it's in the middle of other important information.

I'd even suggest pushing all of the duplicate information up or down in order to condense the diffs as much as possible.

image

@rustbot
Copy link
Collaborator

rustbot commented Oct 3, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 3, 2024

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@jieyouxu
Copy link
Member

jieyouxu commented Oct 3, 2024

So this one I'm not very sure about. Because having the exact command invocation has been useful for me multiple times especially because some test suites have preset flags that can affect the behavior of what I'm trying to test / what failed. I would imagine that this should be an option in config.toml that adjusts the preset for command output verbosity that bootstrap passes to compiletest.

@jieyouxu
Copy link
Member

jieyouxu commented Oct 3, 2024

@dev-ardi could you elaborate on why you want to suppress the exact command status and command output?

@dev-ardi
Copy link
Contributor Author

dev-ardi commented Oct 3, 2024

@dev-ardi could you elaborate on why you want to suppress the exact command status and command output?

It's very useful when you need it, but most of the time you don't need it and are just big blocks of noise in the output. I would at least have an option to hide it. I don't really care whether it's in config.toml or an env variable, and whether it should be on or off by default. As long as I can hide (and it's documented somewhere how to hide it for others) it I'm happy :P

@jieyouxu
Copy link
Member

jieyouxu commented Oct 3, 2024

That sounds reasonable to me. I would prefer this, like the diff tool, to be an option that's configurable from bootstrap config.toml, something like:

# config.toml
[test]
# Verbose command output is enabled-by-default, but you can toggle it off
# if you don't need the verbose command invocation.
verbose-command-invocation = true 

Specifically I would prefer that the current verbose command invocation is shown-by-default, but offer an option to hide that if for some reason you don't need it.

@jieyouxu
Copy link
Member

jieyouxu commented Oct 3, 2024

Also please do not hide the command status in any case, e.g. a test failing with exit status 1 can be significantly different from a test failing with exit status 101 (panics, ICEs, etc.).

@rustbot author

@jieyouxu jieyouxu assigned jieyouxu and unassigned wesleywiser Oct 3, 2024
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2024
@dev-ardi
Copy link
Contributor Author

dev-ardi commented Oct 3, 2024

There seems to already be an option like that, Config::verbose_tests.

Do you think I should hide it by default or not?

@jieyouxu
Copy link
Member

jieyouxu commented Oct 3, 2024

No we should not hide it by default, because quite a few people actually want to see the exact command invocation.

Config::verbose_tests

We could try use that, though I'm not too sure what that particular bootstrap config does. I'll roll a T-bootstrap reviewer.

r? bootstrap

@rustbot rustbot assigned albertlarsan68 and unassigned jieyouxu Oct 3, 2024
@jieyouxu jieyouxu self-assigned this Oct 3, 2024
@dev-ardi
Copy link
Contributor Author

dev-ardi commented Oct 3, 2024

Then if that shouldn't be the default we can't use that option. Thoughts?

@jieyouxu
Copy link
Member

jieyouxu commented Oct 3, 2024

I would add a new config option like verbose-test-command-invocation maybe under [build], subject to what T-bootstrap prefers.

@ChrisDenton
Copy link
Member

This likely needs some discussion with T-compiler/contributors. I personally find the information very useful in compiler tests and I don't think it should be hidden by default. But that's just my opinion. I use compiler tests infrequently so the less I need to configure the better. Someone who uses them alot may not mind having to tune different nobs to get the information they need.

@jieyouxu
Copy link
Member

jieyouxu commented Oct 6, 2024

This likely needs some discussion with T-compiler/contributors. I personally find the information very useful in compiler tests and I don't think it should be hidden by default. But that's just my opinion. I use compiler tests infrequently so the less I need to configure the better. Someone who uses them alot may not mind having to tune different nobs to get the information they need.

https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Vibe.20check.20on.20suppressing.20failed.20test.20command.20invocation

(I forgor to link it)
TL;DR:

  • Many contributors find the command invocation crucial to their workflow.
  • We should not and cannot suppress the command invocation by default (there can be an opt-in config option to hide the command invocation).
  • The status itself should not be hidden.

@jieyouxu jieyouxu added the A-compiletest Area: The compiletest test runner label Oct 13, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 19, 2024
Compiletest: Custom differ

This adds support for a custom differ for compiletests. It’s purely visual and helps produce cleaner output when UI tests fail.

I’m using an environment variable for now since it’s experimental and I don’t want to drill the cli arguments all the way down. Also did a bit of general cleanup while I was at it.

This is how it looks [with debug info silenced](rust-lang#131182) (rust-lang#131182)
`COMPILETEST_DIFF_TOOL="/usr/bin/env difft --color always --background light --display side-by-side" ./x test tests/ui/parser`
![image](https://github.com/user-attachments/assets/f740ce50-7564-4469-be0a-86e24bc50eb8)
fmease added a commit to fmease/rust that referenced this pull request Oct 23, 2024
Compiletest: Custom differ

This adds support for a custom differ for compiletests. It’s purely visual and helps produce cleaner output when UI tests fail.

I’m using an environment variable for now since it’s experimental and I don’t want to drill the cli arguments all the way down. Also did a bit of general cleanup while I was at it.

This is how it looks [with debug info silenced](rust-lang#131182) (rust-lang#131182)
`COMPILETEST_DIFF_TOOL="/usr/bin/env difft --color always --background light --display side-by-side" ./x test tests/ui/parser`
![image](https://github.com/user-attachments/assets/f740ce50-7564-4469-be0a-86e24bc50eb8)
fmease added a commit to fmease/rust that referenced this pull request Oct 23, 2024
Compiletest: Custom differ

This adds support for a custom differ for compiletests. It’s purely visual and helps produce cleaner output when UI tests fail.

I’m using an environment variable for now since it’s experimental and I don’t want to drill the cli arguments all the way down. Also did a bit of general cleanup while I was at it.

This is how it looks [with debug info silenced](rust-lang#131182) (rust-lang#131182)
`COMPILETEST_DIFF_TOOL="/usr/bin/env difft --color always --background light --display side-by-side" ./x test tests/ui/parser`
![image](https://github.com/user-attachments/assets/f740ce50-7564-4469-be0a-86e24bc50eb8)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 23, 2024
Rollup merge of rust-lang#131181 - dev-ardi:custom-differ, r=jieyouxu

Compiletest: Custom differ

This adds support for a custom differ for compiletests. It’s purely visual and helps produce cleaner output when UI tests fail.

I’m using an environment variable for now since it’s experimental and I don’t want to drill the cli arguments all the way down. Also did a bit of general cleanup while I was at it.

This is how it looks [with debug info silenced](rust-lang#131182) (rust-lang#131182)
`COMPILETEST_DIFF_TOOL="/usr/bin/env difft --color always --background light --display side-by-side" ./x test tests/ui/parser`
![image](https://github.com/user-attachments/assets/f740ce50-7564-4469-be0a-86e24bc50eb8)
@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 29, 2024
@bors
Copy link
Contributor

bors commented Dec 4, 2024

☔ The latest upstream changes (presumably #133841) made this pull request unmergeable. Please resolve the merge conflicts.

@dev-ardi dev-ardi closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Development

Successfully merging this pull request may close these issues.

8 participants