diff options
author | 2019-09-15 23:55:11 +0200 | |
---|---|---|
committer | 2019-09-17 23:12:09 +1000 | |
commit | 39a28ca7eb2ba7966677b5283bce1ebdf8974ee1 (patch) | |
tree | 53b669307746c00b8c05056bcea46c1a48d3cb42 | |
parent | Fix InfractionSearchQuery (diff) |
Add coverage reporting to tests.
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | Pipfile | 1 | ||||
-rw-r--r-- | azure-pipelines.yml | 16 |
3 files changed, 22 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore index be4f43c7f..09ca151fb 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,9 @@ log.* # Custom user configuration config.yml + +# JUnit XML reports from pytest +junit.xml + +# Coverage XML artifacts +coverage.xml @@ -32,6 +32,7 @@ pre-commit = "~=1.18" safety = "*" dodgy = "*" pytest = "*" +pytest-cov = "*" [requires] python_version = "3.7" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 19df35c11..242513ab4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,9 +38,23 @@ jobs: - script: python -m flake8 displayName: 'Run linter' - - script: BOT_TOKEN=foobar python -m pytest tests + - script: BOT_TOKEN=foobar python -m pytest --junitxml=junit.xml --cov=bot --cov-branch --cov-report=term --cov-report=xml tests displayName: Run tests + - task: PublishCodeCoverageResults@1 + displayName: 'Publish Coverage Results' + condition: succeededOrFailed() + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: coverage.xml + + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + condition: succeededOrFailed() + inputs: + testResultsFiles: junit.xml + testRunTitle: 'Bot Test results' + - job: build displayName: 'Build Containers' dependsOn: 'test' |