summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <mclay@redhat.com>2020-12-15 15:28:44 -0800
committerMatt Clay <matt@mystile.com>2020-12-15 17:05:31 -0800
commitcb848c927ef7e7edff6cecd85fa39804f4314323 (patch)
tree5c193f4b10e2ba5c712408672f5e0f5da538f53d
parentecfe290a6afd98b2023887ee738bd000caee4a8c (diff)
downloadansible-cb848c927ef7e7edff6cecd85fa39804f4314323.tar.gz
[stable-2.8] Update Azure Pipelines scripts and config. (#72986)
* Increase fetch depth to reduce the frequency of full test runs for out-of-date PRs. * Update scripts to match those which will be used in collections. (cherry picked from commit 3274e02fd87b93975d409ec47661b8011b1a7fbf) Co-authored-by: Matt Clay <mclay@redhat.com>
-rw-r--r--.azure-pipelines/azure-pipelines.yml2
-rwxr-xr-x.azure-pipelines/scripts/aggregate-coverage.sh7
-rwxr-xr-x.azure-pipelines/scripts/report-coverage.sh7
3 files changed, 14 insertions, 2 deletions
diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml
index 499803193d..fb571832ff 100644
--- a/.azure-pipelines/azure-pipelines.yml
+++ b/.azure-pipelines/azure-pipelines.yml
@@ -31,7 +31,7 @@ variables:
- name: entryPoint
value: test/utils/shippable/shippable.sh
- name: fetchDepth
- value: 100
+ value: 500
resources:
containers:
diff --git a/.azure-pipelines/scripts/aggregate-coverage.sh b/.azure-pipelines/scripts/aggregate-coverage.sh
index 2200502f56..f3113dd0a9 100755
--- a/.azure-pipelines/scripts/aggregate-coverage.sh
+++ b/.azure-pipelines/scripts/aggregate-coverage.sh
@@ -12,4 +12,9 @@ mkdir "${agent_temp_directory}/coverage/"
options=(--venv --venv-system-site-packages --color -v)
ansible-test coverage combine --export "${agent_temp_directory}/coverage/" "${options[@]}"
-ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}"
+
+if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then
+ # Only analyze coverage if the installed version of ansible-test supports it.
+ # Doing so allows this script to work unmodified for multiple Ansible versions.
+ ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}"
+fi
diff --git a/.azure-pipelines/scripts/report-coverage.sh b/.azure-pipelines/scripts/report-coverage.sh
index d8a689d803..1bd91bdc99 100755
--- a/.azure-pipelines/scripts/report-coverage.sh
+++ b/.azure-pipelines/scripts/report-coverage.sh
@@ -5,4 +5,11 @@ set -o pipefail -eu
PATH="${PWD}/bin:${PATH}"
+if ! ansible-test --help >/dev/null 2>&1; then
+ # Install the devel version of ansible-test for generating code coverage reports.
+ # This is only used by Ansible Collections, which are typically tested against multiple Ansible versions (in separate jobs).
+ # Since a version of ansible-test is required that can work the output from multiple older releases, the devel version is used.
+ pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
+fi
+
ansible-test coverage xml --stub --venv --venv-system-site-packages --color -v