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

compiletest: Store test collection context/state in two structs #131870

Merged
merged 5 commits into from
Oct 18, 2024

Conversation

Zalathar
Copy link
Contributor

This is another incremental cleanup that untangles some of the parameter passing during test collection, making it easier to see which pieces of context information are read-only, and making it easier to find where each field is used.

@rustbot
Copy link
Collaborator

rustbot commented Oct 18, 2024

r? @wesleywiser

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

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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) labels Oct 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 18, 2024

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@jieyouxu
Copy link
Member

r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned wesleywiser Oct 18, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks like a nice logical grouping. One minor nit, then r=me after PR CI is green.

struct TestCollector {
tests: Vec<test::TestDescAndFn>,
found_path_stems: HashSet<PathBuf>,
poisoned: bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: I want to delete this poison thing and eventually just store a vec of errors/diagnostics, but anyway. Possibly still account for --fail-fast, but yeah.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had an earlier draft where I tried to get rid of poisoned entirely, but in the end I decided to make this PR mostly faithful to the existing behaviour.

At some point in the future, having a list of errors instead of a boolean flag would be great.

src/tools/compiletest/src/lib.rs Show resolved Hide resolved
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 18, 2024

📌 Commit cc5fd6a has been approved by 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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 18, 2024
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 18, 2024
compiletest: Store test collection context/state in two structs

This is another incremental cleanup that untangles some of the parameter passing during test collection, making it easier to see which pieces of context information are read-only, and making it easier to find where each field is used.
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 18, 2024
compiletest: Store test collection context/state in two structs

This is another incremental cleanup that untangles some of the parameter passing during test collection, making it easier to see which pieces of context information are read-only, and making it easier to find where each field is used.
Comment on lines 1032 to 1026
fn check_overlapping_tests(found_paths: &HashSet<PathBuf>) {
fn check_for_overlapping_test_paths(found_path_stems: &BTreeSet<PathBuf>) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is actually perf difference, 0710ebb

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, that was linked before #131870 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description said "Wall time didn't improved :-) ."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, I'm going to rerun some benchmarks locally

@jieyouxu
Copy link
Member

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 18, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Oct 18, 2024

@Zalathar let's stick with HashSet for the time being. This seems strange to be using a HashSet anyway, I would've expected some analysis based on a prefix tree perhaps

@Zalathar
Copy link
Contributor Author

BTreeSet change removed; back to the original HashSet.

@jieyouxu
Copy link
Member

Thanks. @bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 18, 2024

📌 Commit 5540976 has been approved by 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 Oct 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2024
Rollup of 3 pull requests

Successful merges:

 - rust-lang#126207 (std::unix::stack_overflow::drop_handler addressing todo through libc …)
 - rust-lang#131864 (Never emit `vptr` for empty/auto traits)
 - rust-lang#131870 (compiletest: Store test collection context/state in two structs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 43e5093 into rust-lang:master Oct 18, 2024
12 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2024
Rollup merge of rust-lang#131870 - Zalathar:test-collector, r=jieyouxu

compiletest: Store test collection context/state in two structs

This is another incremental cleanup that untangles some of the parameter passing during test collection, making it easier to see which pieces of context information are read-only, and making it easier to find where each field is used.
@rustbot rustbot added this to the 1.84.0 milestone Oct 18, 2024
@Zalathar Zalathar deleted the test-collector branch October 18, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants