@@ -18,16 +18,18 @@ plot_against_base <- function(new_bm,
18
18
# if a pull request
19
19
reference <- bm [commit_is_reference , " benchmarks" ][[1 ]][[1 ]]
20
20
# if benchmark exists in base branch
21
- reference <- reference %> %
22
- dplyr :: filter(.data $ name %in% !! name )
23
- if (nrow(reference ) > 0 ) {
24
- # if benchmark exists in base branch
25
- reference $ expression <- bench ::: new_bench_expr(Sys.getenv(" GITHUB_BASE_REF" ))
26
- new_bm <- dplyr :: bind_rows(reference , new_bm )
27
- stopifnot(nrow(new_bm ) == 2 )
28
- diff_in_percent <- round(100 * diff(new_bm $ p50 ) / new_bm $ p50 [1 ])
29
- pr_comment <- glue :: glue(" * {name}: {new_bm$p50[1]} -> {new_bm$p50[2]} ({diff_in_percent}%)\n " )
30
- cat(pr_comment , file = " pr-comment/info.txt" , append = TRUE )
21
+ if (" name" %in% names(reference )) {
22
+ reference <- reference %> %
23
+ dplyr :: filter(.data $ name %in% !! name )
24
+ if (nrow(reference ) > 0 ) {
25
+ # if benchmark exists in base branch
26
+ reference $ expression <- bench ::: new_bench_expr(Sys.getenv(" GITHUB_BASE_REF" ))
27
+ new_bm <- dplyr :: bind_rows(reference , new_bm )
28
+ stopifnot(nrow(new_bm ) == 2 )
29
+ diff_in_percent <- round(100 * diff(new_bm $ p50 ) / new_bm $ p50 [1 ])
30
+ pr_comment <- glue :: glue(" * {name}: {new_bm$p50[1]} -> {new_bm$p50[2]} ({diff_in_percent}%)\n " )
31
+ cat(pr_comment , file = " pr-comment/info.txt" , append = TRUE )
32
+ }
31
33
}
32
34
}
33
35
new_bm $ branch <- factor (new_bm $ expression )
0 commit comments