debugpy/azure-pipelines/templates/run_tests.yml
2024-07-09 18:37:43 -05:00

30 lines
993 B
YAML

steps:
- script: "python -m pip install tox"
displayName: "Setup Python packages"
- pwsh: |
$toxEnv = '$(python.version)'
if (-not $toxEnv.startsWith('pypy')) {
$toxEnv = 'py' + $toxEnv.Replace('.', '')
}
echo 'tox environment: $toxEnv'
python -m tox -e $toxEnv -- --junitxml=$(Build.ArtifactStagingDirectory)/tests.xml --debugpy-log-dir=$(Build.ArtifactStagingDirectory)/logs tests
displayName: "Run tests using tox"
env:
DEBUGPY_PROCESS_SPAWN_TIMEOUT: 60
DEBUGPY_LAUNCH_TIMEOUT: 60
- task: PublishBuildArtifacts@1
condition: failed()
inputs:
artifactName: "Test logs"
pathToPublish: "$(Build.ArtifactStagingDirectory)/logs"
displayName: "Publish test logs"
- task: PublishTestResults@2
condition: always()
inputs:
testRunTitle: "$(Agent.JobName)"
testResultsFiles: "tests.xml"
searchFolder: "$(Build.ArtifactStagingDirectory)"
displayName: "Publish test results"