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

Clean up all dead files inside tests/ui/ #136112

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

fmease
Copy link
Member

@fmease fmease commented Jan 27, 2025

While rebasing #135860 I noticed that there are several dead *.stderr files inside tests/ui/.

When I checked thoroughly, I found 69 dead *.$revision.stderr files, 3 other dead *.stderr files and one dead *.rs file.

Prior to #134808, compiletest's --bless didn't remove dead *.stderr files when the set of revisions changed in any way (renamings, removals, additions, …) which explains their existence.

Regarding the dead *.rs file, that one was located inside an auxiliary/ directory (together with a *.stderr file) despite not being meant to be an auxiliary file (it's not referenced by any //@ aux-*, it has an accompanying *.stderr file and it's obvious from looking at #111056 which added it). Ideally compiletest or tidy would forbid *.std{out,err} files inside auxiliary/ dirs, that would've caught it. I moved it, updated it and turned it into a proper UI test.


How to reproduce:

  1. Run rm tests/ui/**/*.stderr
  2. Run ./x test tests/ui --bless (or similar)
  3. Manually / semi-automatically go through all tests that were ignored (likely due to your OS etc. not matching) and restore any stderr files that were overzealously removed

r? compiler

@fmease fmease added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Jan 27, 2025
@rustbot rustbot added A-tidy Area: The tidy tool 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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jan 27, 2025
@compiler-errors
Copy link
Member

r=me when green

@rust-log-analyzer

This comment has been minimized.

@fmease fmease force-pushed the clean-up-all-dead-files-in-ui-tests branch from a0e0571 to c38951b Compare January 27, 2025 01:29
@fmease fmease changed the title Clean up all (84) dead files inside tests/ui Clean up all dead files inside tests/ui/ Jan 27, 2025
@fmease
Copy link
Member Author

fmease commented Jan 27, 2025

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Jan 27, 2025

📌 Commit c38951b has been approved by compiler-errors

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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 27, 2025
@lqd
Copy link
Member

lqd commented Jan 27, 2025

This seems to remove the polonius compare-mode expectations, which are not theoretically dead files but in practice will be outdated, could be dead, etc since they’re not tested on CI.

Compare modes were not intended to be used like the new solver does with explicit revisions, but by just blessing the expectations and running the compare mode itself on CI. This is lower friction but can create dead files, if the tests aren’t run by default (or when removing stderrs and reblessing) like for polonius or chalk, so the new solver approach works better in that regard.

Given that the chalk compare mode is gone, that we’re migrating away from these old polonius tests because of the new implementation, that reblessing would encounter issues on the tests that are too slow to run (the reason why it’s not enabled on CI), and fixing that would also create more churn when we complete the new implementation diagnostics and run tests on CI, I guess it’s fine to remove them? :)

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2025
…llaumeGomez

Rollup of 10 pull requests

Successful merges:

 - rust-lang#135773 (Clarify WindowsMut (Lending)Iterator)
 - rust-lang#135807 (Implement phantom variance markers)
 - rust-lang#135876 (fix doc for std::sync::mpmc)
 - rust-lang#135988 (Add a workaround for parallel rustc crashing when there are delayed bugs)
 - rust-lang#136037 (Mark all NuttX targets as tier 3 target and support the standard library)
 - rust-lang#136064 (Add a suggestion to cast target_feature fn items to fn pointers.)
 - rust-lang#136082 (Incorporate `iter_nodes` into `graph::DirectedGraph`)
 - rust-lang#136112 (Clean up all dead files inside `tests/ui/`)
 - rust-lang#136114 (Use identifiers more in diagnostics code)
 - rust-lang#136118 (Change `collect_and_partition_mono_items` tuple return type to a struct)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f4a5cbd into rust-lang:master Jan 27, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 27, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2025
Rollup merge of rust-lang#136112 - fmease:clean-up-all-dead-files-in-ui-tests, r=compiler-errors

Clean up all dead files inside `tests/ui/`

While rebasing rust-lang#135860 I noticed that there are several dead `*.stderr` files inside `tests/ui/`.

When I checked thoroughly, I found 69 dead `*.$revision.stderr` files, 3 other dead `*.stderr` files and one dead `*.rs` file.

Prior to rust-lang#134808, compiletest's `--bless` didn't remove dead `*.stderr` files when the set of revisions changed in any way (renamings, removals, additions, …) which explains their existence.

Regarding the dead `*.rs` file, that one was located inside an `auxiliary/` directory (together with a `*.stderr` file) despite not being meant to be an auxiliary file (it's not referenced by any `//@ aux-*`, it has an accompanying `*.stderr` file and it's obvious from looking at rust-lang#111056 which added it). Ideally compiletest or tidy would forbid `*.std{out,err}` files inside `auxiliary/` dirs, that would've caught it. I moved it, updated it and turned it into a proper UI test.

---

How to reproduce:

1. Run `rm tests/ui/**/*.stderr`
2. Run `./x test tests/ui --bless` (or similar)
3. Manually / semi-automatically go through all tests that were ignored (likely due to your OS etc. not matching) and restore any stderr files that were overzealously removed

---

r? compiler
@fmease
Copy link
Member Author

fmease commented Jan 27, 2025

This seems to remove the polonius compare-mode expectations, which are not theoretically dead files but in practice will be outdated, could be dead, etc since they’re not tested on CI.

Oof I totally missed that, sorry about that! I'm glad you're somewhat okay with this PR. From what I've gathered from your comment, those *.polonius.stderr files are basically dead weight in practice as running ./x t tests/ui --compare-mode=polonius before my PR would've likely lead to failures, too, especially as time goes on. Whereas now, you have to pass --bless when running the compare mode.

@fmease fmease deleted the clean-up-all-dead-files-in-ui-tests branch January 27, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants