From 27446ca426fc446f68e1e6b7c62e4f9fc6fa67d9 Mon Sep 17 00:00:00 2001 From: "alex.hill@gmail.com" Date: Sun, 10 Nov 2024 23:02:32 +0000 Subject: [PATCH] make sure snapshot action fails on CI if tests fail --- snapshot-tests.Dockerfile | 2 +- tests/snapshots/test-snapshots | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/snapshot-tests.Dockerfile b/snapshot-tests.Dockerfile index 7eaa348..1885ce8 100644 --- a/snapshot-tests.Dockerfile +++ b/snapshot-tests.Dockerfile @@ -11,4 +11,4 @@ COPY DESCRIPTION /epikinetics RUN Rscript -e "devtools::install_deps()" RUN Rscript -e "install.packages('decor')" -COPY . /epikinetics \ No newline at end of file +COPY . /epikinetics diff --git a/tests/snapshots/test-snapshots b/tests/snapshots/test-snapshots index b11367a..6956434 100755 --- a/tests/snapshots/test-snapshots +++ b/tests/snapshots/test-snapshots @@ -2,4 +2,4 @@ set -ex docker build . -f snapshot-tests.Dockerfile -t epikinetics-test -docker run epikinetics-test Rscript -e "devtools::test(filter='snapshot')" +docker run epikinetics-test Rscript -e "res=devtools::test(filter='snapshot');df=as.data.frame(res);if(sum(df\$failed) > 0 || any(df\$error)) {q(status=1)}"