From 92991b1a412e90497a10da6301dd541092651f5c Mon Sep 17 00:00:00 2001 From: Greg Freedman Ellis Date: Tue, 28 Jan 2025 10:42:25 -0600 Subject: [PATCH 1/2] [188831953]: Fail on test failures --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 57f6f7637..8466c9c22 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ test-ci: compress-fixtures | R --slave -e 'library(covr); install_dir <- tempfile(); test_run <- try(to_cobertura(package_coverage(quiet=FALSE, install_path=install_dir, clean=FALSE))); for (file in list.files(install_dir, pattern = "\\.Rout(\\.fail)?$$", recursive=TRUE, full.names=TRUE)) { cat(readLines(file), sep = "\n"); cat("\n") }; if (inherits(test_run, "try-error")) stop("Test failed!\n", attr(test_run, "condition")[["message"]], "\n", format(attr(test_run, "condition")[["call"]]))' test-ci-partial: compress-fixtures | - cd tests/ && R --slave -e 'library(devtools); source("../inst/junit_fix.R"); library(testthat); test(filter="${file_regex}", reporter = MultiReporter$$new(list(SummaryReporter$$new(), JunitReporterFix$$new(file = file.path(Sys.getenv("WORKSPACE"), "rcrunch.xml")))));' + cd tests/ && R --slave -e 'library(devtools); source("../inst/junit_fix.R"); library(testthat); test(filter="${file_regex}", reporter = MultiReporter$$new(list(SummaryReporter$$new(), FailReporter$$new(), JunitReporterFix$$new(file = file.path(Sys.getenv("WORKSPACE"), "rcrunch.xml")))));' clean: R --slave -e 'library(crunch); set_crunch_opts(crunch.api=envOrOption("test.api"), crunch.api.key=envOrOption("crunch.test.api.key")); lapply(urls(datasets()), crDELETE)' From 50f0607740e30cccc40d714db45b3ba8c2e561a6 Mon Sep 17 00:00:00 2001 From: Greg Freedman Ellis Date: Tue, 28 Jan 2025 13:46:18 -0600 Subject: [PATCH 2/2] [188831953]: but still make XML even when failing --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8466c9c22..30f5a5c9e 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ test-ci: compress-fixtures | R --slave -e 'library(covr); install_dir <- tempfile(); test_run <- try(to_cobertura(package_coverage(quiet=FALSE, install_path=install_dir, clean=FALSE))); for (file in list.files(install_dir, pattern = "\\.Rout(\\.fail)?$$", recursive=TRUE, full.names=TRUE)) { cat(readLines(file), sep = "\n"); cat("\n") }; if (inherits(test_run, "try-error")) stop("Test failed!\n", attr(test_run, "condition")[["message"]], "\n", format(attr(test_run, "condition")[["call"]]))' test-ci-partial: compress-fixtures | - cd tests/ && R --slave -e 'library(devtools); source("../inst/junit_fix.R"); library(testthat); test(filter="${file_regex}", reporter = MultiReporter$$new(list(SummaryReporter$$new(), FailReporter$$new(), JunitReporterFix$$new(file = file.path(Sys.getenv("WORKSPACE"), "rcrunch.xml")))));' + cd tests/ && R --slave -e 'library(devtools); source("../inst/junit_fix.R"); library(testthat); test(filter="${file_regex}", reporter = MultiReporter$$new(list(SummaryReporter$$new(), JunitReporterFix$$new(file = file.path(Sys.getenv("WORKSPACE"), "rcrunch.xml")), FailReporter$$new())));' clean: R --slave -e 'library(crunch); set_crunch_opts(crunch.api=envOrOption("test.api"), crunch.api.key=envOrOption("crunch.test.api.key")); lapply(urls(datasets()), crDELETE)'