quiet test reporter to failures-only + front-load coverage in push-check (T-242)
This commit is contained in:
+12
-5
@@ -15,6 +15,13 @@
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Reporter: failures-only keeps the gate output to failing tests + a final
|
||||
# pass/fail count, instead of one line per test (the `expanded` reporter the
|
||||
# runner picks when stdout isn't a TTY — which buries real failures in
|
||||
# thousands of pass lines). Override with TEST_REPORTER=expanded when
|
||||
# debugging a specific run. (T-242)
|
||||
REPORTER="${TEST_REPORTER:-failures-only}"
|
||||
|
||||
coverage=0
|
||||
[[ "${1:-}" == "--coverage" ]] && coverage=1
|
||||
|
||||
@@ -28,24 +35,24 @@ echo "==> dart test (pty — unreliable under the flutter test runner; serial)"
|
||||
# --concurrency=1: these spawn real PTYs and compete for fds when run in
|
||||
# parallel, which flaked them (registry/session). Serialize — the proper fix
|
||||
# for resource-bound tests, vs. the old per-test `retry:` band-aid. (T-193)
|
||||
dart test --concurrency=1 --tags pty test/pty/session_test.dart test/panes/registry_test.dart
|
||||
dart test -r "$REPORTER" --concurrency=1 --tags pty test/pty/session_test.dart test/panes/registry_test.dart
|
||||
|
||||
# The parallel pool excludes both pty (runs under dart test, above) and
|
||||
# serial-tagged tests (concurrency-vulnerable — run in their own --concurrency=1
|
||||
# pass below). See dart_test.yaml + T-193.
|
||||
if [[ "$coverage" == 1 ]]; then
|
||||
echo "==> flutter test --coverage (parallel pool; excludes pty + serial)"
|
||||
flutter test --coverage --exclude-tags "pty || serial" --timeout 60s
|
||||
flutter test -r "$REPORTER" --coverage --exclude-tags "pty || serial" --timeout 60s
|
||||
cp coverage/lcov.info coverage/lcov.parallel.info
|
||||
echo "==> flutter test --coverage (serial-tagged; --concurrency=1)"
|
||||
flutter test --coverage --tags serial --concurrency=1 --timeout 60s
|
||||
flutter test -r "$REPORTER" --coverage --tags serial --concurrency=1 --timeout 60s
|
||||
echo "==> merge coverage (parallel + serial passes → coverage/lcov.info)"
|
||||
python3 ci/merge_lcov.py coverage/lcov.parallel.info coverage/lcov.info > coverage/lcov.merged.info
|
||||
mv coverage/lcov.merged.info coverage/lcov.info
|
||||
rm -f coverage/lcov.parallel.info
|
||||
else
|
||||
echo "==> flutter test (dev; parallel pool, excludes pty + serial)"
|
||||
flutter test --exclude-tags "pty || serial" --concurrency=12 --timeout 60s
|
||||
flutter test -r "$REPORTER" --exclude-tags "pty || serial" --concurrency=12 --timeout 60s
|
||||
echo "==> flutter test (dev; serial-tagged, --concurrency=1)"
|
||||
flutter test --tags serial --concurrency=1 --timeout 60s
|
||||
flutter test -r "$REPORTER" --tags serial --concurrency=1 --timeout 60s
|
||||
fi
|
||||
|
||||
+3
-1
@@ -5,4 +5,6 @@ set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
echo "==> a11y suite"
|
||||
flutter test test/a11y/
|
||||
# failures-only: failing tests + a final count, not one line per test.
|
||||
# Override with TEST_REPORTER=expanded when debugging. (T-242)
|
||||
flutter test -r "${TEST_REPORTER:-failures-only}" test/a11y/
|
||||
|
||||
+5
-1
@@ -25,6 +25,10 @@ fi
|
||||
# hang.
|
||||
TIMEOUT_SECONDS=${TIMEOUT_SECONDS:-120}
|
||||
|
||||
# failures-only: print failing tests + a final count, not one line per test.
|
||||
# Override with TEST_REPORTER=expanded when debugging. (T-242)
|
||||
REPORTER="${TEST_REPORTER:-failures-only}"
|
||||
|
||||
# Run dart test in its own process group so we can kill descendants on
|
||||
# timeout. `setsid` starts a new session; `timeout --kill-after` SIGKILLs
|
||||
# after SIGTERM if the test ignores it.
|
||||
@@ -32,7 +36,7 @@ CORE_DIRS="test/ipc test/pty test/daemon test/git test/panes test/files test/edi
|
||||
|
||||
echo "test-core: dart test ${CORE_DIRS} (timeout ${TIMEOUT_SECONDS}s)"
|
||||
if ! timeout --kill-after=5s "${TIMEOUT_SECONDS}s" \
|
||||
setsid --wait dart test $CORE_DIRS ; then
|
||||
setsid --wait dart test -r "$REPORTER" $CORE_DIRS ; then
|
||||
rc=$?
|
||||
if [[ $rc -eq 124 ]]; then
|
||||
echo "test-core: TIMEOUT — killing descendants" >&2
|
||||
|
||||
Reference in New Issue
Block a user