Skip to content

Commit 9355d8f

Browse files
authored
In CheckReporter, also display summary at top (#1543)
This is useful when look at the full results in CI
1 parent b9b253a commit 9355d8f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

R/reporter-check.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ CheckReporter <- R6::R6Class("CheckReporter",
3535
},
3636

3737
end_reporter = function() {
38+
self$cat_line(summary_line(
39+
n_fail = self$problems$size(),
40+
n_warn = self$warnings$size(),
41+
n_skip = self$skips$size(),
42+
n_pass = self$n_ok
43+
))
44+
self$cat_line()
45+
3846
if (self$skips$size() > 0) {
3947
self$rule("Skipped tests", line = 2)
4048
self$cat_line(skip_bullets(self$skips$as_list()))

tests/testthat/_snaps/reporter-check.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# basic report works
22

3+
[ FAIL 4 | WARN 1 | SKIP 3 | PASS 1 ]
4+
35
== Skipped tests ===============================================================
46
* empty test (2)
57
* skip (1)
@@ -39,6 +41,8 @@
3941

4042
# doesn't truncate long lines
4143

44+
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]
45+
4246
== Failed tests ================================================================
4347
-- Failure (long-test.R:2:3): That very long test messages are not truncated because they contain useful information that you probably want to read --
4448
Failure has been forced
@@ -48,9 +52,13 @@
4852
# always shows summary
4953

5054
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 7 ]
55+
56+
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 7 ]
5157

5258
# shows warnings when not on CRAN
5359

60+
[ FAIL 4 | WARN 1 | SKIP 3 | PASS 1 ]
61+
5462
== Skipped tests ===============================================================
5563
* empty test (2)
5664
* skip (1)

0 commit comments

Comments
 (0)