From e8d838a55176d03e276938f98148b90c6d7a2f4d Mon Sep 17 00:00:00 2001 From: Matt Cooper Date: Sat, 4 May 2019 15:48:17 -0400 Subject: [PATCH 1/4] add test output and a run against Python RC --- .azure-pipelines.yml | 115 ++++++++++++++++++++++++++----------------- tox.ini | 2 +- 2 files changed, 71 insertions(+), 46 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 6ba0a4d2..5a4910ee 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -1,53 +1,78 @@ trigger: -- master +- 'master' +- '*-maintenance' -variables: - vmImage: ubuntu-latest - python.version: '3.7' - TOXENV: 'py,codecov' - python.architecture: 'x64' +jobs: +- job: Flask + variables: + vmImage: ubuntu-latest + python.version: '3.7' + TOXENV: 'py,codecov' + python.architecture: 'x64' + publish.test.results: 'true' -strategy: - matrix: - Python37Linux: - python.version: '3.7' - Python37Windows: - python.version: '3.7' - vmImage: 'windows-latest' - Python37Mac: - python.version: '3.7' - vmImage: 'macos-latest' - Pypy3Linux: - python.version: 'pypy3' - Python36Linux: - python.version: '3.6' - Python35Linux: - python.version: '3.5' - Python27Linux: - python.version: '2.7' - Python27Windows: - python.version: '2.7' - vmImage: 'windows-latest' - DocsHtml: - TOXENV: docs-html - VersionRange: - TOXENV: devel,lowest,codecov + strategy: + matrix: + Python37Linux: + python.version: '3.7' + Python37Windows: + python.version: '3.7' + vmImage: 'windows-latest' + Python37Mac: + python.version: '3.7' + vmImage: 'macos-latest' + Pypy3Linux: + python.version: 'pypy3' + Python36Linux: + python.version: '3.6' + Python35Linux: + python.version: '3.5' + Python27Linux: + python.version: '2.7' + Python27Windows: + python.version: '2.7' + vmImage: 'windows-latest' + DocsHtml: + TOXENV: docs-html + publish.test.results: 'false' + VersionRange: + TOXENV: devel,lowest,codecov -pool: - vmImage: $[ variables.vmImage ] + pool: + vmImage: $[ variables.vmImage ] -steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: $(python.version) - architecture: $(python.architecture) + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(python.version) + architecture: $(python.architecture) -- script: pip install -U tox - displayName: 'Install tox' + - script: pip install -U tox + displayName: 'Install tox' -- script: tox - displayName: 'Run tox' + - script: tox -- --junitxml=unittests/TEST-$(Agent.JobName).xml + displayName: 'Run tox' -# TODO: add codecov token -# TODO: emit JUnit test results -# TODO: build on nightly + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/TEST-*.xml' + testRunTitle: '$(Agent.JobName)' + condition: eq(variables['publish.test.results'], 'true') + + # TODO: add codecov token + +# As a courtesy, try this on the dev version of Python +# Use a container since Azure Pipelines may not have the bleeding-edge Python RC +- job: FlaskOnLatest + pool: { vmImage: ubuntu-latest } + container: python:rc-stretch + steps: + - script: | + echo "##vso[task.prependPath]$HOME/.local/bin" + pip install -U --user tox + displayName: 'Install tox' + + - script: | + tox + exit 0 # don't fail the build if this doesn't work! + displayName: 'Run tox' diff --git a/tox.ini b/tox.ini index d37d2486..ad618ed2 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ commands = pip install -q -e examples/javascript[test] # pytest-cov doesn't seem to play nice with -p - coverage run -p -m pytest tests examples + coverage run -p -m pytest tests examples {posargs} [testenv:docs-html] deps = From 459176a7195a1bfc82f4228ad60584689497349c Mon Sep 17 00:00:00 2001 From: Matt Cooper Date: Sat, 4 May 2019 16:59:10 -0400 Subject: [PATCH 2/4] try moving junit into tox.ini --- .azure-pipelines.yml | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 5a4910ee..c65a813a 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -50,12 +50,12 @@ jobs: - script: pip install -U tox displayName: 'Install tox' - - script: tox -- --junitxml=unittests/TEST-$(Agent.JobName).xml + - script: tox displayName: 'Run tox' - task: PublishTestResults@2 inputs: - testResultsFiles: '**/TEST-*.xml' + testResultsFiles: 'test-results.xml' testRunTitle: '$(Agent.JobName)' condition: eq(variables['publish.test.results'], 'true') diff --git a/tox.ini b/tox.ini index ad618ed2..16e97648 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ commands = pip install -q -e examples/javascript[test] # pytest-cov doesn't seem to play nice with -p - coverage run -p -m pytest tests examples {posargs} + coverage run -p -m pytest --junitxml=test-results.xml tests examples [testenv:docs-html] deps = From 8535503f4af23816ad64b54a6af12cf8b22e4450 Mon Sep 17 00:00:00 2001 From: Matt Cooper Date: Sat, 4 May 2019 20:28:14 -0400 Subject: [PATCH 3/4] do an allowed-failure the right way --- .azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index c65a813a..cdf542fb 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -72,7 +72,7 @@ jobs: pip install -U --user tox displayName: 'Install tox' + # don't fail the build if this doesn't work! - script: | - tox - exit 0 # don't fail the build if this doesn't work! + tox --ignore-outcome=true displayName: 'Run tox' From 41186d3fe284c8b8f46d56a26c0614375ee69ccf Mon Sep 17 00:00:00 2001 From: Matt Cooper Date: Sat, 4 May 2019 20:46:33 -0400 Subject: [PATCH 4/4] make a "future" toxenv --- .azure-pipelines.yml | 5 +++-- tox.ini | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index cdf542fb..f9e2d0c3 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -65,6 +65,8 @@ jobs: # Use a container since Azure Pipelines may not have the bleeding-edge Python RC - job: FlaskOnLatest pool: { vmImage: ubuntu-latest } + variables: + TOXENV: 'future' container: python:rc-stretch steps: - script: | @@ -73,6 +75,5 @@ jobs: displayName: 'Install tox' # don't fail the build if this doesn't work! - - script: | - tox --ignore-outcome=true + - script: tox displayName: 'Run tox' diff --git a/tox.ini b/tox.ini index 16e97648..b6a74950 100644 --- a/tox.ini +++ b/tox.ini @@ -37,6 +37,15 @@ commands = # pytest-cov doesn't seem to play nice with -p coverage run -p -m pytest --junitxml=test-results.xml tests examples +[testenv:future] +ignore_outcome = true + +commands = + pip install -q -e examples/tutorial[test] + pip install -q -e examples/javascript[test] + + coverage run -p -m pytest tests examples + [testenv:docs-html] deps = -r docs/requirements.txt @@ -51,7 +60,7 @@ commands = coverage html [testenv:codecov] -passenv = CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* +passenv = CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* BUILD_* SYSTEM_* AGENT_* TF_BUILD deps = codecov skip_install = true commands =