Enhance flutter-test.yml to run tests with --coverage and parse lcov.info files, producing aggregate summary table with per-package line coverage. Changes: - flutter-test.yml: add --coverage flag, lcov.info parsing, coverage % - collect_coverage.sh: new local coverage helper with summary table - tools/README.md: document collect_coverage.sh script - .gitignore: add coverage/ directories - master_development_brief.md: mark Stage 4D complete, document baseline coverage table, update next branch to Stage 5A, resolve improvement #5 Baseline coverage (2026-05-22): - core: 85.7%% (42/49 lines, 20 tests) - design_system: 100.0%% (88/88 lines, 41 tests) - feature_wordpress: 84.7%% (857/1012 lines, 294 tests) - kell_web: 54.1%% (191/353 lines, 24 tests) - Overall: 78.4%% (1178/1502 lines, 379 tests) No minimum thresholds enforced — visibility first. |
||
|---|---|---|
| .. | ||
| README.md | ||
| collect_coverage.sh | ||
| run_all_tests.sh | ||
README.md
Tools
CI/CD helper scripts for the Kell Creations Flutter monorepo.
Scripts
run_all_tests.sh
Runs flutter test across all testable packages and apps, producing a per-package pass/fail summary.
Usage:
# From kell_creations_apps/ directory
./tools/run_all_tests.sh # Run tests only
./tools/run_all_tests.sh --analyze # Run dart analyze + tests
What it does:
- Installs dependencies (
flutter pub get) for all packages and apps. - Optionally runs
dart analyze --fatal-infoson each package/app. - Runs
flutter test --reporter expandedfor packages with tests. - Prints an aggregate pass/fail summary table.
Adding new packages:
When a new package gains tests, add its path to the TESTABLE array in the script. For packages that should be analyzed but have no tests yet, add to the ANALYZABLE array only.
Exit codes:
0— all tests passed (and analyze clean, if--analyzewas used)1— one or more failures detected
collect_coverage.sh
Runs flutter test --coverage across all testable packages and apps, parses the generated lcov.info files, and produces a combined summary table with test counts and line coverage percentages.
Usage:
# From kell_creations_apps/ directory
./tools/collect_coverage.sh
What it does:
- Installs dependencies (
flutter pub get) for testable packages. - Runs
flutter test --coverage --reporter expandedfor each package. - Parses
coverage/lcov.infoto extract lines hit / lines found per package. - Prints an aggregate summary table with pass/fail counts and coverage percentages.
Output example:
╔═══════════════════════════════════════════════════════════╗
║ Flutter Test & Coverage Summary ║
╠═══════════════════════════════════════════════════════════╣
║ Package Pass Fail Lines Coverage ║
╠═══════════════════════════════════════════════════════════╣
║ core 20 0 120/150 80.0% ║
║ design_system 41 0 95/110 86.4% ║
║ ... ║
╠═══════════════════════════════════════════════════════════╣
║ TOTAL 379 0 500/600 83.3% ║
╚═══════════════════════════════════════════════════════════╝
Exit codes:
0— all tests passed1— one or more failures detected
CI Workflows
The corresponding Forgejo Actions workflows live in .forgejo/workflows/:
| Workflow | Trigger | Purpose |
|---|---|---|
flutter-analyze.yml |
PRs and branches | Runs dart analyze on all packages and apps |
flutter-test.yml |
PRs and branches | Runs flutter test with result reporting |
validate-docs.yml |
Non-main branches | Validates MkDocs documentation build |
publish-docs.yml |
Push to main | Publishes documentation to docs host |