Skip to content

Move several tests from 'ui/issues' to more specific directories#153788

Closed
rishi-techo-14 wants to merge 12 commits intorust-lang:mainfrom
rishi-techo-14:move-ui-tests
Closed

Move several tests from 'ui/issues' to more specific directories#153788
rishi-techo-14 wants to merge 12 commits intorust-lang:mainfrom
rishi-techo-14:move-ui-tests

Conversation

@rishi-techo-14
Copy link

Reorganize UI Tests into subfolders

Description

This PR moves several tests from 'tests/ui/issues' into more appropriate subdirectories based on the subsystem they test, to improve maintainability and clarity. It follows the preferred workflow discussed in (#152966) regarding test moves and commits:

  • First commit: only moves the test files without modifying their contents.
  • Subsequent commits: include any test modifications (if needed).
  • Final step (after review): squash all commits that modify files, keeping the initial move commit separate to preserve git history.

The moved tests cover areas such as:

  • Borrow checking
  • Trait resolution
  • Pattern matching
  • Type checking
  • Lint behavior
  • Constant evaluation
  • Closures

Changes included in this PR

  • Moved issue-2150.rs to tests/ui/lint/.
  • Moved issue-3021-b.rs and issue-4335.rs to closures/.
  • Moved issue-3154.rs to borrowck/.
  • Moved trait-related tests (issue-3702-2.rs) to traits/.

Rationale

Organizing tests into subfolders based on category helps reviewers locate relevant tests quickly, improves CI efficiency, and keeps the tests/ui folder more structured.

Notes for reviewer

  • No changes to test logic were made; only file movements were performed.
  • The moves follow the recommended workflow of separating file moves from
    any other modifications, preserving the git history of the test files.
  • This is part of the ongoing effort to reorganize tests under ui/issues into more specific categories to make the test suite easier to navigate.
  • The commit history preserves the original moves separately as suggested in rust-lang discussion.

@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 Mar 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2026

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 15 candidates

@rust-log-analyzer
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
fmt: checked 6742 files
tidy check
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/traits/issue-3702-2.rs` to `{reason}-issue-3702.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/traits/issue-4265.rs` to `{reason}-issue-4265.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/consts/issue-17252.rs` to `{reason}-issue-17252.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/lint/issue-2150.rs` to `{reason}-issue-2150.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/typeck/issue-4736.rs` to `{reason}-issue-4736.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/pattern/issue-17800.rs` to `{reason}-issue-17800.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/pattern/issue-4972.rs` to `{reason}-issue-4972.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/pattern/issue-5100.rs` to `{reason}-issue-5100.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/closures/issue-3021-b.rs` to `{reason}-issue-3021.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/borrowck/issue-2590.rs` to `{reason}-issue-2590.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/borrowck/issue-4335.rs` to `{reason}-issue-4335.rs`
tidy [ui_tests (tests)]: issue-number-only test names are not descriptive, consider renaming file `tests/ui/borrowck/issue-3154.rs` to `{reason}-issue-3154.rs`
tidy [ui_tests (tests)]: FAIL
tidy [rustdoc_json (src)]: `rustdoc-json-types` modified, checking format version
tidy: Skipping binary file check, read-only filesystem
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'venv'
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'virtualenv'
---
info: ES-Check: there were no ES version matching errors!  🎉
typechecking javascript files
tidy: The following check failed: ui_tests (tests)
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy --root-path=/checkout --cargo-path=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo --output-dir=/checkout/obj/build --concurrency=4 --npm-path=/node/bin/yarn --ci=true --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1618:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1387:29

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:02:48
  local time: Thu Mar 12 17:16:18 UTC 2026
  network time: Thu, 12 Mar 2026 17:16:18 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

@Teapot4195
Copy link
Contributor

Hi, part of the project here is that the tests should be renamed to match what they are testing for instead of remaining as issue-[0-9].rs.

@rustbot author

@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 Mar 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Kivooeo Kivooeo assigned Kivooeo and unassigned JonathanBrouwer Mar 12, 2026
@Kivooeo
Copy link
Member

Kivooeo commented Mar 12, 2026

Hi, I have a few thoughts on this:

  1. The description is generated (I, like many other reviewers, would rather read a description that has not been generated); I'm not sure if the changes were generated too. The description is overly verbose and structured, and contains inaccuracies (e.g. it claims that the workflow matches my linked comment, but it doesn't).
  2. I assume so, since the workflow wasn't the same as the one I described in the linked comment (e.g. each commit moves the test rather than only the first commit moving all the tests).
  3. It wasn't tested locally because tidy would give an error regarding the issues.txt file.
  4. We don't allow test names like issue-*.rs (tidy would also complain about this).
  5. The issue links weren't added to the test content.
  6. Given the above two points, I assume that the plan from here wasn't followed: https://github.com/rust-lang/google-summer-of-code?tab=readme-ov-file#reorganisation-of-test-ui-issues.

Having said that, I think it's reasonable to close it in accordance with our policy: rust-lang/compiler-team#893.

Please be aware that this is not a ban, nor is it a warning. It is also not intended to put you off taking part. The closure is intended to provide feedback on your PR. I am closing it because a significant amount of work is required for a reviewer, and it would be easier to create a different PR after you have read the GSoC project description and considered my comment about the workflow you linked in the description more carefully.

@Kivooeo Kivooeo closed this Mar 12, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 12, 2026
@rishi-techo-14
Copy link
Author

Thanks for the feedback. I am progressively understanding the workflow mentioned in the gsoc ideas list and the comment on #152966 now. I will make sure to follow each step in this workflow, and open a new PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

6 participants