Skip to content

Commit b18a28b

Browse files
committed
Refactor the azure pipelines
Use tox for both windows and linux and publish the test and coverage reports.
1 parent 6532129 commit b18a28b

File tree

6 files changed

+86
-108
lines changed

6 files changed

+86
-108
lines changed

.azure-pipelines/job.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
parameters:
2+
name:
3+
vmImage:
4+
os:
5+
6+
7+
jobs:
8+
- job: ${{ parameters.name }}
9+
pool:
10+
vmImage: ${{ parameters.vmImage }}
11+
strategy:
12+
matrix:
13+
Python 2.7:
14+
python.version: "2.7"
15+
TOXENV: "py27-${{ parameters.os }}"
16+
Python 3.4:
17+
python.version: "3.4"
18+
TOXENV: "py34-${{ parameters.os }}"
19+
Python 3.5:
20+
python.version: "3.5"
21+
TOXENV: "py35-${{ parameters.os }}"
22+
Python 3.6:
23+
python.version: "3.6"
24+
TOXENV: "py36-${{ parameters.os }}"
25+
Python 3.7:
26+
python.version: "3.7"
27+
TOXENV: "py37-${{ parameters.os }}"
28+
steps:
29+
- template: steps.yml
30+
parameters:
31+
os: ${{ parameters.os }}

.azure-pipelines/jobs/test-linux.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.azure-pipelines/jobs/test-windows.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.azure-pipelines/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
jobs:
2-
- template: jobs/test-linux.yml
2+
- template: job.yml
33
parameters:
4+
name: Linux
5+
os: linux
46
vmImage: ubuntu-16.04
5-
- template: jobs/test-windows.yml
7+
- template: job.yml
68
parameters:
9+
name: Windows
10+
os: windows
711
vmImage: vs2017-win2016

.azure-pipelines/steps.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
parameters:
2+
os:
3+
4+
steps:
5+
- ${{ if eq(parameters.os, 'linux') }}:
6+
- script: sudo apt-get update
7+
displayName: "Apt update"
8+
- script: sudo apt-get install -y
9+
libssl-dev
10+
libxmlsec1
11+
libxmlsec1-dev
12+
libxmlsec1-openssl
13+
libxslt1-dev
14+
pkg-config
15+
displayName: "Apt install dependencies"
16+
- task: UsePythonVersion@0
17+
inputs:
18+
versionSpec: "$(python.version)"
19+
- script: |
20+
python -m pip install --upgrade pip
21+
pip install --upgrade setuptools
22+
pip install --upgrade tox
23+
pip install --upgrade codecov
24+
displayName: "Install testing requirements"
25+
- script: tox -e $(TOXENV) --
26+
--junit-xml=junit.xml
27+
--cov=zeep
28+
--cov-report=xml:coverage.xml
29+
--cov-report=html:coverage.html
30+
displayName: "Run tox with TOXENV=$(TOXENV)"
31+
- task: PublishTestResults@2
32+
inputs:
33+
testResultsFormat: "JUnit"
34+
testResultsFiles: "$(System.DefaultWorkingDirectory)/junit.xml"
35+
testRunTitle: "Python tests for TOXENV=$(TOXENV)"
36+
- task: PublishCodeCoverageResults@1
37+
inputs:
38+
codeCoverageTool: "cobertura"
39+
summaryFileLocation: "$(System.DefaultWorkingDirectory)/coverage.xml"
40+
reportDirectory: "$(System.DefaultWorkingDirectory)/coverage.html/"
41+
- script: codecov
42+
condition: succeeded()
43+
displayName: "Upload coverage information to codecov.io"

tox.ini

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
[tox]
2-
envlist = py27,py34,py35,py36,py37,pypy
2+
envlist = py{27,34,35,36,37}-{mac,linux,windows},pypy
33

44

55
[testenv]
6+
platform =
7+
mac: darwin
8+
windows: win32
9+
linux: linux
610
extras =
711
test
8-
xmlsec
12+
{mac,linux}: xmlsec
913
py{35,36,37}: async
1014
py{35,36,37}: tornado
1115
deps =
@@ -20,13 +24,3 @@ extras =
2024
test
2125
xmlsec
2226
commands = python -m pytest {posargs}
23-
24-
25-
# Uses default basepython otherwise reporting doesn't work on Travis where
26-
# Python 3.5 is only available in 3.5 jobs.
27-
[testenv:coverage-report]
28-
deps = coverage
29-
skip_install = true
30-
commands =
31-
coverage combine
32-
coverage report

0 commit comments

Comments
 (0)