Skip to content

fix: repair failing test suite and run tests in PR CI#65

Merged
nick-transition merged 2 commits into
mainfrom
claude/cool-wiles-06952b
Jul 3, 2026
Merged

fix: repair failing test suite and run tests in PR CI#65
nick-transition merged 2 commits into
mainfrom
claude/cool-wiles-06952b

Conversation

@nick-transition

Copy link
Copy Markdown
Owner

Summary

flutter test test/ had 4 pre-existing failures (verified failing on main), and CI never ran tests — pr-check.yml only did analyze + build. This fixes each failure and adds a test step to CI.

Changes

  • Deleted test/widget_test.dart — the untouched Flutter template counter test; the app has no counter, and MyApp can't pump without Firebase anyway.
  • Regenerated test/screenshots/01_marketing_landing.png — the marketing screen drifted 0.7% from the stored golden. The other two goldens were unchanged.
  • Split the invalid Workout toMap/fromMap round-trip testtoMap() always writes FieldValue.serverTimestamp() for updatedAt (a write-only sentinel) while fromMap casts to Timestamp?, so a direct round-trip can never work. Now one test asserts the write-shaped map (including the FieldValue), another feeds fromMap a read-shaped map with real Timestamps. No production code changed.
  • Removed the SessionCard smoke test — the widget reads FirebaseAuth.instance.currentUser!.uid and builds a FirebaseFirestore.instance stream directly in build(), so it can't render without an initialized Firebase app. Covering it would require injecting those dependencies into the widget (possible follow-up).
  • Added a Test step to pr-check.yml — runs flutter test --exclude-tags golden test/ between analyze and build. Golden tests are tagged golden (declared in a new dart_test.yaml) and excluded in CI because they're macOS-generated and routinely mismatch pixel-for-pixel on Linux runners; they still run locally with plain flutter test.

Testing

  • flutter test test/ → 14 passed
  • flutter test --exclude-tags golden test/ (exact CI invocation) → 11 passed, 3 goldens skipped
  • flutter analyze --no-fatal-infos → only pre-existing infos

🤖 Generated with Claude Code

Nick Stoddart and others added 2 commits July 2, 2026 00:09
- Delete template counter test (widget_test.dart) that never matched the app
- Regenerate stale marketing landing golden (screen drifted 0.7%)
- Split invalid Workout toMap/fromMap round-trip test: toMap writes
  FieldValue.serverTimestamp() for updatedAt, which fromMap can't cast,
  so test write-shaped and read-shaped maps separately
- Remove SessionCard smoke test: the widget reads FirebaseAuth/
  FirebaseFirestore singletons in build() and can't render without an
  initialized Firebase app
- Tag golden tests and add flutter test --exclude-tags golden to
  pr-check.yml (goldens are macOS-generated and mismatch on Linux)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nick-transition nick-transition enabled auto-merge (squash) July 3, 2026 01:59
@nick-transition nick-transition merged commit 00bd25f into main Jul 3, 2026
2 checks passed
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