run the plugin against a real backend, and wire Linux into CI - #155
Merged
Conversation
Nothing has ever executed the Linux implementation — not here, not in CI. Its forceInit bookkeeping, the GHashTable's lifetime and six rewritten response sites all shipped in 6.0.0-dev.3 verified by compiling and reading alone. That was the weakest evidence in the release, and this closes it. example/integration_test/ is new: the example had no integration_test dependency and no scaffold at all. Six tests exercising the real backend through the method channel — round-trip with non-ASCII, overwrite, the empty value that used to throw on win32, absent-read, and canAuthenticate mapping to a known enum member rather than the StateError that was #148. The fifth test earns its place separately: it calls getStorage twice, with and without forceInit. A round-trip suite alone never reaches handleInit's new branch, because it never initialises the same name twice — so the logic this release added to four platforms would have stayed unexecuted even with integration tests present. Every store uses authenticationRequired: false. An authenticated one needs a real biometric or credential gesture, which no runner can give; the emulator work in #151 shows what that costs. CI gains gnome-keyring, dbus-x11 and xvfb, and runs the suite under a session bus with an unlocked keyring. libsecret needs the bus, the desktop runner needs a display. Verified by running the suite against the real Android keystore on an emulator: all six pass. The Linux leg is what CI will prove. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The first run failed exactly where the fragility was predicted. The daemon started, but an empty unlock password creates no keyring, and the graphical prompter it falls back to cannot open a display — so every write failed with "Object does not exist at /org/freedesktop/secrets/collection/login" while the reads, the absent-read, forceInit and canAuthenticate all passed. That split is the evidence: the channel and the plugin were fine, there was nowhere to store. A non-empty password and an existing ~/.local/share/keyrings are what make the login keyring appear. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hpoul
force-pushed
the
integration-test-scaffold
branch
from
August 25, 2026 18:01
d6a2e0b to
23562f5
Compare
Three points from review, all about assertions that pass for the wrong reason. The teardown wrapped `delete()` in a bare `catch (_)`, justified as "a test that failed mid-way may have left nothing". That case does not throw: Android guards on `exists()`, libsecret reports `removed = false` with no error set, the keychain maps `errSecItemNotFound` to `true`, and win32 maps `ERROR_NOT_FOUND` to `false`. So the only exception the catch could ever swallow was a store that genuinely failed — the class of bug this suite exists to surface — sitting in the one file whose whole purpose is to be loud. The win32 unit suite already uses the bare form. `canAuthenticate` asserted `isA<CanAuthenticateResponse>()`, which the return type makes a tautology. The real test was always the await: an unmapped native string throws a StateError inside `canAuthenticate`, which is how #148 surfaced. `completes` is the same test, and says so, so a later reader does not "fix" the tautology by deleting it. Linux hard-codes "ErrorHwUnavailable" in the C, so on that one platform the native-string-to-enum mapping itself can be pinned. The forceInit test asserted only the exception type. That is already discriminating on the method-channel platforms — nothing but the native repeat-plus-forceInit branch emits `AlreadyInitialized`, and any other native response stays a `PlatformException` — but naming the code matches the unit suite and guards the day a second code is translated. Verified: `flutter analyze --fatal-infos` clean in both packages, `flutter test` green, and the Linux job runs the suite against real libsecret. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hpoul
force-pushed
the
integration-test-scaffold
branch
from
August 25, 2026 18:17
af38417 to
92c672e
Compare
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.
Nothing has ever executed the Linux implementation — not in this repository, not in CI. The
forceInitbookkeeping, theGHashTablelifetime and six rewritten response sites all shipped in 6.0.0-dev.3 verified by compiling and reading alone. That was the weakest evidence anywhere in this release. This closes it.The scaffold
example/integration_test/is new. The example had nointegration_testdependency and no scaffold at all, which is why "add a Linux runtime test" was never a small job.Six tests, run through the method channel against the real platform backend:
getStorage, with and withoutforceInitcanAuthenticatemapping to a known enum member rather than theStateErrorthat was Android 16+: canAuthenticate() throws "Unknown response code {21}" (BIOMETRIC_ERROR_NOT_ENABLED_FOR_APPS) #148The fifth earns its place separately. A round-trip suite alone never reaches
handleInit's new branch, because it never initialises the same name twice — so the logic this release added to four platforms would have stayed unexecuted even with integration tests present. It has to be asked for deliberately.Every store uses
authenticationRequired: false. An authenticated one needs a real biometric or credential gesture that no CI runner can give; the emulator work in #151 shows what that costs.CI
gnome-keyring,dbus-x11andxvfbadded to the Linux job, and the suite runs under a session bus with an unlocked keyring — libsecret needs the bus, the desktop runner needs a display.The empty-password unlock is the fragile part, and worth knowing about: if a future runner image breaks it, the failure will look like a plugin bug rather than an environment one.
Verification
Run against the real Android keystore on an emulator — all six pass, including install, launch, channel, native backend and teardown. So the scaffold itself is proven; the Linux leg is what CI proves.
macOS cannot run it locally: the example's
keychain-access-groupsentitlement needs a development certificate, the same reason macOS is absent from the build matrix.What this does not buy
Functional coverage, not leak detection — catching something like the
FlValueleak fixed in #153 needs a separate leak-check run. And it is one platform's runtime; the scaffold now exists for the others, but wiring macOS or Windows into it is a separate change.🤖 Generated with Claude Code