Debian Codegraph @

ansible_collections/community/docker/.azure-pipelines/scripts/report-coverage.sh

raw
1 #!/usr/bin/env bash
2 # Generate code coverage reports for uploading to Azure Pipelines and codecov.io.
3
4 # Copyright (c) Ansible Project
5 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
6 # SPDX-License-Identifier: GPL-3.0-or-later
7
8 set -o pipefail -eu
9
10 PATH="${PWD}/bin:${PATH}"
11
12 if [[ "$(ansible --version)" =~ \ 2\.9\. ]]; then
13 exit
14 fi
15
16 if ! ansible-test --help >/dev/null 2>&1; then
17 # Install the devel version of ansible-test for generating code coverage reports.
18 # This is only used by Ansible Collections, which are typically tested against multiple Ansible versions (in separate jobs).
19 # Since a version of ansible-test is required that can work the output from multiple older releases, the devel version is used.
20 pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
21 fi
22
23 ansible-test coverage xml --group-by command --stub --venv --venv-system-site-packages --color -v