Debian Codegraph @

.azure/functional-test-pipeline.yml

raw symbols SCIP
1 # pyocd functional test pipeline
2
3 trigger:
4 branches:
5 include:
6 - '*'
7 paths:
8 include:
9 - '.azure'
10 - 'pyocd'
11 - 'test'
12 - 'pyproject.toml'
13 - 'setup.cfg'
14 - 'setup.py'
15
16 pr:
17 branches:
18 include:
19 - '*'
20 paths:
21 include:
22 - '.azure'
23 - 'pyocd'
24 - 'test'
25 - 'pyproject.toml'
26 - 'setup.cfg'
27 - 'setup.py'
28
29 jobs:
30 - job: functional_tests
31 displayName: "Functional tests"
32 timeoutInMinutes: 200
33
34 # Fully clean workspaces before testing.
35 workspace:
36 clean: all
37
38 # Matrix.
39 strategy:
40 matrix:
41 Mac:
42 test_os: Darwin
43 Linux:
44 test_os: Linux
45 Win:
46 test_os: Windows_NT
47
48 # Agent pool and requirements.
49 pool:
50 name: functional-test
51 demands:
52 - Agent.OS -equals $(test_os)
53
54 steps:
55 # Configure shallow checkout.
56 - checkout: self
57 fetchDepth: 1
58
59 # Linux/Mac: Activate venv and install dependencies.
60 - script: |
61 python3 -m venv .venv
62 source .venv/bin/activate
63 python -m pip install --upgrade pip setuptools wheel
64 pip install .[test]
65 name: install_dependencies_posix
66 displayName: 'Install dependencies (Posix)'
67 condition: and(in(variables['agent.os'], 'Darwin', 'Linux'), succeeded())
68
69 # Windows: Activate venv and install dependencies.
70 - script: |
71 python -m venv .venv
72 call .venv\Scripts\activate.bat
73 python -m pip install --upgrade pip setuptools wheel
74 pip install .[test]
75 name: install_dependencies_win
76 displayName: 'Install dependencies (Win)'
77 condition: and(eq(variables['agent.os'], 'Windows_NT'), succeeded())
78
79 # Download pyocd.yaml config file into test directory.
80 - task: UniversalPackages@0
81 name: install_test_config
82 inputs:
83 command: download
84 vstsFeed: 'pyocd/config'
85 vstsFeedPackage: 'pyocd-test-config'
86 vstsPackageVersion: '*'
87 downloadDirectory: 'test'
88 verbosity: 'debug'
89 displayName: 'Install test config'
90
91 # Linux/Mac: Activate venv and run automated test suite.
92 - script: |
93 source .venv/bin/activate
94 cd test
95 python ./automated_test.py --quiet
96 name: run_tests_posix
97 displayName: 'Run tests (Posix)'
98 condition: and(in(variables['agent.os'], 'Darwin', 'Linux'), succeeded())
99
100 # Windows: Activate venv and run automated test suite.
101 - script: |
102 call .venv\Scripts\activate.bat
103 cd test
104 python automated_test.py --quiet
105 name: run_tests_win
106 displayName: 'Run tests (Win)'
107 condition: and(eq(variables['agent.os'], 'Windows_NT'), succeeded())
108
109 # Publish JUnit-format test results.
110 - task: PublishTestResults@2
111 inputs:
112 testResultsFiles: test/output/*.xml
113 testRunTitle: "$(Agent.OS) functional tests"
114 platform: "$(Agent.OS)" # Doesn't show up anywhere in Azure UI.
115 condition: succeededOrFailed()
116 displayName: "Publish test results"
117
118 # Publish test outputs.
119 - task: PublishPipelineArtifact@1
120 inputs:
121 targetPath: "test/output"
122 artifactName: outputs_$(test_os)
123 condition: succeededOrFailed()
124 displayName: "Publish test output files"
125