Skip to content

Commit 1f12d53

Browse files
committed
Permit perf test duration to be set, seconds, by environment variable 'PERF_DURATION_SEC'
1 parent 2f6184e commit 1f12d53

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/testthat/test-perf-meanDS.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test_that("numeric meanDS - performance", {
3030

3131
input <- c(0.0, 1.0, 2.0, 3.0, 4.0)
3232

33-
.durationSec <- 30 # seconds
33+
.durationSec <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
3434
.count <- 0
3535
.start.time <- Sys.time()
3636
.current.time <- .start.time
@@ -65,7 +65,7 @@ test_that("numeric meanDS, with NA - performance", {
6565

6666
input <- c(0.0, NA, 2.0, NA, 4.0)
6767

68-
.durationSec <- 30 # seconds
68+
.durationSec <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
6969
.count <- 0
7070
.start.time <- Sys.time()
7171
.current.time <- .start.time

tests/testthat/test-perf-varDS.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test_that("numeric varDS - performance", {
3030

3131
input <- c(0.0, 1.0, 2.0, 3.0, 4.0)
3232

33-
.durationSec <- 30 # seconds
33+
.durationSec <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
3434
.count <- 0
3535
.start.time <- Sys.time()
3636
.current.time <- .start.time
@@ -65,7 +65,7 @@ test_that("numeric varDS, with NA - performance", {
6565

6666
input <- c(0.0, NA, 2.0, NA, 4.0)
6767

68-
.durationSec <- 30 # seconds
68+
.durationSec <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
6969
.count <- 0
7070
.start.time <- Sys.time()
7171
.current.time <- .start.time

0 commit comments

Comments
 (0)