|
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. |
@@ -36,18 +34,6 @@ variables: |
36 | 34 | _r_check_system_clock_: 0 |
37 | 35 |
|
38 | 36 |
|
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 |
49 | | - |
50 | | - |
51 | 37 | ######################################################################################### |
52 | 38 | # When and under what condition to run the pipeline. |
53 | 39 | schedules: |
|
82 | 68 | - checkout: self |
83 | 69 | path: 'dsBaseClient' |
84 | 70 |
|
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 | | - |
90 | 71 |
|
91 | 72 | ##################################################################################### |
92 | 73 | # The MySQL install that comes with the VM doesn't seem compatable with our set up |
@@ -524,75 +505,6 @@ jobs: |
524 | 505 | displayName: 'Down Opal Docker Composition' |
525 | 506 | condition: succeeded() |
526 | 507 |
|
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 | | -
|
596 | 508 | ##################################################################################### |
597 | 509 | # Output the environment information to the console. This is useful for debugging. |
598 | 510 | # Always do this, even if some of the above has failed or the job has been cacelled. |
|
0 commit comments