Fix coverage reporting with AZP. (#1273)

ci_coverage
ci_complete
This commit is contained in:
Felix Fontein 2026-06-03 21:39:49 +02:00 committed by GitHub
parent db367985cf
commit f369956247
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 3 deletions

View File

@ -10,11 +10,13 @@ set -o pipefail -eu
entry_point="$1"
test="$2"
read -r -a coverage_branches <<< "$3" # space separated list of branches to run code coverage on for scheduled builds
agent_temp_directory="$4"
export COMMIT_MESSAGE
export COMPLETE
export COVERAGE
export IS_PULL_REQUEST
export COVERAGE_DESTINATION_DIRECTORY="${agent_temp_directory}/coverage"
if [ "${SYSTEM_PULLREQUEST_TARGETBRANCH:-}" ]; then
IS_PULL_REQUEST=true

View File

@ -23,7 +23,7 @@ jobs:
- checkout: self
fetchDepth: $(fetchDepth)
path: $(checkoutPath)
- bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)"
- bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)" "$(Agent.TempDirectory)"
displayName: Run Tests
- bash: .azure-pipelines/scripts/process-results.sh
condition: succeededOrFailed()

View File

@ -36,7 +36,7 @@ def update_azp_config(session: nox.Session) -> None:
session.debug(" ".join(command))
result = run_antsibull_nox(command)
if result != 0:
session.fail(f"Execution failed with status code {result}")
session.error(f"Execution failed with status code {result}")
# Allow to run the noxfile with `python noxfile.py`, `pipx run noxfile.py`, or similar.

View File

@ -80,6 +80,8 @@ fi
export FORCE_COLOR=1
export ANTSIBULL_NOX_IGNORE_INSTALLED_COLLECTIONS="true"
export ANTSIBULL_NOX_ALWAYS_COPY_REPO_STRUCTURE="true" # https://github.com/ansible/ansible/issues/87052
export ANTSIBULL_NOX_COVERAGE_DESTINATION="${COVERAGE_DESTINATION_DIRECTORY}"
export ANTSIBULL_NOX_COVERAGE_ANALYSIS_FILE="${COVERAGE_DESTINATION_DIRECTORY}/coverage-analyze-targets.json"
export ANTSIBULL_NOX_COVERAGE_NO_XML="true"
nox -e "${nox_session}" -- ${COVERAGE}