Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ jobs:
sleep 60
R -q -e "library(opalr); opal <- opal.login('administrator', 'datashield_test&', url='http://localhost:8080/'); dsadmin.profile_init(opal, name = 'default', packages = c('dsBase', 'dsTidyverse', 'resourcer')); opal.logout(opal)"
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.set_option(opal, 'default.datashield.privacyControlLevel', 'permissive'); opal.logout(opal)"
workingDirectory: $(Pipeline.Workspace)/dsBaseClient/tests/testthat/data_files
Expand Down
2 changes: 2 additions & 0 deletions opal_azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ jobs:

sleep 60

R -q -e "library(opalr); opal <- opal.login('administrator', 'datashield_test&', url='http://localhost:8080/'); dsadmin.profile_init(opal, name = 'default', packages = c('dsBase', 'dsTidyverse', 'resourcer')); opal.logout(opal)"

R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.set_option(opal, 'default.datashield.privacyControlLevel', 'permissive'); opal.logout(opal)"

workingDirectory: $(Pipeline.Workspace)/dsBaseClient/tests/testthat/data_files
Expand Down
41 changes: 28 additions & 13 deletions tests/testthat/perf_files/armadillo_azure-pipeline_perf-profile.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
"refer_name","rate","lower_tolerance","upper_tolerance"
"conndisconn::perf::simple0","0.1661","0.5","2"
"ds.abs::perf::0","6.247","0.5","2"
"ds.asInteger::perf:0","5.691","0.5","2"
"ds.asList::perf:0","12.50","0.5","2"
"ds.asNumeric::perf:0","5.723","0.5","2"
"ds.assign::perf::0","10.52","0.5","2"
"ds.class::perf::combine:0","13.73","0.5","2"
"ds.colnames::perf:0","25.64","0.5","2"
"ds.exists::perf::combine:0","25.73","0.5","2"
"ds.length::perf::combine:0","25.44","0.5","2"
"ds.mean::perf::combine:0","25.70","0.5","2"
"ds.mean::perf::split:0","25.72","0.5","2"
"void::perf::void::0","53016.0","0.5","2"
"conndisconn::perf::simple0","0.1621","0.5","2"
"ds.abs::perf::0","5.989","0.5","2"
"ds.asCharacter::perf::0","5.413","0.5","2"
"ds.asDataMatrix::perf::0","5.466","0.5","2"
"ds.asInteger::perf:0","5.570","0.5","2"
"ds.asList::perf:0","11.72","0.5","2"
"ds.asLogical::perf::0","5.516","0.5","2"
"ds.asMatrix::perf::0","5.507","0.5","2"
"ds.asNumeric::perf:0","5.552","0.5","2"
"ds.assign::perf::0","10.21","0.5","2"
"ds.class::perf::combine:0","12.30","0.5","2"
"ds.colnames::perf:0","24.39","0.5","2"
"ds.completeCases::perf::combine:0","5.521","0.5","2"
"ds.dim::perf::combine:0","24.63","0.5","2"
"ds.exists::perf::combine:0","24.74","0.5","2"
"ds.exp::perf::0","6.218","0.5","2"
"ds.isNA::perf::combine:0","9.480","0.5","2"
"ds.length::perf::combine:0","24.94","0.5","2"
"ds.levels::perf::combine:0","9.551","0.5","2"
"ds.log::perf::0","6.286","0.5","2"
"ds.ls::perf::combine:0","25.05","0.5","2"
"ds.mean::perf::combine:0","24.63","0.5","2"
"ds.mean::perf::split:0","25.20","0.5","2"
"ds.names::perf::combine:0","12.37","0.5","2"
"ds.numNA::perf::combine:0","9.64","0.5","2"
"ds.sqrt::perf::0","6.218","0.5","2"
"ds.unique::perf::combine:0","10.20","0.5","2"
"void::perf::void::0","51340.0","0.5","2"
41 changes: 28 additions & 13 deletions tests/testthat/perf_files/armadillo_hp-laptop-quay_perf-profile.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
"refer_name","rate","lower_tolerance","upper_tolerance"
"conndisconn::perf::simple0","0.06790","0.5","2"
"ds.abs::perf::0","1.998","0.5","2"
"ds.asInteger::perf:0","2.111","0.5","2"
"ds.asList::perf:0","4.550","0.5","2"
"ds.asNumeric::perf:0","1.879","0.5","2"
"ds.assign::perf::0","4.806","0.5","2"
"ds.class::perf::combine:0","3.865","0.5","2"
"ds.colnames::perf:0","9.577","0.5","2"
"ds.exists::perf::combine:0","8.411","0.5","2"
"ds.length::perf::combine:0","7.957","0.5","2"
"ds.mean::perf::combine:0","9.049","0.5","2"
"ds.mean::perf::split:0","9.429","0.5","2"
"void::perf::void::0","21400.0","0.5","2"
"conndisconn::perf::simple0","0.07683","0.5","2"
"ds.abs::perf::0","2.473","0.5","2"
"ds.asCharacter::perf::0","2.295","0.5","2"
"ds.asDataMatrix::perf::0","1.999","0.5","2"
"ds.asInteger::perf:0","1.148","0.5","2"
"ds.asList::perf:0","3.398","0.5","2"
"ds.asLogical::perf::0","1.660","0.5","2"
"ds.asMatrix::perf::0","1.835","0.5","2"
"ds.asNumeric::perf:0","1.632","0.5","2"
"ds.assign::perf::0","3.487","0.5","2"
"ds.class::perf::combine:0","5.037","0.5","2"
"ds.colnames::perf:0","8.219","0.5","2"
"ds.completeCases::perf::combine:0","1.896","0.5","2"
"ds.dim::perf::combine:0","8.337","0.5","2"
"ds.exists::perf::combine:0","9.133","0.5","2"
"ds.exp::perf::0","2.317","0.5","2"
"ds.isNA::perf::combine:0","3.035","0.5","2"
"ds.length::perf::combine:0","9.551","0.5","2"
"ds.levels::perf::combine:0","3.275","0.5","2"
"ds.log::perf::0","2.297","0.5","2"
"ds.ls::perf::combine:0","8.168","0.5","2"
"ds.mean::perf::combine:0","8.168","0.5","2"
"ds.mean::perf::split:0","8.465","0.5","2"
"ds.names::perf::combine:0","4.190","0.5","2"
"ds.numNA::perf::combine:0","3.588","0.5","2"
"ds.sqrt::perf::0","2.278","0.5","2"
"ds.unique::perf::combine:0","3.909","0.5","2"
"void::perf::void::0","20280.0","0.5","2"
14 changes: 0 additions & 14 deletions tests/testthat/perf_files/opal_default_perf-profile.csv

