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

Squelch a noisy rustc_expand unittest #113942

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jul 22, 2023

The test rustc_parse::tests::bad_path_expr_1 prints an error message to stderr, circumventing libtest's stderr intercept. This causes noise when running tests, in particular they show up 16 times on the GitHub Actions summary page. The solution here is to not use an error emitter that prints to stderr, and instead check that the correct error is generated.

@rustbot
Copy link
Collaborator

rustbot commented Jul 22, 2023

r? @fee1-dead

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 22, 2023
@fee1-dead
Copy link
Member

  • Use a custom EmitterWriter with Destination::Buffered, and validate that the correct error message is generated (rather than a generic should_panic). That would require adding quite a few extra lines of code, though.

I would prefer this approach. I'm fine for this to land as a temporary solution. Would you be willing to do this in this PR or in a followup PR? If not I'd be happy to open an issue for this.

I suppose should_panic(expected = might also work for this case? But it might not cover all the error messages.

In any case, could you please add a FIXME here and r=me afterwards? Thanks.

@ehuss
Copy link
Contributor Author

ehuss commented Jul 22, 2023

I suppose should_panic(expected = might also work for this case? But it might not cover all the error messages.

Unfortunately that doesn't work because the panic is a non-string value (FatalErrorMarker I think?). It could maybe do a catch_unwind to assert the correct panic is raised.

@fee1-dead fee1-dead 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 Jul 23, 2023
@ehuss
Copy link
Contributor Author

ehuss commented Jul 25, 2023

OK, I pushed an update that uses a custom EmitterWriter. I tried to avoid creating too much extra code, and share what was already there.

As a side note, I changed the default diagnostic-width from None to Some(140) to avoid dynamically using the user's terminal width to determine how to truncate the error output, which in part addresses the issue raised at https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/x.2Epy.20test.20.28i.2Ee.2E.20compiletest.20etc.29.20should.20p.E2.80.A6.20compiler-team.23657.

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@fee1-dead
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 26, 2023

📌 Commit 1584e5f has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 26, 2023
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 26, 2023
…ee1-dead

Squelch a noisy rustc_expand unittest

The test `rustc_parse::tests::bad_path_expr_1` prints an error message to stderr, circumventing libtest's stderr intercept. This causes noise when running tests, in particular they show up 16 times on the GitHub Actions summary page. The solution here is to not use an error emitter that prints to stderr, and instead check that the correct error is generated.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 26, 2023
…ee1-dead

Squelch a noisy rustc_expand unittest

The test `rustc_parse::tests::bad_path_expr_1` prints an error message to stderr, circumventing libtest's stderr intercept. This causes noise when running tests, in particular they show up 16 times on the GitHub Actions summary page. The solution here is to not use an error emitter that prints to stderr, and instead check that the correct error is generated.
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 26, 2023
…ee1-dead

Squelch a noisy rustc_expand unittest

The test `rustc_parse::tests::bad_path_expr_1` prints an error message to stderr, circumventing libtest's stderr intercept. This causes noise when running tests, in particular they show up 16 times on the GitHub Actions summary page. The solution here is to not use an error emitter that prints to stderr, and instead check that the correct error is generated.
@bors
Copy link
Contributor

bors commented Jul 26, 2023

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

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 26, 2023
@ehuss
Copy link
Contributor Author

ehuss commented Jul 26, 2023

Rebased due to conflicts.

@bors r=fee1-dead

@bors
Copy link
Contributor

bors commented Jul 26, 2023

📌 Commit 9914ae3 has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 26, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 26, 2023
…ee1-dead

Squelch a noisy rustc_expand unittest

The test `rustc_parse::tests::bad_path_expr_1` prints an error message to stderr, circumventing libtest's stderr intercept. This causes noise when running tests, in particular they show up 16 times on the GitHub Actions summary page. The solution here is to not use an error emitter that prints to stderr, and instead check that the correct error is generated.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 26, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#101994 (rand: freebsd update, using getrandom.)
 - rust-lang#113930 (Add Param and Bound ty to SMIR)
 - rust-lang#113942 (Squelch a noisy rustc_expand unittest)
 - rust-lang#113996 (Define CMAKE_SYSTEM_NAME on a cross build targeting DragonFly.)
 - rust-lang#114070 (Add `sym::iter_mut` + `sym::as_mut_ptr` for Clippy)
 - rust-lang#114073 (Remove -Z diagnostic-width)
 - rust-lang#114090 (compiletest: remove ci-specific remap-path-prefix)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d35cf49 into rust-lang:master Jul 26, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants