Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
40 changes: 27 additions & 13 deletions R/reporter-progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,10 @@ ProgressReporter <- R6::R6Class(
snapshotter$end_file()
}

# Separate from the progress bar
self$cat_line()
stop_reporter(c(
"Maximum number of failures exceeded; quitting at end of file.",
"Maximum number of failures exceeded; quitting.",
i = "Increase this number with (e.g.) {.run testthat::set_max_fails(Inf)}"
))
},
Expand Down Expand Up @@ -462,22 +464,34 @@ ParallelProgressReporter <- R6::R6Class(
},

end_file = function() {
fsts <- self$files[[self$file_name]]
time <- proc.time() - fsts$start_time
if (!self$is_full()) {
fsts <- self$files[[self$file_name]]
time <- proc.time() - fsts$start_time

# Workaround for https://github.com/rstudio/rstudio/issues/7649
if (self$is_rstudio) {
self$cat_tight(strpad(self$cr(), self$width + 1)) # +1 for \r
}
self$show_status(complete = TRUE, time = time[[3]], pad = TRUE)
self$report_issues(fsts$issues)
# Workaround for https://github.com/rstudio/rstudio/issues/7649
if (self$is_rstudio) {
self$cat_tight(strpad(self$cr(), self$width + 1)) # +1 for \r
}
self$show_status(complete = TRUE, time = time[[3]], pad = TRUE)
self$report_issues(fsts$issues)

self$files[[self$file_name]] <- NULL
if (length(self$files)) {
self$files[[self$file_name]] <- NULL
if (length(self$files)) {
self$update(force = TRUE)
}
} else {
self$update(force = TRUE)
}
self$cat_line()
self$rule()

if (self$is_full()) {
issues <- unlist(
map(self$files, \(x) x$issues$as_list()),
recursive = FALSE
)
summary <- map_chr(issues, issue_summary)
self$cat_tight(paste(summary, collapse = "\n\n"))

self$cat_line()
self$report_full()
}
},
Expand Down
7 changes: 0 additions & 7 deletions tests/testthat/_snaps/describe.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# snapshot tests in describe

Code
1 + 1
Output
[1] 2

# snapshot tests in describe / and in it

Code
Expand Down
9 changes: 5 additions & 4 deletions tests/testthat/_snaps/reporter-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
`actual`: FALSE
`expected`: TRUE
--------------------------------------------------------------------------------
Maximum number of failures exceeded; quitting at end of file.

Maximum number of failures exceeded; quitting.
i Increase this number with (e.g.) `testthat::set_max_fails(Inf)`

# can fully suppress incremental updates
Expand Down Expand Up @@ -564,7 +565,7 @@
v | F W S OK | Context

- [ FAIL 0 | WARN 0 | SKIP 0 | PASS 0 ] Starting up...
x | 11 0 | reporters/fail-many
\ [ FAIL 11 | WARN 0 | SKIP 0 | PASS 0 ] @ reporters/fail-many
--------------------------------------------------------------------------------
Failure ('reporters/fail-many.R:3:5'): Example
FALSE (`actual`) is not equal to TRUE (`expected`).
Expand Down Expand Up @@ -631,8 +632,8 @@

`actual`: FALSE
`expected`: TRUE
--------------------------------------------------------------------------------
Maximum number of failures exceeded; quitting at end of file.

Maximum number of failures exceeded; quitting.
i Increase this number with (e.g.) `testthat::set_max_fails(Inf)`

Expand Down
Loading