aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--Pipfile1
-rw-r--r--azure-pipelines.yml16
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
diff --git a/Pipfile b/Pipfile
index eaef3bd65..273db04d2 100644
--- a/Pipfile
+++ b/Pipfile
@@ -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'