split fast dev test from the coverage gate run
`make test` is now the fast dev inner loop: no coverage, parallel (--concurrency=12), ~21s warm (down from ~36s). Coverage moves to a new `make test-coverage`, which push-check runs to feed coverage-gate. Drop the separate test-a11y pass from push-check — the coverage run already executes test/a11y. Both runs get --timeout 60s so a hung test fails fast instead of wedging the runner ~10min and stalling the gate. Measured: coverage is the floor (~36s) and concurrency-insensitive, so the gate keeps coverage without --concurrency; only the no-coverage dev path benefits from parallelism. T-192. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+22
-4
@@ -1,10 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
# Fast test layer — analyze + format + unit + widget + golden.
|
||||
# Runs in <60s on a warm cache. Called from `make test` and the
|
||||
# pre-push hook.
|
||||
#
|
||||
# Two modes (T-192):
|
||||
# ci/test.sh dev inner loop — NO coverage, parallel. ~20s warm.
|
||||
# ci/test.sh --coverage gate run — instrumented; writes coverage/lcov.info
|
||||
# for coverage-gate. ~36s (coverage is the floor and
|
||||
# is concurrency-insensitive, measured — so no
|
||||
# --concurrency here; it buys nothing).
|
||||
#
|
||||
# Both pass `--timeout 60s` so a hung test (a stray pumpAndSettle, or a
|
||||
# real-time deadlock) fails fast instead of wedging the runner for ~10 min and
|
||||
# stalling the pre-push gate. (Use the pumpAsync helper in tests; never
|
||||
# pumpAndSettle / Future.delayed(Duration.zero) inside testWidgets.)
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
coverage=0
|
||||
[[ "${1:-}" == "--coverage" ]] && coverage=1
|
||||
|
||||
echo "==> flutter analyze"
|
||||
flutter analyze
|
||||
|
||||
@@ -14,5 +27,10 @@ dart format --set-exit-if-changed .
|
||||
echo "==> dart test (pty — unreliable under the flutter test runner)"
|
||||
dart test --tags pty test/pty/session_test.dart test/panes/registry_test.dart
|
||||
|
||||
echo "==> flutter test --coverage (unit + widget + golden)"
|
||||
flutter test --coverage --exclude-tags pty
|
||||
if [[ "$coverage" == 1 ]]; then
|
||||
echo "==> flutter test --coverage (gate; unit + widget + golden + a11y)"
|
||||
flutter test --coverage --exclude-tags pty --timeout 60s
|
||||
else
|
||||
echo "==> flutter test (dev; no coverage, parallel)"
|
||||
flutter test --exclude-tags pty --concurrency=12 --timeout 60s
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user