-
Notifications
You must be signed in to change notification settings - Fork 215
/
test.yml
68 lines (61 loc) · 2.41 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
parameters:
suite_name_suffix: ""
ctest_filter: ""
ctest_timeout: "240"
suffix: ""
steps:
- script: |
set -ex
ASAN_SYMBOLIZER=/usr/bin/llvm-symbolizer-15
export ASAN_SYMBOLIZER_PATH=$(realpath ${ASAN_SYMBOLIZERS})
./tests.sh -VV --timeout ${{ parameters.ctest_timeout }} --no-compress-output -T Test ${{ parameters.ctest_filter }}
env:
CTEST_TIMEOUT: "${{ parameters.ctest_timeout }}"
displayName: CTest
workingDirectory: build
# Only run privileged tests in container environment
- ${{ if not( or( eq(parameters.suffix, 'Perf'), eq(parameters.suffix, 'Tracing'), eq(parameters.suffix, 'StressTest') ) ) }}:
- script: |
set -ex
sudo bash -c "source env/bin/activate && ctest -VV --timeout ${{ parameters.ctest_timeout }} --no-compress-output -L partitions -C partitions"
env:
CTEST_TIMEOUT: "${{ parameters.ctest_timeout }}"
condition: succeededOrFailed()
displayName: "CTest Partitions"
workingDirectory: build
# This unconditional step is necessary as workspace files survive the container
# in which they are created
- script: |
set -ex
ci_user=$(whoami)
mkdir -p workspace # Prevent chown command from failing
sudo chown -R $ci_user: workspace
condition: always()
displayName: "Change root files ownership to ci user"
workingDirectory: build
# If a test fails, crudely upload nodes' logs for all tests
- task: CopyFiles@2
inputs:
contents: "**/?(*out|*err)"
sourceFolder: $(Build.SourcesDirectory)/build/workspace
targetFolder: $(Build.ArtifactStagingDirectory)
condition: or(failed(), canceled())
displayName: "Copy logs (only on failure)"
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: "workspace ${{ parameters.suite_name_suffix }}"
condition: or(failed(), canceled())
displayName: "Upload logs (only on failure)"
- script: |
set -ex
sed -i -r "s/\[NON-XML-CHAR-0x1B\]\[([0-9]*)m//g" Testing/*/Test.xml
displayName: "Remove color codes"
workingDirectory: build
- task: PublishTestResults@2
inputs:
testResultsFormat: cTest
testResultsFiles: "**/Test.xml"
testRunTitle: "${{ parameters.suite_name_suffix }}"
platform: "$(Agent.MachineName)"
condition: succeededOrFailed()