diff --git a/.azure-pipelines/scripts/aggregate-coverage.sh b/.azure-pipelines/scripts/aggregate-coverage.sh index 0ccef353..ca2b19de 100755 --- a/.azure-pipelines/scripts/aggregate-coverage.sh +++ b/.azure-pipelines/scripts/aggregate-coverage.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -# Aggregate code coverage results for later processing. - # Copyright (c) Ansible Project # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later +# Aggregate code coverage results for later processing. + set -o pipefail -eu agent_temp_directory="$1" @@ -13,10 +13,6 @@ PATH="${PWD}/bin:${PATH}" mkdir "${agent_temp_directory}/coverage/" -if [[ "$(ansible --version)" =~ \ 2\.9\. ]]; then - exit -fi - options=(--venv --venv-system-site-packages --color -v) ansible-test coverage combine --group-by command --export "${agent_temp_directory}/coverage/" "${options[@]}" diff --git a/.azure-pipelines/scripts/combine-coverage.py b/.azure-pipelines/scripts/combine-coverage.py index 3b2fd993..bf1592a0 100755 --- a/.azure-pipelines/scripts/combine-coverage.py +++ b/.azure-pipelines/scripts/combine-coverage.py @@ -11,8 +11,7 @@ Keep in mind that Azure Pipelines does not enforce unique job display names (onl It is up to pipeline authors to avoid name collisions when deviating from the recommended format. """ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type +from __future__ import annotations import os import re @@ -24,12 +23,12 @@ def main(): """Main program entry point.""" source_directory = sys.argv[1] - if '/ansible_collections/' in os.getcwd(): + if "/ansible_collections/" in os.getcwd(): output_path = "tests/output" else: output_path = "test/results" - destination_directory = os.path.join(output_path, 'coverage') + destination_directory = os.path.join(output_path, "coverage") if not os.path.exists(destination_directory): os.makedirs(destination_directory) @@ -38,27 +37,27 @@ def main(): count = 0 for name in os.listdir(source_directory): - match = re.search('^Coverage (?P[0-9]+) (?P