Skip to content

Commit 6868a31

Browse files
committed
tune test selection
1 parent 73d5eff commit 6868a31

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2021-01-16 Dirk Eddelbuettel <[email protected]>
2+
3+
* tests/tinytest.R: Also test for CODECOV when deciding to run
4+
extensive tests or just a subset
5+
16
2021-01-14 Dirk Eddelbuettel <[email protected]>
27

38
* DESCRIPTION (Date, Version): Release 1.0.6

tests/tinytest.R

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11

2-
if (requireNamespace("tinytest", quietly=TRUE) &&
3-
utils::packageVersion("tinytest") >= "1.0.0") {
2+
if (requireNamespace("tinytest", quietly=TRUE)) {
43

54
## Set a seed to make the test deterministic
65
set.seed(42)
76

8-
## R makes us to this
7+
## R makes us do this (but tinytest now sets it too)
98
Sys.setenv("R_TESTS"="")
109

1110
## Force tests to be executed if in dev release which we define as
@@ -23,15 +22,20 @@ if (requireNamespace("tinytest", quietly=TRUE) &&
2322

2423
## On Travis also always set tests; see
2524
## https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
26-
if ((Sys.getenv("CI") == "true") ||
27-
(Sys.getenv("TRAVIS") == "true") ||
28-
(Sys.getenv("CONTINUOUS_INTEGRATION") == "true")) {
25+
## GitHub Action also set CI variable; see
26+
## https://docs.github.com/en/actions/reference/environment-variables
27+
## (but we may not see these as we are in Docker)
28+
## Ensure Codecov runs full tests too
29+
if ((Sys.getenv("CI") == "true") ||
30+
(Sys.getenv("TRAVIS") == "true") ||
31+
(Sys.getenv("CONTINUOUS_INTEGRATION") == "true") ||
32+
(Sys.getenv("CODECOV_TOKEN") != "")) {
2933
if (Sys.getenv("RunAllRcppTests") != "no") { # if env.var not yet set
30-
message("Always enabling \"RunAllRcppTests\"=\"yes\" on Travis\n")
34+
message("Always enabling \"RunAllRcppTests\"=\"yes\" in CI\n")
3135
Sys.setenv("RunAllRcppTests"="yes")
3236
}
3337
if (Sys.getenv("RunVerboseRcppTests") != "no") { # if env.var not yet set
34-
message("Always enabling \"RunVerboseRcppTests\"=\"yes\" on Travis\n")
38+
message("Always enabling \"RunVerboseRcppTests\"=\"yes\" in CI\n")
3539
Sys.setenv("RunVerboseRcppTests"="yes")
3640
}
3741
}

0 commit comments

Comments
 (0)