Skip to content

Verify committed mocks are up to date in CI - #1366

Open
sneurlax wants to merge 1 commit into
stagingfrom
test/mocks
Open

sneurlax wants to merge 1 commit into
stagingfrom
test/mocks

Conversation

@sneurlax

Copy link
Copy Markdown
Member

Instead of blindly regenerating mocks (which conflicts with the repo's approach of committing them), run build_runner then check git diff --exit-code so CI fails clearly if committed mocks are stale rather than silently running tests against outdated files.

@codecov

codecov Bot commented May 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 9.64%. Comparing base (1e2e4d9) to head (be4c062).
⚠️ Report is 26 commits behind head on staging.

Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1366      +/-   ##
===========================================
+ Coverage     7.85%    9.64%   +1.78%     
===========================================
  Files         1125     1129       +4     
  Lines       112820   113515     +695     
===========================================
+ Hits          8866    10949    +2083     
+ Misses      103954   102566    -1388     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The repo commits its generated code (52 *.mocks.dart, 42 *.g.dart) and
build.yaml never runs build_runner, so releases are compiled from exactly
what is checked in — but nothing checked that it still matches its
sources. Run build_runner in the test job and fail on any *.mocks.dart or
*.g.dart the generators would rewrite, pointing at
scripts/dev/build_runner.sh.

Generated files are compared after dart format, since the committed ones
are kept format clean and the generators format with their own pinned
dart_style.

The step also works around two generator quirks, commented inline:
build_runner can replace the gitignored generated app config, and
hive_ce emits an untracked registrar this repo never imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant