|
3 | 3 | # Starts with a vanilla Opal docker composition, installs dsBase |
4 | 4 | # and dsBaseClient (as well as dependencies - including a fully functional |
5 | 5 | # Opal server). |
6 | | -# Does checks and tests then saves results to testStatus repo. |
7 | 6 | # |
8 | 7 | # Inside the root directory $(Pipeline.Workspace) will be a file tree like: |
9 | 8 | # /dsBaseClient <- Checked out version of datashield/dsBaseClient |
10 | | -# /testStatus <- Checked out version of datashield/testStatus |
11 | 9 | # /logs <- Where results of tests and lots are collated |
12 | 10 | # |
13 | 11 | # As of May 2020 this takes ~ 70 mins to run. |
@@ -37,18 +35,6 @@ variables: |
37 | 35 | perf.profile: 'azure-pipeline' |
38 | 36 |
|
39 | 37 |
|
40 | | -######################################################################################### |
41 | | -# Need to define all the GH repos and their access tokens, see: |
42 | | -# https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml |
43 | | -resources: |
44 | | - repositories: |
45 | | - - repository: testStatusRepo |
46 | | - type: github |
47 | | - endpoint: datashield-testing |
48 | | - name: datashield/testStatus |
49 | | - ref: master |
50 | | - |
51 | | - |
52 | 38 | ######################################################################################### |
53 | 39 | # When and under what condition to run the pipeline. |
54 | 40 | schedules: |
|
83 | 69 | - checkout: self |
84 | 70 | path: 'dsBaseClient' |
85 | 71 |
|
86 | | - - checkout: testStatusRepo |
87 | | - path: 'testStatus' |
88 | | - persistCredentials: true |
89 | | - condition: and(eq(variables['Build.Repository.Name'], 'datashield/dsBaseClient'), ne(variables['Build.Reason'], 'PullRequest')) |
90 | | - |
91 | 72 |
|
92 | 73 | ##################################################################################### |
93 | 74 | # The MySQL install that comes with the VM doesn't seem compatable with our set up |
@@ -234,13 +215,13 @@ jobs: |
234 | 215 | # Install dsBase. |
235 | 216 | # If previous steps have failed then don't run. |
236 | 217 | - bash: | |
237 | | - 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(opal)" |
| 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)" |
238 | 219 |
|
239 | | - 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 = 'v6.3.5-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 = 'v6.3.5-dev'); opal.logout(opal)" |
240 | 221 |
|
241 | 222 | sleep 60 |
242 | 223 |
|
243 | | - 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)" |
244 | 225 |
|
245 | 226 | workingDirectory: $(Pipeline.Workspace)/dsBaseClient/tests/testthat/data_files |
246 | 227 | displayName: 'Install dsBase to Opal, as set disclosure test options' |
@@ -363,9 +344,9 @@ jobs: |
363 | 344 | # If previous steps have failed then don't run |
364 | 345 | - bash: | |
365 | 346 |
|
366 | | - 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(opal)" |
| 347 | + 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)" |
367 | 348 |
|
368 | | - 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)" |
| 349 | + 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)" |
369 | 350 |
|
370 | 351 | workingDirectory: $(Pipeline.Workspace)/dsBaseClient |
371 | 352 | displayName: 'Install dsDanger package on Opal server' |
@@ -526,75 +507,6 @@ jobs: |
526 | 507 | displayName: 'Down Opal Docker Composition' |
527 | 508 | condition: succeeded() |
528 | 509 |
|
529 | | - ##################################################################################### |
530 | | - # Windup phase |
531 | | - ##################################################################################### |
532 | | -
|
533 | | - ##################################################################################### |
534 | | - # Output some important version numbers to file. This gets added to the testStatus |
535 | | - # commit so it can be parsed and used on the status table. |
536 | | - - bash: | |
537 | | -
|
538 | | - echo 'branch:'$(branchName) >> $(datetime).txt |
539 | | - echo 'os:'$(lsb_release -ds) >> $(datetime).txt |
540 | | - echo 'R:'$(R --version | head -n 1) >> $(datetime).txt |
541 | | - echo 'opal:'$(opal system --opal localhost:8443 --user administrator --password "datashield_test&" --version) >> $(datetime).txt |
542 | | -
|
543 | | - workingDirectory: $(Pipeline.Workspace)/logs |
544 | | - displayName: 'Write versions to file' |
545 | | - condition: succeededOrFailed() |
546 | | -
|
547 | | -
|
548 | | - ##################################################################################### |
549 | | - # Checkout the testStatus repo, add the results from here, push back to GH. |
550 | | - # TODO: Automatically pull in better email/name info from somewhere. |
551 | | - # TODO: More debug info in commit message |
552 | | - - bash: | |
553 | | -
|
554 | | - # Git needs some config set to be able to push to a repo. |
555 | | - git config --global user.email "you@example.com" |
556 | | - git config --global user.name "Azure pipeline" |
557 | | -
|
558 | | - # This repo is checked out in detatched head state, so reconnect it here. |
559 | | - git checkout master |
560 | | -
|
561 | | - # It is possible that other commits have been made to the testStatus repo since it |
562 | | - # was checked out. i.e. other pipeline runs might have finished. |
563 | | - git pull |
564 | | -
|
565 | | - # Make the directories if they dont already exist |
566 | | - mkdir --parents logs/$(projectName)/$(branchName) |
567 | | - mkdir --parents docs/$(projectName)/$(branchName)/latest |
568 | | -
|
569 | | - cp $(Pipeline.Workspace)/logs/coveragelist.csv logs/$(projectName)/$(branchName)/ |
570 | | - cp $(Pipeline.Workspace)/logs/coveragelist.csv logs/$(projectName)/$(branchName)/$(datetime).csv |
571 | | -
|
572 | | - cp $(Pipeline.Workspace)/logs/test_results.xml logs/$(projectName)/$(branchName)/ |
573 | | - cp $(Pipeline.Workspace)/logs/test_results.xml logs/$(projectName)/$(branchName)/$(datetime).xml |
574 | | -
|
575 | | - cp $(Pipeline.Workspace)/logs/$(datetime).txt logs/$(projectName)/$(branchName)/ |
576 | | -
|
577 | | - # Run the script to parse the results and build the html pages. |
578 | | - # status.py JUnit_file.xml coverage_file.csv output_file.html local_repo_path remote_repo_name branch |
579 | | - 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) |
580 | | -
|
581 | | - cp status.html docs/$(projectName)/$(branchName)/latest/index.html |
582 | | - git add logs/$(projectName)/$(branchName)/coveragelist.csv |
583 | | - git add logs/$(projectName)/$(branchName)/test_results.xml |
584 | | - git add logs/$(projectName)/$(branchName)/$(datetime).xml |
585 | | - git add logs/$(projectName)/$(branchName)/$(datetime).csv |
586 | | - git add logs/$(projectName)/$(branchName)/$(datetime).txt |
587 | | - git add docs/$(projectName)/$(branchName)/latest/index.html |
588 | | -
|
589 | | - git commit -m "Azure auto test for $(projectName)/$(branchName) @ $(datetime)" -m "Debug info:\nProjectName:$(projectName)\nBranchName:$(branchName)\nDataTime:$(datetime)" |
590 | | - git push |
591 | | - exit 0 |
592 | | -
|
593 | | - workingDirectory: $(Pipeline.Workspace)/testStatus |
594 | | - displayName: 'Parse test results' |
595 | | - condition: and(eq(variables['Build.Repository.Name'], 'datashield/dsBaseClient'), ne(variables['Build.Reason'], 'PullRequest')) |
596 | | -
|
597 | | -
|
598 | 510 | ##################################################################################### |
599 | 511 | # Output the environment information to the console. This is useful for debugging. |
600 | 512 | # Always do this, even if some of the above has failed or the job has been cacelled. |
|
0 commit comments