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

Rollup of 7 pull requests #138630

Merged
merged 28 commits into from
Mar 18, 2025
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
50c659f
Clarify "owned data" in E0515.md
hkBst Mar 14, 2025
899eed1
Refactor metrics generation step
Kobzol Mar 14, 2025
301c384
Do not fail the build if metrics postprocessing or DataDog upload fails
Kobzol Mar 14, 2025
09d44a4
Print metrics postprocessing to stdout
Kobzol Mar 14, 2025
e757dea
Refactor metrics and analysis in citool to distinguish them better
Kobzol Mar 15, 2025
413fd52
Print number of found test diffs
Kobzol Mar 15, 2025
6c24c9c
Use first-level heading for test differences header
Kobzol Mar 15, 2025
30d5757
Print test diffs into GitHub summary
Kobzol Mar 15, 2025
634a11e
Add bootstrap stage to test names
Kobzol Mar 15, 2025
232be86
Add a helper function for outputting details
Kobzol Mar 15, 2025
b4cccf0
Put test differences into a `<details>` section and add better explan…
Kobzol Mar 15, 2025
e845318
Do not error out on missing parent metrics
Kobzol Mar 15, 2025
4801dba
Reformat code
Kobzol Mar 15, 2025
7c792e2
Only use `DIST_TRY_BUILD` for try jobs that were not selected explicitly
Kobzol Mar 15, 2025
b2fda93
Add a note to rustc-dev-guide
Kobzol Mar 16, 2025
6698c26
Fix `is_relevant_impl`.
nnethercote Mar 12, 2025
b148106
Fix ICE: attempted to remap an already remapped filename
charmitro Mar 16, 2025
0ee99cf
rustc_target: Add target feature constraints for LoongArch
heiher Mar 17, 2025
36f6bc5
Flatten `if`s in `rustc_codegen_ssa`
yotamofek Mar 17, 2025
f2ddbcd
Move `hir::Item::ident` into `hir::ItemKind`.
nnethercote Mar 6, 2025
c9d3147
Small review improvements
Kobzol Mar 17, 2025
e1acc68
Rollup merge of #138384 - nnethercote:hir-ItemKind-idents, r=fmease
matthiaskrgr Mar 17, 2025
01062ba
Rollup merge of #138508 - hkBst:patch-3, r=wesleywiser
matthiaskrgr Mar 17, 2025
5786233
Rollup merge of #138531 - Kobzol:test-diff-try-build, r=marcoieni
matthiaskrgr Mar 17, 2025
c19ce9d
Rollup merge of #138533 - Kobzol:try-job-auto-tests, r=marcoieni
matthiaskrgr Mar 17, 2025
cd4dfd7
Rollup merge of #138556 - charmitro:already-remapped-filename, r=Guil…
matthiaskrgr Mar 17, 2025
aa53a72
Rollup merge of #138608 - heiher:issue-116344, r=RalfJung
matthiaskrgr Mar 17, 2025
597500d
Rollup merge of #138619 - yotamofek:pr/codegen_ssa/flatten-ifs, r=lcnr
matthiaskrgr Mar 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Put test differences into a <details> section and add better explan…
…ation of the post merge report
Kobzol committed Mar 15, 2025
commit b4cccf01587ac672dee7a92df7e3e21728f5b7aa
63 changes: 35 additions & 28 deletions src/ci/citool/src/analysis.rs
Original file line number Diff line number Diff line change
@@ -246,7 +246,6 @@ fn report_test_diffs(diff: AggregatedTestDiffs) {
println!("No test diffs found");
return;
}
println!("\n{} test {} found\n", diff.diffs.len(), pluralize("difference", diff.diffs.len()));