This file was deleted.

41 changes: 28 additions & 13 deletions tests/testthat/perf_files/opal_hp-laptop-quay_perf-profile.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
"refer_name","rate","lower_tolerance","upper_tolerance"
"conndisconn::perf::simple0","0.147643461923159","0.5","2"
"ds.abs::perf::0","0.631818039001181","0.5","2"
"ds.asInteger::perf:0","0.675696161933654","0.5","2"
"ds.asList::perf:0","1.59078428438764","0.5","2"
"ds.asNumeric::perf:0","0.692813012683229","0.5","2"
"ds.assign::perf::0","1.89351857736982","0.5","2"
"ds.class::perf::combine:0","1.62870246867488","0.5","2"
"ds.colnames::perf:0","2.7125071","0.5","2"
"ds.exists::perf::combine:0","3.45004426293124","0.5","2"
"ds.length::perf::combine:0","2.78832377100152","0.5","2"
"ds.mean::perf::combine:0","2.7801284055162","0.5","2"
"ds.mean::perf::split:0","3.67443474363821","0.5","2"
"void::perf::void::0","18974.1385397392","0.5","2"
"conndisconn::perf::simple0","0.1267","0.5","2"
"ds.abs::perf::0","0.7542","0.5","2"
"ds.asCharacter::perf::0","0.8126","0.5","2"
"ds.asDataMatrix::perf::0","0.8100","0.5","2"
"ds.asInteger::perf:0","0.8600","0.5","2"
"ds.asList::perf:0","","0.5","2"
"ds.asLogical::perf::0","1.660","0.5","2"
"ds.asMatrix::perf::0","0.8557","0.5","2"
"ds.asNumeric::perf:0","0.7912","0.5","2"
"ds.assign::perf::0","2.003","0.5","2"
"ds.class::perf::combine:0","1.645","0.5","2"
"ds.colnames::perf:0","3.392","0.5","2"
"ds.completeCases::perf::combine:0","0.8218","0.5","2"
"ds.dim::perf::combine:0","3.265","0.5","2"
"ds.exists::perf::combine:0","4.042","0.5","2"
"ds.exp::perf::0","0.8963","0.5","2"
"ds.isNA::perf::combine:0","1.297","0.5","2"
"ds.length::perf::combine:0","3.212","0.5","2"
"ds.levels::perf::combine:0","1.326","0.5","2"
"ds.log::perf::0","0.9260","0.5","2"
"ds.ls::perf::combine:0","3.282","0.5","2"
"ds.mean::perf::combine:0","3.281","0.5","2"
"ds.mean::perf::split:0","4.029","0.5","2"
"ds.names::perf::combine:0","1.713","0.5","2"
"ds.numNA::perf::combine:0","1.274","0.5","2"
"ds.sqrt::perf::0","0.9233","0.5","2"
"ds.unique::perf::combine:0","1.628","0.5","2"
"void::perf::void::0","23600","0.5","2"
58 changes: 58 additions & 0 deletions tests/testthat/test-perf-ds.asCharacter.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#-------------------------------------------------------------------------------
#
# This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------

