Repository navigation
ci: stop discarding the exit status of five checks - #7
Open
SuperInstance wants to merge 1 commit into
Open
SuperInstance wants to merge 1 commit into
SuperInstance wants to merge 1 commit into
Conversation
This workflow is byte-identical in 15 repos and swallowed the exit status of every command that exists to prove something: cargo fmt --check || true cargo clippy -- -D warnings || true cargo test --verbose || true flake8 . --count --select=E9,F63,F7,F82 --statistics || true python -m pytest -x -v || true For this repo: Cargo.toml present: yes, Python test files: 0. `python -m pytest -x -v` is the sharp one. pytest exits 5 (NO_TESTS_COLLECTED) when it collects nothing -- a distinguished non-zero status that exists precisely so "no suite ran" is not confused with "the suite passed". `|| true` rewrote that 5 to 0. Removing the suffix lets the status propagate. If a job goes red, it is reporting the truth.
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.
.github/workflows/ci-rust-python.ymlis byte-identical across 15 repos and swallowedthe exit status of every command in it that exists to prove something:
The census recorded only lines 25 and 45 for these 15 repos (it scoped to test commands).
The same template also silences
fmt,clippyandflake8— 75 swallowed statuses acrossthe 15, not the 30 reported.
This repo: Cargo.toml present, 36 files containing
#[test]. Atests/directory with 9 files, none matched bytest_*.py.python -m pytest -x -vis the sharp one. pytest exits 5 (NO_TESTS_COLLECTED) whenit collects nothing — a distinguished, non-zero status that exists precisely so "no suite
ran" is not confused with "the suite passed".
|| truerewrote that 5 into a 0.Removing the suffix lets the status propagate.
Expect this to go red, and that is the point. 14 of these 15 repos have no Python test
at all, so the
pythonjob has been green over a suite that does not exist. The optionsfrom here are to write tests or to narrow the job to what the repo actually has — both are
the owner's call, and neither is something to decide by swallowing the exit code.
I could not execute
cargo/flake8/pytestin my sandbox (no Rust toolchain, no PyPIaccess), so the CI run on this PR is the verification. The YAML is parse-checked.