Merge pull request #3172 from vtbassmatt/enhance-azure-pipelines

add test output and a run against Python RC
This commit is contained in:
David Lord 2019-05-16 07:36:02 -07:00 committed by GitHub
commit 4260b7c2d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 81 additions and 46 deletions

View file

@ -1,53 +1,79 @@
trigger: trigger:
- master - 'master'
- '*-maintenance'
variables: jobs:
vmImage: ubuntu-latest - job: Flask
python.version: '3.7' variables:
TOXENV: 'py,codecov' vmImage: ubuntu-latest
python.architecture: 'x64' python.version: '3.7'
TOXENV: 'py,codecov'
python.architecture: 'x64'
publish.test.results: 'true'
strategy: strategy:
matrix: matrix:
Python37Linux: Python37Linux:
python.version: '3.7' python.version: '3.7'
Python37Windows: Python37Windows:
python.version: '3.7' python.version: '3.7'
vmImage: 'windows-latest' vmImage: 'windows-latest'
Python37Mac: Python37Mac:
python.version: '3.7' python.version: '3.7'
vmImage: 'macos-latest' vmImage: 'macos-latest'
Pypy3Linux: Pypy3Linux:
python.version: 'pypy3' python.version: 'pypy3'
Python36Linux: Python36Linux:
python.version: '3.6' python.version: '3.6'
Python35Linux: Python35Linux:
python.version: '3.5' python.version: '3.5'
Python27Linux: Python27Linux:
python.version: '2.7' python.version: '2.7'
Python27Windows: Python27Windows:
python.version: '2.7' python.version: '2.7'
vmImage: 'windows-latest' vmImage: 'windows-latest'
DocsHtml: DocsHtml:
TOXENV: docs-html TOXENV: docs-html
VersionRange: publish.test.results: 'false'
TOXENV: devel,lowest,codecov VersionRange:
TOXENV: devel,lowest,codecov
pool: pool:
vmImage: $[ variables.vmImage ] vmImage: $[ variables.vmImage ]
steps: steps:
- task: UsePythonVersion@0 - task: UsePythonVersion@0
inputs: inputs:
versionSpec: $(python.version) versionSpec: $(python.version)
architecture: $(python.architecture) architecture: $(python.architecture)
- script: pip install -U tox - script: pip install -U tox
displayName: 'Install tox' displayName: 'Install tox'
- script: tox - script: tox
displayName: 'Run tox' displayName: 'Run tox'
# TODO: add codecov token - task: PublishTestResults@2
# TODO: emit JUnit test results inputs:
# TODO: build on nightly testResultsFiles: 'test-results.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 }
variables:
TOXENV: 'future'
container: python:rc-stretch
steps:
- script: |
echo "##vso[task.prependPath]$HOME/.local/bin"
pip install -U --user tox
displayName: 'Install tox'
# don't fail the build if this doesn't work!
- script: tox
displayName: 'Run tox'

11
tox.ini
View file

@ -35,6 +35,15 @@ commands =
pip install -q -e examples/javascript[test] pip install -q -e examples/javascript[test]
# pytest-cov doesn't seem to play nice with -p # 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 coverage run -p -m pytest tests examples
[testenv:stylecheck] [testenv:stylecheck]
@ -56,7 +65,7 @@ commands =
coverage html coverage html
[testenv:codecov] [testenv:codecov]
passenv = CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* passenv = CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* BUILD_* SYSTEM_* AGENT_* TF_BUILD
deps = codecov deps = codecov
skip_install = true skip_install = true
commands = commands =