Skip to content

Commit 6d1ba4a

Browse files
authored
Bugfix/travis (#954)
* always set test running environment variable on Travis * set env var for R in ci Dockerfile via ENV
1 parent d55f9f1 commit 6d1ba4a

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
* DESCRIPTION (Version, Date): Roll minor version
44

5+
* tests/doRUnit.R: On Travis always set RunAllRcppTests
6+
7+
* docker/ci/Dockerfile: Set environment variables container-wide
8+
59
2019-03-18 Dirk Eddelbuettel <[email protected]>
610

711
* inst/include/Rcpp/macros/macros.h (END_RCPP_RETURN_ERROR): Add

docker/ci/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ RUN apt-get update \
1919
r-cran-lazyeval \
2020
r-cran-withr \
2121
git \
22-
&& install.r rbenchmark pinp covr \
23-
&& mkdir ~/.R \
24-
&& echo _R_CHECK_FORCE_SUGGESTS_=FALSE > ~/.R/check.Renviron \
25-
&& echo RunAllRcppTests=yes >> ~/.R/check.Renviron
22+
&& install.r rbenchmark pinp covr
23+
24+
ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
25+
ENV RunAllRcppTests yes
2626

2727
CMD ["bash"]

tests/doRUnit.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if (requireNamespace("RUnit", quietly=TRUE) &&
4343

4444
Sys.setenv("R_TESTS"="") # without this, we get (or used to get) unit test failures
4545

46-
## force tests to be executed if in dev release which we define as
46+
## Force tests to be executed if in dev release which we define as
4747
## having a sub-release, eg 0.9.15.5 is one whereas 0.9.16 is not
4848
if (length(strsplit(packageDescription("Rcpp")$Version, "\\.")[[1]]) > 3) { # dev release, and
4949
if (Sys.getenv("RunAllRcppTests") != "no") { # if env.var not yet set
@@ -52,6 +52,14 @@ if (requireNamespace("RUnit", quietly=TRUE) &&
5252
}
5353
}
5454

55+
## On Travis also always set tests; see
56+
## https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
57+
if ((Sys.getenv("CI") == "true") || (Sys.getenv("TRAVIS") == "true") ||
58+
(Sys.getenv("CONTINUOUS_INTEGRATION") == "true")) {
59+
message("Always enabling \"RunAllRcppTests\"=\"yes\" on Travis\n")
60+
Sys.setenv("RunAllRcppTests"="yes")
61+
}
62+
5563
tests <- runTestSuite(testSuite) # Run tests
5664

5765
printTextProtocol(tests) # Print results

0 commit comments

Comments
 (0)