Skip to content

CI: Fail the site-packages test step when tests fail - #1035

Merged
bashtage merged 2 commits into
mainfrom
wip-ci-exit
Nov 18, 2026
Merged

bashtage merged 2 commits into
mainfrom
wip-ci-exit

Conversation

@bashtage

@bashtage bashtage commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

The "Run tests (site-packages)" step of the sdist and wheel jobs (python_311_sdist, python_313_copy_on_write_wheel, python_313_no_matplotlib_wheel) passed even when tests failed.

Why. Azure runs a script step with bash --noprofile --norc, without set -e, so the step's status is the exit status of its last command. arch.test exits with the pytest status, but the last command of the step was popd, which always succeeds. In build 2519, for example, python_313_no_matplotlib_wheel reported 1 failed, 32102 passed, 373 skipped and the step and job still succeeded.

Fix. The test run is now the last command of the step. pushd/popd become cd: each step runs in its own shell, so there is no directory to restore.

Checked. I ran the step's script from the template with Git Bash --noprofile --norc, as Azure does, on a single test (test_pvalue_monotone_and_bounded[key0]). For the failing case, a pytest plugin made every test fail.

template tests pass tests fail
main exit 0 exit 0
this branch exit 0 exit 1

The other steps of these jobs already fail correctly. install-posix.sh exits 1 on an install error. If the build of the sdist or wheel fails, pip install gets no file and exits 1.

Also. In "Install arch (site-packages, wheel)" a misplaced closing quote made python -m pip install pip wheel --upgrade part of the echo, so it was printed and not run. The quote now ends the echo line. I checked by running the step's script with python and pip replaced by stubs that print their arguments: on main the upgrade is only echoed, and on this branch it runs.

🤖 Generated with Claude Code

The sdist and wheel jobs ran the tests with pushd/popd, so the exit
status of the step was that of popd and failed tests did not fail the
job. Make the test run the last command of the step.
A misplaced closing quote made the upgrade of pip and wheel part of the
echo, so it was printed and not run.
@bashtage
bashtage marked this pull request as ready for review November 18, 2026 18:17
@bashtage
bashtage merged commit 04b6e28 into main Nov 18, 2026
13 of 26 checks passed
@bashtage
bashtage deleted the wip-ci-exit branch November 18, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant