@biffo/cli 0.250.0 → 0.250.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.
- package/package.json +1 -1
- package/scripts/verify.sh +43 -2
package/package.json
CHANGED
package/scripts/verify.sh
CHANGED
|
@@ -688,8 +688,42 @@ pg_test_modules() {
|
|
|
688
688
|
# assertions its CI workflow makes, for the same reason.
|
|
689
689
|
pg_test_run() {
|
|
690
690
|
_out="/tmp/biffo-verify-pg.$$"
|
|
691
|
-
|
|
692
|
-
|
|
691
|
+
_pg_started=$(date +%s)
|
|
692
|
+
TABSII_TEST_PG_DSN="$PG_TEST_DSN" BIFFO_TEST_PG_DSN="$PG_TEST_DSN" \
|
|
693
|
+
timeout "$PG_TEST_BUDGET_SECONDS" uv run --directory "$1" pytest -q $2 >"$_out" 2>&1
|
|
694
|
+
_pg_rc=$?
|
|
695
|
+
_pg_elapsed=$(($(date +%s) - _pg_started))
|
|
696
|
+
|
|
697
|
+
# `timeout` exits 124 when it kills the command (137 if SIGKILL was needed).
|
|
698
|
+
# Reported apart from a real failure, because they are different facts and
|
|
699
|
+
# this gate used to render them identically: a killed run printed
|
|
700
|
+
# `verify failed: pg-test` with NO failing test named, which reads exactly
|
|
701
|
+
# like a defect and sends the reader hunting one. It happened on
|
|
702
|
+
# tabsii-platform (#703) -- the same push succeeded on retry, unchanged.
|
|
703
|
+
#
|
|
704
|
+
# Same discipline as `wait-for-checks` and the dependency audits: "could not
|
|
705
|
+
# determine" must never wear the clothes of "found something wrong".
|
|
706
|
+
if [ "$_pg_rc" -eq 124 ] || [ "$_pg_rc" -eq 137 ]; then
|
|
707
|
+
echo "TIMED OUT after ${_pg_elapsed}s (budget ${PG_TEST_BUDGET_SECONDS}s)."
|
|
708
|
+
echo ""
|
|
709
|
+
echo "This is INCONCLUSIVE, not a failing test: the lane was killed partway,"
|
|
710
|
+
echo "so nothing below is a verdict on your change. Do not go looking for a"
|
|
711
|
+
echo "bug on this evidence."
|
|
712
|
+
echo ""
|
|
713
|
+
echo "Most likely the lane has simply outgrown its budget. Re-run with more:"
|
|
714
|
+
echo " BIFFO_VERIFY_PG_BUDGET=$((PG_TEST_BUDGET_SECONDS * 2)) sh scripts/verify.sh"
|
|
715
|
+
echo ""
|
|
716
|
+
echo "If that passes, raise PG_TEST_BUDGET_SECONDS rather than living with a"
|
|
717
|
+
echo "gate that fails at random -- and re-measure the comment above it, which"
|
|
718
|
+
echo "records what the lane cost when the number was last chosen."
|
|
719
|
+
echo ""
|
|
720
|
+
echo "Partial output before the kill (NOT a result):"
|
|
721
|
+
tail -15 "$_out"
|
|
722
|
+
rm -f "$_out"
|
|
723
|
+
return 1
|
|
724
|
+
fi
|
|
725
|
+
|
|
726
|
+
if [ "$_pg_rc" -ne 0 ]; then
|
|
693
727
|
cat "$_out"
|
|
694
728
|
rm -f "$_out"
|
|
695
729
|
return 1
|
|
@@ -707,6 +741,13 @@ pg_test_run() {
|
|
|
707
741
|
rm -f "$_out"
|
|
708
742
|
return 1
|
|
709
743
|
fi
|
|
744
|
+
# A pass with almost no headroom is the state just before the confusing
|
|
745
|
+
# failure above, and it is silent unless somebody says so. 80% is early
|
|
746
|
+
# enough to act on and rare enough not to become noise.
|
|
747
|
+
if [ "$((_pg_elapsed * 100))" -gt "$((PG_TEST_BUDGET_SECONDS * 80))" ]; then
|
|
748
|
+
printf '\033[33m note: pg-test took %ss of a %ss budget -- raise PG_TEST_BUDGET_SECONDS before it starts timing out at random.\033[0m\n' \
|
|
749
|
+
"$_pg_elapsed" "$PG_TEST_BUDGET_SECONDS"
|
|
750
|
+
fi
|
|
710
751
|
rm -f "$_out"
|
|
711
752
|
return 0
|
|
712
753
|
}
|