test(app): fix pre-existing test drift (env fakes + DeviceType.frame)#8583
Merged
Conversation
…, drop mixpanel/growthbook)
… init Env, correct cleared-config assertions - Replace removed DeviceType.frame: drop 2 redundant no-route cases (covered by bee/fieldy/limitless/plaud), switch the unique 'gains route' case to fieldy. - Init Env in setUpAll so omi-route paths reading Env.apiBaseUrl don't throw LateInitializationError. - getString returns '' (non-nullable) for missing keys, so assert isEmpty not isNull on cleared nativeBleStreamConfig. These ran for the first time after the DeviceType.frame compile error was fixed.
mdmohsin7
added a commit
that referenced
this pull request
Jun 29, 2026
## What Bumps the repo's Flutter toolchain from **3.35.3** (10 months old) to **3.41.9** (latest patch in the 3.41 line, bundles Dart 3.11.5, released 2026-04-30). - **codemagic.yaml** — all 8 `flutter:` pins `3.35.3` → `3.41.9` (this is what actually drives app builds) - **app/setup.sh** + **app/setup/scripts/setup.ps1** — informational `Flutter SDK (v…)` strings updated (macOS + Windows setup scripts) - **docs/doc/developer/AppSetup.mdx** — `flutter doctor` example output + "Recommended versions" bumped to 3.41.9 - **app/.fvmrc** — removed. It was stale (pinned `3.24.1`, ~13 months old), unreferenced in any docs/CI/scripts, and FVM isn't part of the workflow. Dead config. - **app/pubspec.lock** — `matcher` 0.12.18→0.12.19 and `test_api` 0.7.9→0.7.10, the versions the 3.41.9 SDK pins `.github/workflows/lint.yml` is intentionally left on `channel: stable` (unpinned) — unchanged. ## Verification (run locally on Flutter 3.41.9 / Dart 3.11.5) | Check | Result | |---|---| | `flutter pub get` | ✅ resolves | | `flutter gen-l10n` | ✅ no changes, zero untranslated warnings | | `flutter analyze` | ✅ **0 errors in `lib/`** (shipping code) | | `flutter build apk --debug --flavor dev` | ✅ APK built — full Gradle/AGP toolchain (primary 3.35→3.41 risk) | iOS not built locally (CocoaPods/Xcode) — will be validated by Codemagic. ### Pre-existing test errors (NOT from this upgrade) `flutter analyze` reports errors in `test/` that are pre-existing test/code drift independent of the SDK version (`DeviceType.frame` removed; `EnvFields.posthogApiKey` not implemented in fakes). Fixed separately in #8583.
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.
What
Fixes pre-existing test failures that had drifted from the app code. These were surfaced while verifying the Flutter 3.41.9 upgrade (#8581) but are independent of it — they fail on
maintoday.Env fakes out of sync with
EnvFields(3 files)lib/env/env.dartswapped Mixpanel → PostHog: droppedmixpanelProjectToken+growthbookApiKey, addedposthogApiKey. The test fakes inenv_test.dart,env_staging_test.dart,env_empty_staging_test.dartwere stale, causing:Missing concrete implementation of 'getter EnvFields.posthogApiKey'override_on_non_overriding_member(the removed getters)Fix: rename
mixpanelProjectToken→posthogApiKey, dropgrowthbookApiKey→ fakes now match the interface exactly.DeviceType.frameremoved (capture_provider_test.dart)framewas removed from theDeviceTypeenum (commitecb30e1cb). Three tests still referenced it → errorThere's no constant named 'frame' in 'DeviceType', which meant the entire file failed to compile and never ran.Fixes:
bee/fieldy/limitless/plaud).fieldy.Once the file compiled, it exposed two further latent bugs in tests that had never executed:
Envnever initialized →LateInitializationErroronomi-route paths readingEnv.apiBaseUrl. Added anEnv.init(stub)insetUpAll.SharedPreferencesUtil.getStringreturns a non-nullableStringdefaulting to'', so a clearednativeBleStreamConfigis'', notnull. ChangedisNull→isEmpty(2 spots).Verification (Flutter 3.41.9 / Dart 3.11.5)
flutter analyzeon the 4 files: 0 errors (was 6).flutter teston the 4 files: 72 tests pass (was: 6 compile errors + 10 runtime failures).Out of scope
The full suite still has 4 unrelated pre-existing logic failures in files this PR doesn't touch —
audio_wave_painter_test(shouldRepaint0.01 epsilon boundary) andring_protocol_test(off-by-one buffer boundary). Both are SDK-version-independent pure-Dart logic and need their own investigation; left for a separate fix.