Skip to content

Document subdirectories of UI tests with README files #141597

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

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

Oneirical
Copy link
Contributor

@Oneirical Oneirical commented May 26, 2025

Part of #133895 and the 2025 Google Summer of Code associated project.

When adding a new UI test, one is faced with hundreds of subdirectories in tests/ui reflecting various categories. Knowing where to put the new test is not trivial, as many of the categories have slightly misleading names. For example, moves does not only refer to the move keyword but to functions taking ownership in general, whereas allocator does not refer to allocation in general but rather to the very specific allocator_api and global_allocator features.

Many contributors will therefore place their test at the top level of ̀tests/ui where it will be mixed with hundreds of unrelated tests.

This PR is a tentative move towards more clearly defined tag/categories, with a SUMMARY.md file documenting the true purpose of each subdirectory, placed inside tests/ui.

r? @jieyouxu

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 26, 2025
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 7d9b1a5 to 2a001cc Compare May 26, 2025 16:14
@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

I feel like this is not super useful unless we explicitly establish an index structure to make those docs discoverable, i.e.

tests/ui/
	SUMMARY.md or README.md <- "index" of directories
    attributes/README.md <- only if there's more subdir specific info to add
    attributes/README.md
        path/README.md <- only if there's even more specific notes

and the in r-d-g, describe this convention, and point to entry point tests/ui/SUMMARY.md.

@Oneirical
Copy link
Contributor Author

That is true. Anyone who doesn't want to comb through the directories certainly isn't going to comb through the READMEs. A single one, where specific strings can be searched, is much superior.

@jieyouxu
Copy link
Member

I know I've been confused on what ui subdirectories we have, so an TL;DR of exisiting ui dirs, e.g. tests/ui/SUMMARY.md is probably sufficient for vast majority of those subdirs. Sth like

# UI test suite

## Subdirectories

- [`foo/`](./foo/): exercises `foo` area of language

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 2a001cc to 3381c61 Compare May 27, 2025 18:24
@jieyouxu
Copy link
Member

@rustbot note pr-description-is-outdated

Can you also update PR description, since we don't anymore have specific per-subdir .mds (no need currently).

@jieyouxu
Copy link
Member

@rustbot note stub-out-remaining-subdirs

Can you also stub out existing remaining subdirs? E.g.

## `tests/ui/subdir/`: TODO(#141695)

TODO(#141695): add some description

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 3381c61 to 6107ff8 Compare May 31, 2025 20:54
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 6107ff8 to 6ed90f5 Compare May 31, 2025 21:50
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 6ed90f5 to bd919b9 Compare May 31, 2025 22:13
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from bd919b9 to 7e3dd8d Compare June 1, 2025 18:33
@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

jieyouxu commented Jun 3, 2025

@rustbot note remove pr-description-is-outdated

@jieyouxu
Copy link
Member

jieyouxu commented Jun 3, 2025

@rustbot note remove stub-out-remaining-subdirs

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 7e3dd8d to b4a4181 Compare June 5, 2025 03:06
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from b4a4181 to a46a8e7 Compare June 6, 2025 20:56
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from a46a8e7 to 0ec6d9b Compare June 8, 2025 21:57
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 0ec6d9b to f0aa93b Compare June 9, 2025 18:13
@jieyouxu jieyouxu force-pushed the unquestionable-instruction branch from 5cd9751 to 3e2c4ce Compare June 21, 2025 06:44
@jieyouxu
Copy link
Member

@Oneirical thanks for working on this, I find it very helpful. I pushed some edits to your branch, let me know if this version broadly looks good. This is a survey of existing organization of the ui test suite, and does not have to be perfect at all.

If it looks reasonable to you, feel free to r=Oneirical,jieyouxu.

@bors delegate+ rollup

@bors
Copy link
Collaborator

bors commented Jun 21, 2025

✌️ @Oneirical, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@jieyouxu
Copy link
Member

@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 Jun 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2025

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

@jieyouxu
Copy link
Member

jieyouxu commented Jun 21, 2025

Actually, could you also leave a one-liner mention about this SUMMARY.md survey in rustc-dev-guide in this PR, i.e. in https://rustc-dev-guide.rust-lang.org/tests/ui.html#introduction to make it more discoverable

@Oneirical Oneirical force-pushed the unquestionable-instruction branch from 3e2c4ce to b433aba Compare June 22, 2025 16:18
@rustbot rustbot added the A-rustc-dev-guide Area: rustc-dev-guide label Jun 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 22, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol

@Oneirical
Copy link
Contributor Author

@bors r=Oneirical,jieyouxu

Added the one-liner to the dev guide, and fixed some formatting errors related to `` instead of `.

@bors
Copy link
Collaborator

bors commented Jun 22, 2025

📌 Commit b433aba has been approved by Oneirical,jieyouxu

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 Jun 22, 2025
@fmease
Copy link
Member

fmease commented Jun 22, 2025

r stands for reviewer ;)

@bors r=jieyouxu

@bors
Copy link
Collaborator

bors commented Jun 22, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Jun 22, 2025

📌 Commit b433aba has been approved by jieyouxu

It is now in the queue for this repository.

jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 22, 2025
…on, r=jieyouxu

Document subdirectories of UI tests with README files

Part of rust-lang#133895 and the [2025 Google Summer of Code](https://blog.rust-lang.org/2025/05/08/gsoc-2025-selected-projects/) associated project.

When adding a new UI test, one is faced with hundreds of subdirectories in `tests/ui` reflecting various categories. Knowing where to put the new test is not trivial, as many of the categories have slightly misleading names. For example, `moves` does not only refer to the `move` keyword but to functions taking ownership in general, whereas `allocator` does not refer to allocation in general but rather to the very specific `allocator_api` and `global_allocator` features.

Many contributors will therefore place their test at the top level of ̀`tests/ui` where it will be mixed with hundreds of unrelated tests.

This PR is a tentative move towards more clearly defined tag/categories, with a SUMMARY.md file documenting the true purpose of each subdirectory, placed inside `tests/ui`.

r? `@jieyouxu`
bors added a commit that referenced this pull request Jun 23, 2025
Rollup of 6 pull requests

Successful merges:

 - #140136 (Add an aarch64-msvc build running on ARM64 Windows)
 - #141597 (Document subdirectories of UI tests with README files)
 - #142823 (Port `#[no_mangle]` to new attribute parsing infrastructure)
 - #142828 (1.88.0 release notes)
 - #142854 (centralize `-Zmin-function-alignment` logic)
 - #142875 (Check rustdoc-json-types FORMAT_VERSION is correctly updated)

r? `@ghost`
`@rustbot` modify labels: rollup
@tshepang
Copy link
Member

a file like this is normally README.md... seeing SUMMARY made be think this was a new mdbook tree

bors added a commit that referenced this pull request Jun 23, 2025
Rollup of 5 pull requests

Successful merges:

 - #141597 (Document subdirectories of UI tests with README files)
 - #142823 (Port `#[no_mangle]` to new attribute parsing infrastructure)
 - #142828 (1.88.0 release notes)
 - #142854 (centralize `-Zmin-function-alignment` logic)
 - #142875 (Check rustdoc-json-types FORMAT_VERSION is correctly updated)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f63fdde into rust-lang:master Jun 23, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 23, 2025
rust-timer added a commit that referenced this pull request Jun 23, 2025
Rollup merge of #141597 - Oneirical:unquestionable-instruction, r=jieyouxu

Document subdirectories of UI tests with README files

Part of #133895 and the [2025 Google Summer of Code](https://blog.rust-lang.org/2025/05/08/gsoc-2025-selected-projects/) associated project.

When adding a new UI test, one is faced with hundreds of subdirectories in `tests/ui` reflecting various categories. Knowing where to put the new test is not trivial, as many of the categories have slightly misleading names. For example, `moves` does not only refer to the `move` keyword but to functions taking ownership in general, whereas `allocator` does not refer to allocation in general but rather to the very specific `allocator_api` and `global_allocator` features.

Many contributors will therefore place their test at the top level of ̀`tests/ui` where it will be mixed with hundreds of unrelated tests.

This PR is a tentative move towards more clearly defined tag/categories, with a SUMMARY.md file documenting the true purpose of each subdirectory, placed inside `tests/ui`.

r? ``@jieyouxu``
@Oneirical Oneirical deleted the unquestionable-instruction branch June 23, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide 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.

7 participants