@biffo/cli 0.176.0 → 0.176.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -89,6 +89,13 @@ SKIPPED=""
|
|
|
89
89
|
# break-even at one catch per 336 pushes, against an observed rate of roughly
|
|
90
90
|
# one per 165.
|
|
91
91
|
#
|
|
92
|
+
# The command is plain `pytest -q`, matching CI. `--no-cov` looked like a free
|
|
93
|
+
# speed-up and is a **pytest-cov flag**: repos without that plugin -- e.g.
|
|
94
|
+
# biffo-plugin-ideation, whose CI runs `uv run pytest -q` -- reject it outright
|
|
95
|
+
# with `unrecognized arguments`. That is the gate failing where CI passes, which
|
|
96
|
+
# H5 pre-registered as a condition that refutes it, and it was caught during
|
|
97
|
+
# rollout rather than by review.
|
|
98
|
+
#
|
|
92
99
|
# BIFFO_VERIFY_PYTEST overrides in BOTH directions: 1 forces it in, 0 forces it
|
|
93
100
|
# out. An override that only forces on would leave no way to escape a suite that
|
|
94
101
|
# has quietly grown past the threshold.
|
|
@@ -103,14 +110,28 @@ pytest_is_fast() {
|
|
|
103
110
|
_cache="$_d/.pytest-duration"
|
|
104
111
|
if [ -f "$_cache" ]; then
|
|
105
112
|
_secs=$(cat "$_cache" 2>/dev/null)
|
|
113
|
+
elif [ -n "$LIST" ]; then
|
|
114
|
+
# --list must not run a test suite to answer a question about the repo, so
|
|
115
|
+
# with no cached measurement it has to guess -- and the direction of the
|
|
116
|
+
# guess is the whole decision.
|
|
117
|
+
#
|
|
118
|
+
# Guessing "fast" makes --list CLAIM a check the gate may not run, which is
|
|
119
|
+
# the fail-open direction and exactly what this tooling exists to eliminate.
|
|
120
|
+
# Guessing "slow" makes it under-report a check the gate does run: visible,
|
|
121
|
+
# conservative, and self-correcting, because the first real run writes the
|
|
122
|
+
# measurement and every --list after that is exact.
|
|
123
|
+
#
|
|
124
|
+
# Both directions were tried. Under-reporting is the one that cannot lie
|
|
125
|
+
# about coverage.
|
|
126
|
+
_secs=99999
|
|
106
127
|
else
|
|
107
128
|
# First run in a repo: time it once, then decide from then on. A timeout
|
|
108
129
|
# means "too slow", which is the correct verdict rather than a hang.
|
|
109
130
|
_start=$(date +%s)
|
|
110
131
|
if [ "$_d" = "." ]; then
|
|
111
|
-
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run pytest -q
|
|
132
|
+
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run pytest -q >/dev/null 2>&1 || true
|
|
112
133
|
else
|
|
113
|
-
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run --directory "$_d" pytest -q
|
|
134
|
+
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run --directory "$_d" pytest -q >/dev/null 2>&1 || true
|
|
114
135
|
fi
|
|
115
136
|
_secs=$(($(date +%s) - _start))
|
|
116
137
|
echo "$_secs" > "$_cache" 2>/dev/null || true
|
|
@@ -283,8 +304,8 @@ if [ -n "$PY_DIRS" ]; then
|
|
|
283
304
|
[ -n "$bandit_paths" ] && ci_has "bandit" && run_check "bandit$suffix" uv run bandit -r $bandit_paths -ll -q
|
|
284
305
|
if [ "$PYTEST" = "0" ]; then
|
|
285
306
|
skip "pytest$suffix" "excluded by BIFFO_VERIFY_PYTEST=0"
|
|
286
|
-
elif [ -n "$PYTEST" ] ||
|
|
287
|
-
ci_has "pytest" && run_check "pytest$suffix" uv run pytest -q
|
|
307
|
+
elif [ -n "$PYTEST" ] || pytest_is_fast "."; then
|
|
308
|
+
ci_has "pytest" && run_check "pytest$suffix" uv run pytest -q
|
|
288
309
|
else
|
|
289
310
|
skip "pytest$suffix" "suite is slower than ${PYTEST_BUDGET_SECONDS}s - CI keeps it"
|
|
290
311
|
fi
|
|
@@ -295,8 +316,8 @@ if [ -n "$PY_DIRS" ]; then
|
|
|
295
316
|
ci_has "bandit" && run_check "bandit$suffix" uv run --directory "$d" bandit -r src -ll -q
|
|
296
317
|
if [ "$PYTEST" = "0" ]; then
|
|
297
318
|
skip "pytest$suffix" "excluded by BIFFO_VERIFY_PYTEST=0"
|
|
298
|
-
elif [ -n "$PYTEST" ] ||
|
|
299
|
-
ci_has "pytest" && run_check "pytest$suffix" uv run --directory "$d" pytest -q
|
|
319
|
+
elif [ -n "$PYTEST" ] || pytest_is_fast "$d"; then
|
|
320
|
+
ci_has "pytest" && run_check "pytest$suffix" uv run --directory "$d" pytest -q
|
|
300
321
|
else
|
|
301
322
|
skip "pytest$suffix" "suite is slower than ${PYTEST_BUDGET_SECONDS}s - CI keeps it"
|
|
302
323
|
fi
|
|
@@ -89,6 +89,13 @@ SKIPPED=""
|
|
|
89
89
|
# break-even at one catch per 336 pushes, against an observed rate of roughly
|
|
90
90
|
# one per 165.
|
|
91
91
|
#
|
|
92
|
+
# The command is plain `pytest -q`, matching CI. `--no-cov` looked like a free
|
|
93
|
+
# speed-up and is a **pytest-cov flag**: repos without that plugin -- e.g.
|
|
94
|
+
# biffo-plugin-ideation, whose CI runs `uv run pytest -q` -- reject it outright
|
|
95
|
+
# with `unrecognized arguments`. That is the gate failing where CI passes, which
|
|
96
|
+
# H5 pre-registered as a condition that refutes it, and it was caught during
|
|
97
|
+
# rollout rather than by review.
|
|
98
|
+
#
|
|
92
99
|
# BIFFO_VERIFY_PYTEST overrides in BOTH directions: 1 forces it in, 0 forces it
|
|
93
100
|
# out. An override that only forces on would leave no way to escape a suite that
|
|
94
101
|
# has quietly grown past the threshold.
|
|
@@ -103,14 +110,28 @@ pytest_is_fast() {
|
|
|
103
110
|
_cache="$_d/.pytest-duration"
|
|
104
111
|
if [ -f "$_cache" ]; then
|
|
105
112
|
_secs=$(cat "$_cache" 2>/dev/null)
|
|
113
|
+
elif [ -n "$LIST" ]; then
|
|
114
|
+
# --list must not run a test suite to answer a question about the repo, so
|
|
115
|
+
# with no cached measurement it has to guess -- and the direction of the
|
|
116
|
+
# guess is the whole decision.
|
|
117
|
+
#
|
|
118
|
+
# Guessing "fast" makes --list CLAIM a check the gate may not run, which is
|
|
119
|
+
# the fail-open direction and exactly what this tooling exists to eliminate.
|
|
120
|
+
# Guessing "slow" makes it under-report a check the gate does run: visible,
|
|
121
|
+
# conservative, and self-correcting, because the first real run writes the
|
|
122
|
+
# measurement and every --list after that is exact.
|
|
123
|
+
#
|
|
124
|
+
# Both directions were tried. Under-reporting is the one that cannot lie
|
|
125
|
+
# about coverage.
|
|
126
|
+
_secs=99999
|
|
106
127
|
else
|
|
107
128
|
# First run in a repo: time it once, then decide from then on. A timeout
|
|
108
129
|
# means "too slow", which is the correct verdict rather than a hang.
|
|
109
130
|
_start=$(date +%s)
|
|
110
131
|
if [ "$_d" = "." ]; then
|
|
111
|
-
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run pytest -q
|
|
132
|
+
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run pytest -q >/dev/null 2>&1 || true
|
|
112
133
|
else
|
|
113
|
-
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run --directory "$_d" pytest -q
|
|
134
|
+
timeout "$((PYTEST_BUDGET_SECONDS * 4))" uv run --directory "$_d" pytest -q >/dev/null 2>&1 || true
|
|
114
135
|
fi
|
|
115
136
|
_secs=$(($(date +%s) - _start))
|
|
116
137
|
echo "$_secs" > "$_cache" 2>/dev/null || true
|
|
@@ -283,8 +304,8 @@ if [ -n "$PY_DIRS" ]; then
|
|
|
283
304
|
[ -n "$bandit_paths" ] && ci_has "bandit" && run_check "bandit$suffix" uv run bandit -r $bandit_paths -ll -q
|
|
284
305
|
if [ "$PYTEST" = "0" ]; then
|
|
285
306
|
skip "pytest$suffix" "excluded by BIFFO_VERIFY_PYTEST=0"
|
|
286
|
-
elif [ -n "$PYTEST" ] ||
|
|
287
|
-
ci_has "pytest" && run_check "pytest$suffix" uv run pytest -q
|
|
307
|
+
elif [ -n "$PYTEST" ] || pytest_is_fast "."; then
|
|
308
|
+
ci_has "pytest" && run_check "pytest$suffix" uv run pytest -q
|
|
288
309
|
else
|
|
289
310
|
skip "pytest$suffix" "suite is slower than ${PYTEST_BUDGET_SECONDS}s - CI keeps it"
|
|
290
311
|
fi
|
|
@@ -295,8 +316,8 @@ if [ -n "$PY_DIRS" ]; then
|
|
|
295
316
|
ci_has "bandit" && run_check "bandit$suffix" uv run --directory "$d" bandit -r src -ll -q
|
|
296
317
|
if [ "$PYTEST" = "0" ]; then
|
|
297
318
|
skip "pytest$suffix" "excluded by BIFFO_VERIFY_PYTEST=0"
|
|
298
|
-
elif [ -n "$PYTEST" ] ||
|
|
299
|
-
ci_has "pytest" && run_check "pytest$suffix" uv run --directory "$d" pytest -q
|
|
319
|
+
elif [ -n "$PYTEST" ] || pytest_is_fast "$d"; then
|
|
320
|
+
ci_has "pytest" && run_check "pytest$suffix" uv run --directory "$d" pytest -q
|
|
300
321
|
else
|
|
301
322
|
skip "pytest$suffix" "suite is slower than ${PYTEST_BUDGET_SECONDS}s - CI keeps it"
|
|
302
323
|
fi
|