@@ -155,7 +155,7 @@ async fn populate_report(
155
155
. entry ( confidence. is_definitely_relevant ( ) . then ( || direction) )
156
156
. or_default ( ) ;
157
157
158
- entry. push ( write_summary ( ctxt, comparison) . await )
158
+ entry. push ( write_triage_summary ( ctxt, comparison) . await )
159
159
}
160
160
}
161
161
}
@@ -372,7 +372,7 @@ impl ComparisonSummary {
372
372
}
373
373
}
374
374
375
- async fn write_summary ( ctxt : & SiteCtxt , comparison : & Comparison ) -> String {
375
+ async fn write_triage_summary ( ctxt : & SiteCtxt , comparison : & Comparison ) -> String {
376
376
use std:: fmt:: Write ;
377
377
let mut result = if let Some ( pr) = comparison. b . pr {
378
378
let title = github:: pr_title ( pr) . await ;
@@ -393,7 +393,7 @@ async fn write_summary(ctxt: &SiteCtxt, comparison: &Comparison) -> String {
393
393
let primary = primary. unwrap_or_else ( ComparisonSummary :: empty) ;
394
394
let secondary = secondary. unwrap_or_else ( ComparisonSummary :: empty) ;
395
395
396
- write_summary_table ( & primary, & secondary, & mut result) ;
396
+ write_summary_table ( & primary, & secondary, false , & mut result) ;
397
397
398
398
result
399
399
}
@@ -402,6 +402,7 @@ async fn write_summary(ctxt: &SiteCtxt, comparison: &Comparison) -> String {
402
402
pub fn write_summary_table (
403
403
primary : & ComparisonSummary ,
404
404
secondary : & ComparisonSummary ,
405
+ with_footnotes : bool ,
405
406
result : & mut String ,
406
407
) {
407
408
use std:: fmt:: Write ;
@@ -421,7 +422,8 @@ pub fn write_summary_table(
421
422
. unwrap ( ) ;
422
423
writeln ! (
423
424
result,
424
- "| count[^1] | {} | {} | {} | {} | {} |" ,
425
+ "| count{} | {} | {} | {} | {} | {} |" ,
426
+ if with_footnotes { "[^1]" } else { "" } ,
425
427
primary. num_regressions,
426
428
secondary. num_regressions,
427
429
primary. num_improvements,
@@ -432,7 +434,8 @@ pub fn write_summary_table(
432
434
433
435
writeln ! (
434
436
result,
435
- "| mean[^2] | {} | {} | {} | {} | {} |" ,
437
+ "| mean{} | {} | {} | {} | {} | {} |" ,
438
+ if with_footnotes { "[^2]" } else { "" } ,
436
439
render_stat( primary. num_regressions, || Some (
437
440
primary. arithmetic_mean_of_regressions( )
438
441
) ) ,
@@ -511,13 +514,15 @@ pub fn write_summary_table(
511
514
. unwrap ( ) ;
512
515
}
513
516
514
- writeln ! (
515
- result,
516
- r#"
517
+ if with_footnotes {
518
+ writeln ! (
519
+ result,
520
+ r#"
517
521
[^1]: *number of relevant changes*
518
522
[^2]: *the arithmetic mean of the percent change*"#
519
- )
520
- . unwrap ( ) ;
523
+ )
524
+ . unwrap ( ) ;
525
+ }
521
526
}
522
527
523
528
/// The amount of confidence we have that a comparison actually represents a real
@@ -1275,16 +1280,13 @@ fn compare_link(start: &ArtifactId, end: &ArtifactId) -> String {
1275
1280
1276
1281
#[ cfg( test) ]
1277
1282
mod tests {
1283
+ use super :: * ;
1284
+
1278
1285
use collector:: category:: Category ;
1279
1286
use std:: collections:: HashSet ;
1280
1287
1281
1288
use database:: { ArtifactId , Profile , Scenario } ;
1282
1289
1283
- use crate :: comparison:: {
1284
- write_summary_table, ArtifactDescription , Comparison , ComparisonSummary ,
1285
- TestResultComparison ,
1286
- } ;
1287
-
1288
1290
#[ test]
1289
1291
fn summary_table_only_regressions_primary ( ) {
1290
1292
check_table (
@@ -1487,7 +1489,7 @@ mod tests {
1487
1489
let secondary = create_summary ( secondary_statistics) ;
1488
1490
1489
1491
let mut result = String :: new ( ) ;
1490
- write_summary_table ( & primary, & secondary, & mut result) ;
1492
+ write_summary_table ( & primary, & secondary, true , & mut result) ;
1491
1493
assert_eq ! ( result, expected) ;
1492
1494
}
1493
1495
0 commit comments