| 1 |
|
| 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 |
|
| 35 |
workspace: |
| 36 |
clean: all |
| 37 |
|
| 38 |
|
| 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 |
|
| 49 |
pool: |
| 50 |
name: functional-test |
| 51 |
demands: |
| 52 |
- Agent.OS -equals $(test_os) |
| 53 |
|
| 54 |
steps: |
| 55 |
|
| 56 |
- checkout: self |
| 57 |
fetchDepth: 1 |
| 58 |
|
| 59 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| 110 |
- task: PublishTestResults@2 |
| 111 |
inputs: |
| 112 |
testResultsFiles: test/output/*.xml |
| 113 |
testRunTitle: "$(Agent.OS) functional tests" |
| 114 |
platform: "$(Agent.OS)" |
| 115 |
condition: succeededOrFailed() |
| 116 |
displayName: "Publish test results" |
| 117 |
|
| 118 |
|
| 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 |
|