#
# Set up
#

# context("ds.asCharacter::perf::setup")
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))

#
# Tests
#

# context("ds.asCharacter::perf:0")
test_that("combine - performance", {
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time

while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
ds.asCharacter("D$LAB_TSC", newobj = "perf.newobj")

.count <- .count + 1
.current.time <- Sys.time()
}

.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
.reference.rate <- perf.reference.rate("ds.asCharacter::perf::0")
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
print(paste("ds.asCharacter::perf::0 ", .current.rate, 0.5, 2.0))
perf.reference.save("ds.asCharacter::perf::0", .current.rate, 0.5, 2.0)
} else {
print(paste("ds.asCharacter::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
}

.reference.rate <- perf.reference.rate("ds.asCharacter::perf::0")
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asCharacter::perf::0")
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asCharacter::perf::0")

expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
})

#
# Done
#

# context("ds.asCharacter::perf::shutdown")
disconnect.studies.dataset.cnsim()
# context("ds.asCharacter::perf::done")
58 changes: 58 additions & 0 deletions tests/testthat/test-perf-ds.asDataMatrix.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#-------------------------------------------------------------------------------
#
# This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------

#
# Set up
#

# context("ds.asDataMatrix::perf::setup")
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))

#
# Tests
#

# context("ds.asDataMatrix::perf:0")
test_that("combine - performance", {
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time

while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
ds.asDataMatrix(x.name = "D", newobj = "perf.newobj")

.count <- .count + 1
.current.time <- Sys.time()
}

.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
.reference.rate <- perf.reference.rate("ds.asDataMatrix::perf::0")
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
print(paste("ds.asDataMatrix::perf::0 ", .current.rate, 0.5, 2.0))
perf.reference.save("ds.asDataMatrix::perf::0", .current.rate, 0.5, 2.0)
} else {
print(paste("ds.asDataMatrix::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
}

.reference.rate <- perf.reference.rate("ds.asDataMatrix::perf::0")
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asDataMatrix::perf::0")
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asDataMatrix::perf::0")

expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
})

#
# Done
#

# context("ds.asDataMatrix::perf::shutdown")
disconnect.studies.dataset.cnsim()
# context("ds.asDataMatrix::perf::done")
58 changes: 58 additions & 0 deletions tests/testthat/test-perf-ds.asLogical.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#-------------------------------------------------------------------------------
#
# This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------

#
# Set up
#

# context("ds.asLogical::perf::setup")
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))

#
# Tests
#

# context("ds.asLogical::perf:0")
test_that("combine - performance", {
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time

while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
ds.asLogical("D$LAB_TSC", newobj = "perf.newobj")

.count <- .count + 1
.current.time <- Sys.time()
}

.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
.reference.rate <- perf.reference.rate("ds.asLogical::perf::0")
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
print(paste("ds.asLogical::perf::0 ", .current.rate, 0.5, 2.0))
perf.reference.save("ds.asLogical::perf::0", .current.rate, 0.5, 2.0)
} else {
print(paste("ds.asLogical::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
}

.reference.rate <- perf.reference.rate("ds.asLogical::perf::0")
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asLogical::perf::0")
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asLogical::perf::0")

expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
})

#
# Done
#

# context("ds.asLogical::perf::shutdown")
disconnect.studies.dataset.cnsim()
# context("ds.asLogical::perf::done")
58 changes: 58 additions & 0 deletions tests/testthat/test-perf-ds.asMatrix.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#-------------------------------------------------------------------------------
#
# This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------

#
# Set up
#

# context("ds.asMatrix::perf::setup")
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))

#
# Tests
#

# context("ds.asMatrix::perf:0")
test_that("combine - performance", {
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time

while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
ds.asMatrix(x.name = "D$LAB_TSC", newobj = "perf.newobj")

.count <- .count + 1
.current.time <- Sys.time()
}

.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
.reference.rate <- perf.reference.rate("ds.asMatrix::perf::0")
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
print(paste("ds.asMatrix::perf::0 ", .current.rate, 0.5, 2.0))
perf.reference.save("ds.asMatrix::perf::0", .current.rate, 0.5, 2.0)
} else {
print(paste("ds.asMatrix::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
}

.reference.rate <- perf.reference.rate("ds.asMatrix::perf::0")
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asMatrix::perf::0")
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asMatrix::perf::0")

expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
})

#
# Done
#

# context("ds.asMatrix::perf::shutdown")
disconnect.studies.dataset.cnsim()
# context("ds.asMatrix::perf::done")
Loading