diff --git a/.azure-pipelines/scripts/run-tests.sh b/.azure-pipelines/scripts/run-tests.sh index 4ed20d55..b1f86289 100755 --- a/.azure-pipelines/scripts/run-tests.sh +++ b/.azure-pipelines/scripts/run-tests.sh @@ -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 diff --git a/.azure-pipelines/templates/test.yml b/.azure-pipelines/templates/test.yml index 897b5910..0404fb72 100644 --- a/.azure-pipelines/templates/test.yml +++ b/.azure-pipelines/templates/test.yml @@ -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() diff --git a/noxfile.py b/noxfile.py index fa25e33a..3f21d361 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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. diff --git a/tests/utils/shippable/nox.sh b/tests/utils/shippable/nox.sh index 1349df79..c3a461da 100755 --- a/tests/utils/shippable/nox.sh +++ b/tests/utils/shippable/nox.sh @@ -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}