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

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Jan 3, 2025

@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
Copy link
Contributor

Zalathar commented Jan 3, 2025

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
Member

Please assign/ping me once it's ready.

@jieyouxu
Copy link
Member Author

jieyouxu commented Jan 3, 2025

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
Copy link
Contributor

Zalathar commented Jan 4, 2025

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
Copy link
Member Author

jieyouxu commented Jan 4, 2025

Indeed we could.

@bors
Copy link
Contributor

bors commented Jan 4, 2025

☔ 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
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
Contributor

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
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
Contributor

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.

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