Skip to content

Commit 1d9e88c

Browse files
Merge pull request datashield#673 from StuartWheater/perf-batch-1
Changes to perf-batch-1 updating tests and setup
2 parents d015814 + 5605198 commit 1d9e88c

16 files changed

Lines changed: 108 additions & 159 deletions

armadillo_azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ variables:
3434
branchName: $(Build.SourceBranchName)
3535
test_filter: '*'
3636
_r_check_system_clock_: 0
37+
perf.profile: 'azure-pipeline'
3738

3839

3940
#########################################################################################
@@ -274,7 +275,7 @@ jobs:
274275
#
275276
# "_-|arg-|smk-|datachk-|disc-|math-|expt-|expt_smk-"
276277
# testthat::test_package("$(projectName)", filter = "_-|datachk-|smk-|arg-|disc-|perf-|smk_expt-|expt-|math-", reporter = multi_rep, stop_on_failure = FALSE)
277-
sudo R -q -e '
278+
sudo env PERF_PROFILE=$PERF_PROFILE R -q -e '
278279
library(covr);
279280
dsbase.res <- covr::package_coverage(
280281
type = c("none"),
@@ -396,7 +397,7 @@ jobs:
396397
# testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter
397398
# R output and messages are redirected by sink() to test_console_output.txt
398399
# junit reporter output is to test_results.xml
399-
sudo R -q -e '
400+
sudo env PERF_PROFILE=$PERF_PROFILE R -q -e '
400401
library(covr);
401402
dsdanger.res <- covr::package_coverage(
402403
type = c("none"),
@@ -534,7 +535,6 @@ jobs:
534535
echo 'branch:'$(branchName) >> $(datetime).txt
535536
echo 'os:'$(lsb_release -ds) >> $(datetime).txt
536537
echo 'R:'$(R --version | head -n 1) >> $(datetime).txt
537-
echo 'opal:'$(opal system --opal localhost:8443 --user administrator --password "datashield_test&" --version) >> $(datetime).txt
538538
539539
workingDirectory: $(Pipeline.Workspace)/logs
540540
displayName: 'Write versions to file'

azure-pipelines.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ variables:
3232
branchName: $(Build.SourceBranchName)
3333
test_filter: '*'
3434
_r_check_system_clock_: 0
35+
perf.profile: 'azure-pipeline'
3536

3637

3738
#########################################################################################
@@ -214,13 +215,13 @@ jobs:
214215
# Install dsBase.
215216
# If previous steps have failed then don't run.
216217
- bash: |
217-
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(o)"
218+
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'http://localhost:8080/'); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
218219
219-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.install_github_package(opal, 'dsBase', username = 'datashield', ref = 'v7.0-dev'); opal.logout(opal)"
220+
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.install_github_package(opal, 'dsBase', username = 'datashield', ref = 'v7.0-dev'); opal.logout(opal)"
220221
221222
sleep 60
222223
223-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.set_option(opal, 'default.datashield.privacyControlLevel', 'permissive'); opal.logout(opal)"
224+
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)"
224225
225226
workingDirectory: $(Pipeline.Workspace)/dsBaseClient/tests/testthat/data_files
226227
displayName: 'Install dsBase to Opal, as set disclosure test options'
@@ -253,7 +254,7 @@ jobs:
253254
#
254255
# "_-|arg-|smk-|datachk-|disc-|math-|expt-|expt_smk-"
255256
# testthat::test_package("$(projectName)", filter = "_-|datachk-|smk-|arg-|disc-|perf-|smk_expt-|expt-|math-", reporter = multi_rep, stop_on_failure = FALSE)
256-
sudo R -q -e '
257+
sudo env PERF_PROFILE=$PERF_PROFILE R -q -e '
257258
library(covr);
258259
dsbase.res <- covr::package_coverage(
259260
type = c("none"),
@@ -342,9 +343,9 @@ jobs:
342343
# If previous steps have failed then don't run
343344
- bash: |
344345
345-
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(o)"
346+
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'http://localhost:8080'); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
346347
347-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.install_github_package(opal, 'dsDanger', username = 'datashield', ref = '6.3.4'); opal.logout(opal)"
348+
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.install_github_package(opal, 'dsDanger', username = 'datashield', ref = '6.3.4'); opal.logout(opal)"
348349
349350
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
350351
displayName: 'Install dsDanger package on Opal server'
@@ -368,7 +369,7 @@ jobs:
368369
# testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter
369370
# R output and messages are redirected by sink() to test_console_output.txt
370371
# junit reporter output is to test_results.xml
371-
sudo R -q -e '
372+
sudo env PERF_PROFILE=$PERF_PROFILE R -q -e '
372373
library(covr);
373374
dsdanger.res <- covr::package_coverage(
374375
type = c("none"),

docker-compose_armadillo.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
hostname: armadillo
44
ports:
55
- 8080:8080
6-
image: datashield/armadillo_citest:5.11.0
6+
image: datashield/armadillo_citest:latest
77
environment:
88
LOGGING_CONFIG: 'classpath:logback-file.xml'
99
AUDIT_LOG_PATH: '/app/logs/audit.log'
@@ -16,7 +16,6 @@ services:
1616

1717
default:
1818
hostname: default
19-
image: datashield/rock-quebrada-lamda:latest
20-
# image: datashield/rserver-panda-lamda:devel
19+
image: datashield/rock_citest-permissive:latest
2120
environment:
2221
DEBUG: "FALSE"

docker-compose_opal.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ services:
33
image: datashield/opal_citest:latest
44
ports:
55
- 8443:8443
6+
- 8080:8080
67
links:
78
- mongo
89
- rock
@@ -15,11 +16,11 @@ services:
1516
- ROCK_HOSTS=rock:8085
1617
- ROCK_ADMINISTRATOR_PASSWORD=foobar
1718
mongo:
18-
image: mongo:4.4.15
19+
image: mongo:8.0
1920
environment:
2021
- MONGO_INITDB_ROOT_USERNAME=root
2122
- MONGO_INITDB_ROOT_PASSWORD=foobar
2223
rock:
23-
image: datashield/rock-quebrada-lamda-permissive:latest
24+
image: datashield/rock_citest-permissive:latest
2425
environment:
2526
DEBUG: "FALSE"

opal_azure-pipelines.yml

Lines changed: 8 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
# Starts with a vanilla Opal docker composition, installs dsBase
44
# and dsBaseClient (as well as dependencies - including a fully functional
55
# Opal server).
6-
# Does checks and tests then saves results to testStatus repo.
76
#
87
# Inside the root directory $(Pipeline.Workspace) will be a file tree like:
98
# /dsBaseClient <- Checked out version of datashield/dsBaseClient
10-
# /testStatus <- Checked out version of datashield/testStatus
119
# /logs <- Where results of tests and lots are collated
1210
#
1311
# As of May 2020 this takes ~ 70 mins to run.
@@ -34,18 +32,7 @@ variables:
3432
branchName: $(Build.SourceBranchName)
3533
test_filter: '*'
3634
_r_check_system_clock_: 0
37-
38-
39-
#########################################################################################
40-
# Need to define all the GH repos and their access tokens, see:
41-
# https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml
42-
resources:
43-
repositories:
44-
- repository: testStatusRepo
45-
type: github
46-
endpoint: datashield-testing
47-
name: datashield/testStatus
48-
ref: master
35+
perf.profile: 'azure-pipeline'
4936

5037

5138
#########################################################################################
@@ -82,11 +69,6 @@ jobs:
8269
- checkout: self
8370
path: 'dsBaseClient'
8471

85-
- checkout: testStatusRepo
86-
path: 'testStatus'
87-
persistCredentials: true
88-
condition: and(eq(variables['Build.Repository.Name'], 'datashield/dsBaseClient'), ne(variables['Build.Reason'], 'PullRequest'))
89-
9072

9173
#####################################################################################
9274
# The MySQL install that comes with the VM doesn't seem compatable with our set up
@@ -233,13 +215,13 @@ jobs:
233215
# Install dsBase.
234216
# If previous steps have failed then don't run.
235217
- bash: |
236-
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(o)"
218+
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'http://localhost:8080/'); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
237219
238-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.install_github_package(opal, 'dsBase', username = 'datashield', ref = 'v7.0-dev'); opal.logout(opal)"
220+
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.install_github_package(opal, 'dsBase', username = 'datashield', ref = 'v7.0-dev'); opal.logout(opal)"
239221
240222
sleep 60
241223
242-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.set_option(opal, 'default.datashield.privacyControlLevel', 'permissive'); opal.logout(opal)"
224+
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)"
243225
244226
workingDirectory: $(Pipeline.Workspace)/dsBaseClient/tests/testthat/data_files
245227
displayName: 'Install dsBase to Opal, as set disclosure test options'
@@ -272,7 +254,7 @@ jobs:
272254
#
273255
# "_-|arg-|smk-|datachk-|disc-|math-|expt-|expt_smk-"
274256
# testthat::test_package("$(projectName)", filter = "_-|datachk-|smk-|arg-|disc-|perf-|smk_expt-|expt-|math-", reporter = multi_rep, stop_on_failure = FALSE)
275-
sudo R -q -e '
257+
sudo env PERF_PROFILE=$PERF_PROFILE R -q -e '
276258
library(covr);
277259
dsbase.res <- covr::package_coverage(
278260
type = c("none"),
@@ -361,9 +343,9 @@ jobs:
361343
# If previous steps have failed then don't run
362344
- bash: |
363345
364-
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(o)"
346+
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'http://localhost:8080'); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
365347
366-
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.install_github_package(opal, 'dsDanger', username = 'datashield', ref = '6.3.4'); opal.logout(opal)"
348+
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/'); dsadmin.install_github_package(opal, 'dsDanger', username = 'datashield', ref = '6.3.4'); opal.logout(opal)"
367349
368350
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
369351
displayName: 'Install dsDanger package on Opal server'
@@ -387,7 +369,7 @@ jobs:
387369
# testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter
388370
# R output and messages are redirected by sink() to test_console_output.txt
389371
# junit reporter output is to test_results.xml
390-
sudo R -q -e '
372+
sudo env PERF_PROFILE=$PERF_PROFILE R -q -e '
391373
library(covr);
392374
dsdanger.res <- covr::package_coverage(
393375
type = c("none"),
@@ -524,75 +506,6 @@ jobs:
524506
displayName: 'Down Opal Docker Composition'
525507
condition: succeeded()
526508
527-
#####################################################################################
528-
# Windup phase
529-
#####################################################################################
530-
531-
#####################################################################################
532-
# Output some important version numbers to file. This gets added to the testStatus
533-
# commit so it can be parsed and used on the status table.
534-
- bash: |
535-
536-
echo 'branch:'$(branchName) >> $(datetime).txt
537-
echo 'os:'$(lsb_release -ds) >> $(datetime).txt
538-
echo 'R:'$(R --version | head -n 1) >> $(datetime).txt
539-
echo 'opal:'$(opal system --opal localhost:8443 --user administrator --password "datashield_test&" --version) >> $(datetime).txt
540-
541-
workingDirectory: $(Pipeline.Workspace)/logs
542-
displayName: 'Write versions to file'
543-
condition: succeededOrFailed()
544-
545-
546-
#####################################################################################
547-
# Checkout the testStatus repo, add the results from here, push back to GH.
548-
# TODO: Automatically pull in better email/name info from somewhere.
549-
# TODO: More debug info in commit message
550-
- bash: |
551-
552-
# Git needs some config set to be able to push to a repo.
553-
git config --global user.email "you@example.com"
554-
git config --global user.name "Azure pipeline"
555-
556-
# This repo is checked out in detatched head state, so reconnect it here.
557-
git checkout master
558-
559-
# It is possible that other commits have been made to the testStatus repo since it
560-
# was checked out. i.e. other pipeline runs might have finished.
561-
git pull
562-
563-
# Make the directories if they dont already exist
564-
mkdir --parents logs/$(projectName)/$(branchName)
565-
mkdir --parents docs/$(projectName)/$(branchName)/latest
566-
567-
cp $(Pipeline.Workspace)/logs/coveragelist.csv logs/$(projectName)/$(branchName)/
568-
cp $(Pipeline.Workspace)/logs/coveragelist.csv logs/$(projectName)/$(branchName)/$(datetime).csv
569-
570-
cp $(Pipeline.Workspace)/logs/test_results.xml logs/$(projectName)/$(branchName)/
571-
cp $(Pipeline.Workspace)/logs/test_results.xml logs/$(projectName)/$(branchName)/$(datetime).xml
572-
573-
cp $(Pipeline.Workspace)/logs/$(datetime).txt logs/$(projectName)/$(branchName)/
574-
575-
# Run the script to parse the results and build the html pages.
576-
# status.py JUnit_file.xml coverage_file.csv output_file.html local_repo_path remote_repo_name branch
577-
source/status.py logs/$(projectName)/$(branchName)/$(datetime).xml logs/$(projectName)/$(branchName)/$(datetime).csv logs/$(projectName)/$(branchName)/$(datetime).txt status.html $(Pipeline.Workspace)/$(projectName) $(projectName) $(branchName)
578-
579-
cp status.html docs/$(projectName)/$(branchName)/latest/index.html
580-
git add logs/$(projectName)/$(branchName)/coveragelist.csv
581-
git add logs/$(projectName)/$(branchName)/test_results.xml
582-
git add logs/$(projectName)/$(branchName)/$(datetime).xml
583-
git add logs/$(projectName)/$(branchName)/$(datetime).csv
584-
git add logs/$(projectName)/$(branchName)/$(datetime).txt
585-
git add docs/$(projectName)/$(branchName)/latest/index.html
586-
587-
git commit -m "Azure auto test for $(projectName)/$(branchName) @ $(datetime)" -m "Debug info:\nProjectName:$(projectName)\nBranchName:$(branchName)\nDataTime:$(datetime)"
588-
git push
589-
exit 0
590-
591-
workingDirectory: $(Pipeline.Workspace)/testStatus
592-
displayName: 'Parse test results'
593-
condition: and(eq(variables['Build.Repository.Name'], 'datashield/dsBaseClient'), ne(variables['Build.Reason'], 'PullRequest'))
594-
595-
596509
#####################################################################################
597510
# Output the environment information to the console. This is useful for debugging.
598511
# Always do this, even if some of the above has failed or the job has been cacelled.

tests/testthat/connection_to_datasets/login_details.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ if (! is.null(getOption("default_driver"))) {
2222
}
2323

2424
if ((ds.test_env$driver == "DSLiteDriver") || (ds.test_env$driver == "OpalDriver")) {
25-
ds.test_env$ping_address <- paste("https://", ds.test_env$server_ip_address, ":8443", sep="")
26-
ds.test_env$ping_config <- config(timeout=5, ssl_verifyhost=0, ssl_verifypeer=0)
25+
ds.test_env$ping_address <- paste("http://", ds.test_env$server_ip_address, ":8080", sep="")
26+
ds.test_env$ping_config <- config(timeout=5)
2727

28-
ds.test_env$ip_address_1 <- paste("https://", ds.test_env$server_ip_address, ":8443", sep="")
29-
ds.test_env$ip_address_2 <- paste("https://", ds.test_env$server_ip_address, ":8443", sep="")
30-
ds.test_env$ip_address_3 <- paste("https://", ds.test_env$server_ip_address, ":8443", sep="")
28+
ds.test_env$ip_address_1 <- paste("http://", ds.test_env$server_ip_address, ":8080", sep="")
29+
ds.test_env$ip_address_2 <- paste("http://", ds.test_env$server_ip_address, ":8080", sep="")
30+
ds.test_env$ip_address_3 <- paste("http://", ds.test_env$server_ip_address, ":8080", sep="")
3131

3232
ds.test_env$user_1 <- getOption("opal.user", "administrator")
3333
ds.test_env$user_2 <- getOption("opal.user", "administrator")
@@ -37,9 +37,9 @@ if ((ds.test_env$driver == "DSLiteDriver") || (ds.test_env$driver == "OpalDriver
3737
ds.test_env$password_2 <- getOption("opal.password", "datashield_test&")
3838
ds.test_env$password_3 <- getOption("opal.password", "datashield_test&")
3939

40-
ds.test_env$options_1 <- "list(ssl_verifyhost=0, ssl_verifypeer=0)"
41-
ds.test_env$options_2 <- "list(ssl_verifyhost=0, ssl_verifypeer=0)"
42-
ds.test_env$options_3 <- "list(ssl_verifyhost=0, ssl_verifypeer=0)"
40+
ds.test_env$options_1 <- "list()"
41+
ds.test_env$options_2 <- "list()"
42+
ds.test_env$options_3 <- "list()"
4343

4444
ds.test_env$secure_login_details <- TRUE
4545
} else if (ds.test_env$driver == "ArmadilloDriver") {

tests/testthat/data_files/obiba_opal-upload_testing_datasets.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ upload_testing_dataset_table <- function(opal, project_name, table_name, local_f
1717
opal.table_save(opal, data, project_name, table_name, id.name = "_row_id_", force = TRUE)
1818
}
1919

20-
# opal <- opal.login('administrator','datashield_test&', url='https://192.168.56.100:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0))
21-
opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0))
20+
# opal <- opal.login('administrator','datashield_test&', url='https://192.168.56.100:8/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0))
21+
opal <- opal.login('administrator','datashield_test&', url='http://localhost:8080/', opts = list())
2222

2323
upload_testing_dataset_table(opal, 'ANTHRO', 'anthro1', 'ANTHRO/anthro1.rda')
2424
upload_testing_dataset_table(opal, 'ANTHRO', 'anthro2', 'ANTHRO/anthro2.rda')

tests/testthat/perf_files/armadillo_azure-pipeline.csv

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)