summaryrefslogtreecommitdiff
path: root/.azure-pipelines
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2021-05-17 17:06:22 -0700
committerMatt Clay <matt@mystile.com>2021-05-17 17:42:42 -0700
commitbdae72ef6cbdb04a69de42045bec26868ff6356f (patch)
tree2e01536531baf1832742d0e8ffa7924c658f6b8f /.azure-pipelines
parent2124dde5a6b53f968b3aebd50e29307e120b2910 (diff)
downloadansible-bdae72ef6cbdb04a69de42045bec26868ff6356f.zip
Add fallback for coverage report generation.
This should allow the same script to be used for two different scenarios: - ansible-core across multiple versions (not all of which support `--docker` for coverage reports) - collections (which should always use the `devel` branch for coverage reports)
Diffstat (limited to '.azure-pipelines')
-rwxr-xr-x.azure-pipelines/scripts/report-coverage.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/.azure-pipelines/scripts/report-coverage.sh b/.azure-pipelines/scripts/report-coverage.sh
index d1bb638066..050464be36 100755
--- a/.azure-pipelines/scripts/report-coverage.sh
+++ b/.azure-pipelines/scripts/report-coverage.sh
@@ -12,4 +12,6 @@ if ! ansible-test --help >/dev/null 2>&1; then
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
fi
-ansible-test coverage xml --stub --docker --color -v
+# Generate stubs using docker (if supported) otherwise fall back to using a virtual environment instead.
+# The use of docker is required when Powershell code is present, but Ansible 2.12 was the first version to support --docker with coverage.
+ansible-test coverage xml --stub --docker --color -v || ansible-test coverage xml --stub --venv --venv-system-site-packages --color -v