forked from Azure/pytest-azurepipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
178 lines (146 loc) · 5.04 KB
/
azure-pipelines.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
trigger:
- master
name: $(Year:yy)$(DayOfYear)$(Rev:r)
variables:
majorVer: '1.0.0'
stages:
- stage: Unit_Test
jobs:
- job: 'Test_Linux'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python37_Pytest_50:
python.version: '3.7'
pytest_version: '>=5.0.0'
Python38_Pytest_50:
python.version: '3.8'
pytest_version: '>=5.0.0'
maxParallel: 8
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: |
echo "Installing Pytest - $PYTEST_VERSION"
python -m pip install --upgrade pip
pip install pytest$PYTEST_VERSION
env:
PYTEST_VERSION: $(pytest_version)
- script: "pip install -e ."
displayName: 'Install package'
- script: |
pytest tests -v -m "not testfail"
displayName: 'pytest with defaults - passes'
- script: |
pip install pytest-cov
pytest tests -v -m "not testfail" --cov --cov-report=html
displayName: 'pytest with coverage plugin'
- script: |
pip install pytest-nunit
pytest tests -v -m "not testfail" --cov --cov-report=html
displayName: 'pytest with nunit plugin'
- script: |
pytest tests -v -m "testfail"
displayName: 'pytest - failures'
continueOnError: true
- script: |
pytest tests -v -m "not testfail" --doctest-modules
displayName: 'pytest with doctest modules flag - doctest fails'
continueOnError: true
- job: 'Test_Windows'
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
maxParallel: 5
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: |
python -m pip install --upgrade pip
pip install -e .
displayName: 'Install dependencies'
- script: |
pytest tests -v -m "not testfail"
displayName: 'pytest with defaults - passes'
- script: |
pip install pytest-cov
pytest tests -v -m "not testfail" --no-coverage-upload --cov --cov-report=html
displayName: 'pytest with --no-coverage-upload'
- script: |
pip install pytest-cov
pytest tests -v -m "not testfail" --cov --cov-report=html
displayName: 'pytest with coverage plugin'
- script: |
pytest tests -v -m "not testfail" --cov --cov-report=html --force-xunit
displayName: 'pytest with forced Xunit output'
- script: |
pytest tests -v -m "testfail"
displayName: 'pytest - failures'
continueOnError: true
- job: 'Test_Docker'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- script: ./.azure-pipelines/docker.sh
- stage: Integration_Test
jobs:
- job: 'Test_Packages'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: 'python -m pip install -U pip setuptools wheel twine'
displayName: "Install packaging tools"
- script: |
echo "Building rev $BUILD_VERSION"
python setup.py sdist bdist_wheel
displayName: "Build package"
env:
BUILD_VERSION: $(majorVer).dev$(Build.BuildNumber)
- task: TwineAuthenticate@0
inputs:
artifactFeeds: 'test_feed'
- script: 'python -m twine upload -r test_feed --config-file $(PYPIRC_PATH) dist/*.whl'
displayName: "Upload package"
- job: "Test_suite_Jinja2"
dependsOn: "Test_Packages"
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: 'python -m pip install -U pip'
displayName: "Update pip"
- script: 'python -m pip install MarkupSafe>=0.23'
displayName: 'Install dependencies'
- task: PipAuthenticate@0
displayName: Authenticate with artifact feed
inputs:
artifactFeeds: "test_feed"
- script: "pip install --pre pytest-azurepipelines==$BUILD_VERSION"
displayName: "Install pytest-azurepipelines package"
env:
BUILD_VERSION: $(majorVer).dev$(Build.BuildNumber)
- script: |
wget https://github.com/pallets/jinja/archive/c4813e51ad664bca17773517462610c1578a6850.zip
unzip c4813e51ad664bca17773517462610c1578a6850.zip -d jinja2
cd jinja2/jinja-c4813e51ad664bca17773517462610c1578a6850/
python -m pytest tests --test-run-title="Jinja2 test suite"
displayName: "Test jinja2 pinned revision"