Skip to content

compiletest: Report filtered and --skip-ed tests in metrics #155555

Open
jyn514 wants to merge 4 commits intorust-lang:mainfrom
ferrocene:jyn/compiletest-integration-tests
Open

compiletest: Report filtered and --skip-ed tests in metrics #155555
jyn514 wants to merge 4 commits intorust-lang:mainfrom
ferrocene:jyn/compiletest-integration-tests

Conversation

@jyn514
Copy link
Copy Markdown
Member

@jyn514 jyn514 commented Apr 20, 2026

Ferrocene depends on these metrics for our certification. For various reasons our CI invokes bootstrap with --skip flags, so we want to report ignored tests even if they're ignored manually with --skip.

To make sure this doesn't regress, add an integration test suite for compiletest itself. This can't fit into the existing compiletest-self-test suite because it's testing the interface between bootstrap and compiletest, not just whether the tests pass or fail. Hopefully this will come in handy for more things in the future.


Changes in this PR:

  • Move deserialization of compiletest JSON from bootstrap to build_helper. Derive Debug on all its types.
  • Add std to the sysroot before running compiletest self-tests, so that it can run integration tests and not just unit tests.
  • Add a new FilteredOut metric kind. Handle it appropriately (by not doing anything) in progress reporting, but save it to the metrics.json file.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 20, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

r? @Mark-Simulacrum

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @jieyouxu, @oli-obk, @wesleywiser, bootstrap
  • @jieyouxu, @oli-obk, @wesleywiser, bootstrap expanded to 8 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu, wesleywiser

@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the jyn/compiletest-integration-tests branch 2 times, most recently from 2235bed to c4f30fb Compare April 20, 2026 14:19
@rustbot rustbot added A-CI Area: Our Github Actions CI T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Apr 20, 2026
@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the jyn/compiletest-integration-tests branch from c4f30fb to a04daaf Compare April 20, 2026 14:41
@rust-log-analyzer

This comment has been minimized.

@jyn514 jyn514 force-pushed the jyn/compiletest-integration-tests branch from a04daaf to b35ca65 Compare April 20, 2026 15:17
@rust-log-analyzer

This comment has been minimized.

Copy link
Copy Markdown
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

Comment thread src/tools/compiletest/Cargo.toml Outdated
Comment thread Cargo.lock Outdated
#[derive(serde_derive::Deserialize, Debug)]
pub struct TestOutcome {
pub name: String,
pub exec_time: Option<f64>,
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.

Do we standardize on a particular unit for time in this file? Maybe time_secs, or add comments indicating expected unit?

}

#[derive(serde_derive::Deserialize, Debug)]
pub struct BenchOutcome {
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.

Huh, I didn't know compiletest ever ran benchmarks... maybe I'm misreading though and some of these are really not from compiletest? Maybe we can add a comment on mod compiletest indicating the mixed origin?

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.

This is output that compiletest is parsing, not that compiletest is emitting. I'll leave a comment.

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 no I'm wrong ... I'm not sure why this is here. I think left over from before the refactor away from libtest?

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.

in any case, I'd prefer to hear from a reviewer they're ok with the overall approach before I spend a bunch of time doing cleanups.

Comment thread src/ci/citool/src/analysis.rs Outdated
match outcome {
TestOutcome::Passed => "pass".to_string(),
TestOutcome::Failed => "fail".to_string(),
TestOutcome::FilteredOut => "ignore".to_string(),
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.

Should this be ignore (filtered out)?

@rustbot rustbot assigned jieyouxu and unassigned Mark-Simulacrum Apr 26, 2026
@jyn514 jyn514 force-pushed the jyn/compiletest-integration-tests branch from c2f5e3c to 1552ae4 Compare May 1, 2026 09:34
@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI 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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants