Reduce noise in CI output #128

Closed
opened 2026-05-20 12:12:48 +00:00 by guettli · 1 comment
guettli commented 2026-05-20 12:12:48 +00:00 (Migrated from codeberg.org)

do plan

do plan
guettlibot commented 2026-05-21 04:57:20 +00:00 (Migrated from codeberg.org)

Plan: Reduce CI Output Noise

Noisy patterns identified

Source Example lines Why it is noisy
build_runner build `[6.9s] 2s compiling builders/aot`
flutter pub get + _fe_analyzer_shared 93.0.0 Package list — useful only when resolving changes
git commit in CheckMocks 460 files changed, 71448 insertions(+) + per-file create mode lines Noise from the throwaway baseline commit
flutter test --reporter expanded 00:00 +0: loading ... + one line per test Per-test lines — only failures matter

Proposed changes

1. flutter test — show only failures

Create scripts/wrap-flutter-test.sh:

#!/usr/bin/env bash
# Run flutter test; print just the summary on success, full output on failure.
set -euo pipefail
tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT
if flutter test "$@" >"$tmp" 2>&1; then
    grep -E "tests? passed|^[0-9]+ test" "$tmp" || tail -1 "$tmp"
else
    cat "$tmp"; exit 1
fi

In ci/main.go: copy the script into test containers and replace direct flutter test invocations in Coverage, TestBackend, TestIntegration, and TestSyncReliability.

2. build_runner — suppress compilation progress

Create scripts/wrap-build-runner.sh:

#!/usr/bin/env bash
# Run build_runner; suppress progress lines on success, show everything on failure.
set -euo pipefail
tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT
if flutter pub run build_runner "$@" >"$tmp" 2>&1; then
    grep -vE "^\[.*s\] \|" "$tmp" || true
else
    cat "$tmp"; exit 1
fi

In ci/main.go: replace the build_runner WithExec in setup() and CheckMocks.

3. flutter pub get — suppress package list

Replace the flutter pub get WithExec in pubGetLayer() with an inline shell pipeline:

WithExec([]string{"/bin/sh", "-c",
    "flutter pub get 2>&1 | grep -vE '^(\\+|Downloading packages)'"})

No wrapper script needed — one line is sufficient.

4. git commit in CheckMocks — add --quiet

Replace:

WithExec([]string{"git", "commit", "-m", "baseline"})

with:

WithExec([]string{"git", "commit", "-q", "-m", "baseline"})

This eliminates all the 460 files changed ... and create mode ... lines with a one-character change.


Summary of files

File Action
scripts/wrap-flutter-test.sh New — silences per-test pass lines, shows only failures + summary
scripts/wrap-build-runner.sh New — silences compilation progress lines
ci/main.go Changed — use wrappers + inline filter + --quiet git commit

All wrappers follow the same pattern as scripts/silent_on_success.sh: capture output, replay only on failure.

## Plan: Reduce CI Output Noise ### Noisy patterns identified | Source | Example lines | Why it is noisy | |--------|---------------|-----------------| | `build_runner build` | `[6.9s] | 2s compiling builders/aot` | Compilation progress — irrelevant when it succeeds | | `flutter pub get` | `+ _fe_analyzer_shared 93.0.0` | Package list — useful only when resolving changes | | `git commit` in `CheckMocks` | `460 files changed, 71448 insertions(+)` + per-file `create mode` lines | Noise from the throwaway baseline commit | | `flutter test --reporter expanded` | `00:00 +0: loading ...` + one line per test | Per-test lines — only failures matter | --- ### Proposed changes #### 1. `flutter test` — show only failures Create **`scripts/wrap-flutter-test.sh`**: ```bash #!/usr/bin/env bash # Run flutter test; print just the summary on success, full output on failure. set -euo pipefail tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT if flutter test "$@" >"$tmp" 2>&1; then grep -E "tests? passed|^[0-9]+ test" "$tmp" || tail -1 "$tmp" else cat "$tmp"; exit 1 fi ``` In `ci/main.go`: copy the script into test containers and replace direct `flutter test` invocations in `Coverage`, `TestBackend`, `TestIntegration`, and `TestSyncReliability`. #### 2. `build_runner` — suppress compilation progress Create **`scripts/wrap-build-runner.sh`**: ```bash #!/usr/bin/env bash # Run build_runner; suppress progress lines on success, show everything on failure. set -euo pipefail tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT if flutter pub run build_runner "$@" >"$tmp" 2>&1; then grep -vE "^\[.*s\] \|" "$tmp" || true else cat "$tmp"; exit 1 fi ``` In `ci/main.go`: replace the `build_runner` `WithExec` in `setup()` and `CheckMocks`. #### 3. `flutter pub get` — suppress package list Replace the `flutter pub get` `WithExec` in `pubGetLayer()` with an inline shell pipeline: ```go WithExec([]string{"/bin/sh", "-c", "flutter pub get 2>&1 | grep -vE '^(\\+|Downloading packages)'"}) ``` No wrapper script needed — one line is sufficient. #### 4. `git commit` in CheckMocks — add `--quiet` Replace: ```go WithExec([]string{"git", "commit", "-m", "baseline"}) ``` with: ```go WithExec([]string{"git", "commit", "-q", "-m", "baseline"}) ``` This eliminates all the `460 files changed ...` and `create mode ...` lines with a one-character change. --- ### Summary of files | File | Action | |------|--------| | `scripts/wrap-flutter-test.sh` | New — silences per-test pass lines, shows only failures + summary | | `scripts/wrap-build-runner.sh` | New — silences compilation progress lines | | `ci/main.go` | Changed — use wrappers + inline filter + `--quiet` git commit | All wrappers follow the same pattern as `scripts/silent_on_success.sh`: capture output, replay only on failure.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#128