fn format_outcome(outcome: &TestOutcome) -> String {
match outcome {
@@ -320,34 +319,42 @@ fn report_test_diffs(diff: AggregatedTestDiffs) {
// Sort diffs by job group and test name
grouped_diffs.sort_by(|(d1, g1), (d2, g2)| g1.cmp(&g2).then(d1.test.name.cmp(&d2.test.name)));

for (diff, job_group) in grouped_diffs {
println!(
"- `{}`: {} ({})",
diff.test.name,
format_diff(&diff.diff),
format_job_group(job_group)
);
}
output_details(
&format!("Show {} test {}\n", original_diff_count, pluralize("diff", original_diff_count)),
|| {
for (diff, job_group) in grouped_diffs {
println!(
"- `{}`: {} ({})",
diff.test.name,
format_diff(&diff.diff),
format_job_group(job_group)
);
}

let extra_diffs = diffs.len().saturating_sub(max_diff_count);
if extra_diffs > 0 {
println!("\n(and {extra_diffs} additional {})", pluralize("test diff", extra_diffs));
}
let extra_diffs = diffs.len().saturating_sub(max_diff_count);
if extra_diffs > 0 {
println!(
"\n(and {extra_diffs} additional {})",
pluralize("test diff", extra_diffs)
);
}

if doctest_count > 0 {
println!(
"\nAdditionally, {doctest_count} doctest {} were found. These are ignored, as they are noisy.",
pluralize("diff", doctest_count)
);
}
if doctest_count > 0 {
println!(
"\nAdditionally, {doctest_count} doctest {} were found. These are ignored, as they are noisy.",
pluralize("diff", doctest_count)
);
}

// Now print the job group index
println!("\n**Job group index**\n");
for (group, jobs) in job_index.into_iter().enumerate() {
println!(
"- {}: {}",
format_job_group(group as u64),
jobs.iter().map(|j| format!("`{j}`")).collect::<Vec<_>>().join(", ")
);
}
// Now print the job group index
println!("\n**Job group index**\n");
for (group, jobs) in job_index.into_iter().enumerate() {
println!(
"- {}: {}",
format_job_group(group as u64),
jobs.iter().map(|j| format!("`{j}`")).collect::<Vec<_>>().join(", ")
);
}
},
);
}
23 changes: 18 additions & 5 deletions src/ci/citool/src/main.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ use crate::cpu_usage::load_cpu_usage;
use crate::datadog::upload_datadog_metric;
use crate::jobs::RunType;
use crate::metrics::{JobMetrics, download_auto_job_metrics, download_job_metrics, load_metrics};
use crate::utils::load_env_var;
use crate::utils::{load_env_var, output_details};
use analysis::output_bootstrap_stats;

const CI_DIRECTORY: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/..");
@@ -159,6 +159,22 @@ fn postprocess_metrics(
Ok(())
}

fn post_merge_report(db: JobDatabase, current: String, parent: String) -> anyhow::Result<()> {
let metrics = download_auto_job_metrics(&db, &parent, &current)?;

output_details("What is this?", || {
println!(
r#"This is an experimental post-merge analysis report that shows differences in
test outcomes between the merged PR and its parent PR."#
);
});

println!("\nComparing {parent} (parent) -> {current} (this PR)\n");
output_test_diffs(metrics);

Ok(())
}

#[derive(clap::Parser)]
enum Args {
/// Calculate a list of jobs that should be executed on CI.
@@ -243,10 +259,7 @@ fn main() -> anyhow::Result<()> {
postprocess_metrics(metrics_path, parent, job_name)?;
}
Args::PostMergeReport { current, parent } => {
let db = load_db(default_jobs_file)?;
let metrics = download_auto_job_metrics(&db, &parent, &current)?;
println!("Comparing {parent} (base) -> {current} (this PR)\n");
output_test_diffs(metrics);
post_merge_report(load_db(default_jobs_file)?, current, parent)?;
}
}

4 changes: 3 additions & 1 deletion src/ci/citool/src/utils.rs
Original file line number Diff line number Diff line change
@@ -22,7 +22,9 @@ where
{
println!(
r"<details>
<summary>{summary}</summary>"
<summary>{summary}</summary>
"
);
func();
println!("</details>\n");