Extract relevant information from a testthat_results object into a tidy
tibble::tibble().
Arguments
- lTestResults
(
testthat_results) A testthat test results object, typically obtained by running something liketestthat::test_local()withstop_on_failure = FALSEand a reporter that doesn't cause issues in parallel testing, likereporter = "silent", and assigning it to a name.
Value
A qcthat_TestResults object, which is a tibble::tibble() with
columns:
Test: Thedescfield of the test fromtestthat::test_that().File: File where the test is defined.Disposition: Factor with levelspass,fail, andskipindicating the overall outcome of the test.Issues: List column containing integer vectors of associated GitHub issue numbers.
Examples
# Generate a test results object.
# lTestResults <- testthat::test_local(
# stop_on_failure = FALSE,
# reporter = "silent"
# )
lTestResults <- structure(
list(
list(
file = "test-file1.R",
test = "First test with one GH issue (#32)",
results = list(
structure(
list(),
class = c("expectation_success", "expectation", "condition")
)
)
),
list(
file = "test-file1.R",
test = "Second test with two GH issues (#32, #45)",
results = list(
structure(
list(),
class = c("expectation_failure", "expectation", "error", "condition")
)
)
)
),
class = "testthat_results"
)
CompileTestResults(lTestResults)
#> # A tibble: 2 × 4
#> Test File Disposition Issues
#> * <chr> <chr> <fct> <list>
#> 1 First test with one GH issue (#32) test-file1.R pass <int [1]>
#> 2 Second test with two GH issues (#32, #45) test-file1.R fail <int [2]>