Verify committed mocks are up to date in CI - #1366
Open
sneurlax wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## staging #1366 +/- ##
========================================
Coverage 4.84% 4.84%
========================================
Files 1092 1092
Lines 109141 109141
========================================
Hits 5283 5283
Misses 103858 103858 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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. The step also works around two generator quirks, commented inline: --delete-conflicting-outputs deletes the gitignored generated app config, and hive_ce emits an untracked registrar this repo never imports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.