Skip to content

[EXPLORATORY] bootstrap: break up test.rs into smaller modules by test kind#135072

Closed
jieyouxu wants to merge 2 commits into
rust-lang:masterfrom
jieyouxu:exp-test-step-cat
Closed

[EXPLORATORY] bootstrap: break up test.rs into smaller modules by test kind#135072
jieyouxu wants to merge 2 commits into
rust-lang:masterfrom
jieyouxu:exp-test-step-cat

Conversation

@jieyouxu

@jieyouxu jieyouxu commented Jan 3, 2025

Copy link
Copy Markdown
Member

@rustbot rustbot added 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 Jan 3, 2025
@Zalathar

Zalathar commented Jan 3, 2025

Copy link
Copy Markdown
Member

A few quick notes based on my own exploration:

  • The steps you have in crate_tests can all be thought of as “tool crate tests”, where the category of tool crates can be subdivided into “public tools” and “bootstrap tools”. (Not suggesting splitting these into separate files; just noting the distinction.)
  • You’ve put the Crate step in compiler_crate_tests, and it is used for selftesting compiler crates, but it is also used directly for selftesting standard library crates. It’s a weird one to classify/rename, and those two roles should probably be split into a contributor-facing library test step, and an internal library/compiler helper step.

@jieyouxu jieyouxu added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 3, 2025
@onur-ozkan

Copy link
Copy Markdown
Contributor

Please assign/ping me once it's ready.

@jieyouxu

jieyouxu commented Jan 3, 2025

Copy link
Copy Markdown
Member Author

Please assign/ping me once it's ready.

I'll open a separate PR with a sequence of (more-or-less) atomic commits to split out the modules one-by-one, once we figure out what to do with the weirder test Steps, lol.

@Zalathar

Zalathar commented Jan 4, 2025

Copy link
Copy Markdown
Member

Another thought: if we’re doing a module split and a renaming, maybe we can use the modules as part of the naming convention.

So instead of test::SuiteUi, we might have compiletest_suite::Ui, or something along those lines.

@jieyouxu

jieyouxu commented Jan 4, 2025

Copy link
Copy Markdown
Member Author

Indeed we could.

@bors

bors commented Jan 4, 2025

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #135095) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 4, 2025
Comment on lines +642 to +669
impl Step for CollectLicenseMetadata {
type Output = PathBuf;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/collect-license-metadata")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(CollectLicenseMetadata);
}

fn run(self, builder: &Builder<'_>) -> Self::Output {
let Some(reuse) = &builder.config.reuse else {
panic!("REUSE is required to collect the license metadata");
};

let dest = builder.src.join("license-metadata.json");

let mut cmd = builder.tool_cmd(Tool::CollectLicenseMetadata);
cmd.env("REUSE_EXE", reuse);
cmd.env("DEST", &dest);
cmd.env("ONLY_CHECK", "1");
cmd.run(builder);

dest
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also wait, is this really a test?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the ONLY_CHECK=1 is what makes it a test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've noted this in #135231.

@jieyouxu

Copy link
Copy Markdown
Member Author

Closing in favor of #137224.

@jieyouxu jieyouxu closed this Feb 18, 2025
@jieyouxu jieyouxu deleted the exp-test-step-cat branch February 18, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

5 participants