Skip to content

Commit 3376e52

Browse files
committed
Add a note about UI test entry limitation
1 parent 0a5bb7f commit 3376e52

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/tests/adding.md

+17
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ directory that helps identify what piece of code is being tested here
6666
If you've tried and cannot find a more relevant place,
6767
the test may be added to `src/test/ui/issues/`.
6868
Still, **do include the issue number somewhere**.
69+
But please avoid putting your test there as possible since that
70+
directory has too many tests and it causes poor semantic organization.
6971

7072
When writing a new feature, **create a subdirectory to store your
7173
tests**. For example, if you are implementing RFC 1234 ("Widgets"),
@@ -391,6 +393,21 @@ and so forth.
391393
[hw-main]: https://github.com/rust-lang/rust/blob/master/src/test/ui/hello_world/main.rs
392394
[hw]: https://github.com/rust-lang/rust/blob/master/src/test/ui/hello_world/
393395

396+
We now have a ton of UI tests and some directories have too many entries.
397+
This is a problem because it isn't editor/IDE friendly and GitHub UI won't
398+
show more than 1000 entries. To resolve it and organize semantic structure,
399+
we have a tidy check to ensure the number of entries is less than 1000.
400+
However, since `src/test/ui` (UI test root directory) and
401+
`src/test/ui/issues` directories have more than 1000 entries,
402+
we set a different limit for each directories. So, please
403+
avoid putting a new test there as possible and try to find a more relevant place.
404+
For example, if your test is related to closure, you should put it to
405+
`src/test/ui/closures`. If you're not sure where is the best place,
406+
it's still okay to add to `src/test/ui/issues/`. When you reach the limit,
407+
you could increase it by tweaking [here][ui test tidy].
408+
409+
[ui test tidy]: https://github.com/rust-lang/rust/blob/master/src/tools/tidy/src/ui_tests.rs
410+
394411
### Tests that do not result in compile errors
395412

396413
By default, a UI test is expected **not to compile** (in which case,

0 commit comments

Comments
 (0)