Repository navigation
CI: Fail the site-packages test step when tests fail - #1035
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
scriptstep withbash --noprofile --norc, withoutset -e, so the step's status is the exit status of its last command.arch.testexits with the pytest status, but the last command of the step waspopd, which always succeeds. In build 2519, for example,python_313_no_matplotlib_wheelreported1 failed, 32102 passed, 373 skippedand the step and job still succeeded.Fix. The test run is now the last command of the step.
pushd/popdbecomecd: 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.The other steps of these jobs already fail correctly.
install-posix.shexits 1 on an install error. If the build of the sdist or wheel fails,pip installgets no file and exits 1.Also. In "Install arch (site-packages, wheel)" a misplaced closing quote made
python -m pip install pip wheel --upgradepart of theecho, so it was printed and not run. The quote now ends theecholine. I checked by running the step's script withpythonandpipreplaced by stubs that print their arguments: on main the upgrade is only echoed, and on this branch it runs.🤖 Generated with Claude Code