mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-10-19 02:51:42 -07:00
forgetest-ci: the undefined-name step fails when pyflakes is missing or raises
The "No undefined names" step runs under bash -e with no pipefail, and
-e does not reach the condition of an `if`. The former body pipes the
pyflakes run into grep, so the step's status is grep's alone: with
pyflakes absent ("No module named pyflakes" on stderr, exit 1) or
crashing, grep sees no match, the `if` is false, and the step passes
with nothing checked. Its `pip install pyflakes` also names no
interpreter.
The step now installs with `python -m pip`, into the interpreter it
runs; runs `pyflakes --version`, which fails the step under -e when
the module is missing; captures the pyflakes run, stderr included, in
a file (its own exit status is 1 for any message, unused imports
included, so it cannot be the gate); and fails on "undefined name" or
on "Traceback", a crash. The grep is pinned to pyflakes' message text;
no pyflakes version is pinned.
Proof: the step body, read from this workflow, run under bash -e over
the forgetest tree on Ubuntu 24.04 with python 3.12, against the
former body as the control. pyflakes missing: the former body exits 0,
this one exits 1. pyflakes 4.0.3 present, the tree as committed: both
exit 0 (22 unused imports and 2 unused locals, no undefined name). An
undefined name planted in a scratch copy: both exit 1. A pyflakes that
raises (a shim, scratch only): the former body exits 0, this one exits
1. In CI the step's log shows the pyflakes version before the check.
Acceptance: none; CI only. .github/ is outside meta-forgefirm and
every covers map.
This commit is contained in:
@@ -144,8 +144,10 @@ jobs:
|
|||||||
- name: No undefined names (the live drills never execute on the host)
|
- name: No undefined names (the live drills never execute on the host)
|
||||||
working-directory: forgefirm/forgetest
|
working-directory: forgefirm/forgetest
|
||||||
run: |
|
run: |
|
||||||
pip install pyflakes
|
python -m pip install pyflakes
|
||||||
if python -B -m pyflakes forgetest tests | grep -E "undefined name"; then exit 1; fi
|
python -B -m pyflakes --version
|
||||||
|
python -B -m pyflakes forgetest tests > pyflakes.txt 2>&1 || true
|
||||||
|
if grep -E "undefined name|Traceback" pyflakes.txt; then exit 1; fi
|
||||||
|
|
||||||
- name: Shared UI files match forgectrl at its pinned revision
|
- name: Shared UI files match forgectrl at its pinned revision
|
||||||
working-directory: forgefirm
|
working-directory: forgefirm
|
||||||
|
|||||||
Reference in New Issue
Block a user