Repository navigation
Tracking Issue for ui test suite improvements #133895
Copy link
Copy link
Open
Copy link
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-tediousCall for participation: An issue involves lots of work and is better handled as many small tasks.Call for participation: An issue involves lots of work and is better handled as many small tasks.S-tracking-foreverStatus: Never to be closed.Status: Never to be closed.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Activity
- addedA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-tediousCall for participation: An issue involves lots of work and is better handled as many small tasks.Call for participation: An issue involves lots of work and is better handled as many small tasks.S-tracking-foreverStatus: Never to be closed.Status: Never to be closed.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.
on Dec 5, 2024 - added 3 commits that reference this issue
on Dec 7, 2024 - added a commit that references this issue
on Dec 9, 2024 278 remaining items
Load more actions- added a commit that references this issue
on May 19, 2026 - added a commit that references this issue
on May 20, 2026 - added a commit that references this issue
on Jun 6, 2026 - added 3 commits that reference this issue
on Jun 6, 2026 - added a commit that references this issue
on Jun 6, 2026
Metadata
Metadata
Assignees
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-tediousCall for participation: An issue involves lots of work and is better handled as many small tasks.Call for participation: An issue involves lots of work and is better handled as many small tasks.S-tracking-foreverStatus: Never to be closed.Status: Never to be closed.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
This is a tracking issue for an initiative of improving ui test suite organization and ui test usability. This issue is not meant for general discussions, but is instead intended for tracking logistics of PRs. For specific matters, please discuss in the zulip thread https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Discussion.20for.20ui.20test.20suite.20improvements.
Tip
Please don't claim this issue; it's intended to be available to be worked by multiple contributors.
Context
The
uitest suite (tests/ui/) has a lot of tests. Often, many ui tests suffer from:tests/ui/. Some ui tests fall into multiple categories, which is fine, but it may make sense to rehome an ui test if it's better organized under a different directory. See Tracking issue for moving ui tests to subdirectories #73494.Possible improvements
The guiding rationale for improving ui test usability is to:
rustfmtthe test as it will regress test coverage.See Best practices for writing tests in rustc-dev-guide for advice on how to make ui tests more useful. However, don't take the advice at face value -- they should be evaluated on a case-by-case basis. For instance, some subdirectory might contain a collection of specific regression tests related to issues, and in that case having tests be named just
issue-xxxxx.rsisn't bad. On the contrary, a top-levelissue-xxxxx.rsundertests/ui/is not very informative.Example of things that might be done, but only if it makes sense on a case-by-case basis:
//! Issue: <https://github.com/rust-lang/rust/issues/374>.or whatever useful relevant context.macro-empty-suggestion-span-123456.rs.tests/ui/macro-empty-suggestion-span-123456.rs->tests/ui/hir-typeck/suggestions/macro-empty-suggestion-span-123456.rs(hypothetical, or some other better organization).Because these require discretion (changes are not always improvements!), this issue is labeled
E-mediumand not justE-easy. Having "insider" compiler implementation knowledge helps a lot here.Example test doc comment
No fixed format, adapt as suitable for the test at hand. But an example:
Long-term plan
Reorganize all the stray tests immediately underAs oftests/uiand place them into suitable subdirectories, improving the tests themselves along the way.tests/ui: A New Order [0/28] #143908, there are no more top-leveltests/ui/*.rstests!tests/ui/, and see if they need to be fusioned/fissioned/renamed or otherwise adjusted. Where suitable, we can also introduce some subdirectory-levelREADME.mdto document subdirectory intention/area.tests/ui/issues/directory and rehome the tests properly.Implementation history
Note: these are some of the earlier PRs (so not necessarily exhaustive), I may stop updating this listing if we have more PRs. Writing "Part of #133895" will cause the PR to still show-up via backlinks.
-land#[link(..)]intotests/ui/link-native-libs#133996tests/ui(misc cleanups and improvements) [1/N] #133900tests/ui(misc cleanups and improvements) [2/N] #134024tests/ui(misc cleanups and improvements) [3/N] #134418tests/ui(misc cleanups and improvements) [4/N] #140036Footnotes
not always problematic! Requires discretion. ↩