From b5955870318243f9e24ba53fda1f8c0a369d063a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 12 Feb 2019 19:01:30 -0200 Subject: [PATCH 1/4] Set up CI with Azure Pipelines [skip travis] [skip appveyor] Just a few environments for now to see how it will behave for a few days --- azure-pipelines.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..a21cfb140 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,47 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master +- features + +jobs: + +- job: 'Test' + pool: + vmImage: "vs2017-win2016" + strategy: + matrix: + py27: + python.version: '2.7' + tox.env: 'py27' + py35: + python.version: '3.5' + tox.env: 'py35' + py36: + python.version: '3.6' + tox.env: 'py36' + py37: + python.version: '3.7' + tox.env: 'py37' + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install --upgrade pip && pip install tox + displayName: 'Install tox' + + - script: python -m tox -e $(tox.env) -- --junitxml=build/test-results/$(tox.env).xml + displayName: 'Run tests' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: 'build/test-results/$(tox.env).xml' + testRunTitle: '$(tox.env)' + condition: succeededOrFailed() From 215d537624467a875487192208d805f04b62d68a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 12 Feb 2019 20:24:32 -0200 Subject: [PATCH 2/4] Set junitxml and colors using PYTEST_ADDOPTS [skip travis] [skip appveyor] --- azure-pipelines.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a21cfb140..3ded4e731 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,12 +1,10 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - trigger: - master - features +variables: + PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml --color=yes" + jobs: - job: 'Test' @@ -37,7 +35,7 @@ jobs: - script: python -m pip install --upgrade pip && pip install tox displayName: 'Install tox' - - script: python -m tox -e $(tox.env) -- --junitxml=build/test-results/$(tox.env).xml + - script: python -m tox -e $(tox.env) displayName: 'Run tests' - task: PublishTestResults@2 From 04a941c818a1c5838a14675b61e3c50bcd5e095b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 12 Feb 2019 20:31:29 -0200 Subject: [PATCH 3/4] Pass PYTEST_ADDOPTS to tox envs [skip travis] [skip appveyor] --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b6625e7a3..8041abb07 100644 --- a/tox.ini +++ b/tox.ini @@ -23,7 +23,7 @@ commands = {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof {posargs} coverage: coverage combine coverage: coverage report -passenv = USER USERNAME COVERAGE_* TRAVIS +passenv = USER USERNAME COVERAGE_* TRAVIS PYTEST_ADDOPTS setenv = # Configuration to run with coverage similar to Travis/Appveyor, e.g. # "tox -e py37-coverage". From f729d5d4ee2a8ce8f609cb5b06378aa2ab415f54 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 12 Feb 2019 20:34:51 -0200 Subject: [PATCH 4/4] Remove --color=yes from PYTEST_ADDOPTS [skip travis] [skip appveyor] Does not work on Azure Pipelines at all unfortunately --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ded4e731..278b9015a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,7 +3,7 @@ trigger: - features variables: - PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml --color=yes" + PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml" jobs: