Skip to content

Commit 90b6f86

Browse files
committed
Update to perf test suppoer and 'libuv1'
2 parents fbdfa42 + 9f94f63 commit 90b6f86

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
107107
sudo apt-get install -qq pkg-config -y
108108
sudo apt-get install -qq libxml2-dev libcurl4-openssl-dev libssl-dev libgit2-dev libharfbuzz-dev libfribidi-dev libfontconfig1-dev -y
109-
sudo apt-get install -qq libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev -y
109+
sudo apt-get install -qq libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libuv1-dev -y
110110
sudo apt-get install -qq r-base -y
111111
sudo R -e "install.packages('devtools', dependencies=TRUE)"
112112
sudo R -e "install.packages('RANN', dependencies=TRUE)"

tests/testthat/perf_tests/perf_rate.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ perf.reference.save <- function(perf.ref.name, rate, tolerance.lower, tolerance.
4545
.perf.reference <<- .perf.reference
4646
}
4747

48+
# Obtain performance test duration from PERF_DURATION_SEC environment variable, otherwise default.duration argument, otherwise "30".
49+
perf.testduration <- function(default.duration = 30) {
50+
base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = base::as.character(default.duration)))
51+
}
52+
4853
perf.reference.rate <- function(perf.ref.name) {
4954
if (is.null(.perf.reference))
5055
.load.pref()

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 <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
33+
.durationSec <- perf.testduration(30)
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 <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
68+
.durationSec <- perf.testduration(30)
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 <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
33+
.durationSec <- perf.testduration(30)
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 <- base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = "30")) # defaults to 30 seconds
68+
.durationSec <- perf.testduration(30)
6969
.count <- 0
7070
.start.time <- Sys.time()
7171
.current.time <- .start.time

0 commit comments

Comments
 (0)