Repository navigation
test(cli): add opt-in live Flutter end-to-end test - #80
Merged
Merged
Conversation
Exercise the real doctor/init/evidence flow against a Flutter project created by the local Flutter SDK, plus a live Dart MCP initialize and tools/list handshake. The test asserts init is idempotent, evidence stays outside the project with secrets redacted, and the real home is never touched. Gated on PICKFORGE_LIVE_FLUTTER=1 and skipped without flutter/dart on PATH, so CI and the default suite stay hermetic.
This was referenced Sep 3, 2026
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.
Why
The Rust suite is hermetic: every existing test fakes the Flutter project, the
tools on
PATH, and the MCP server. Nothing in CI has ever proven thatpickforgeworks against a real Flutter SDK, a realdart mcp-server, or aproject that
flutter createactually produced. This adds that check as anopt-in local test, so the hermetic suite stays fast and CI stays unchanged.
What
crates/pickforge-cli/tests/live_flutter.rs, one test gated onPICKFORGE_LIVE_FLUTTER=1. Without the env var, or withoutflutteranddartonPATH, it prints why and returns. It is Unix-only (#![cfg(unix)]).When it runs it:
flutter create --offline --platforms=linux,falling back to a two-file minimal project only if that fails, and logs which
path it took;
pickforge doctor --jsonand assertsready,framework == "flutter",and that the reported state dir is inside the isolated
PICKFORGE_HOME;init --harness claude-code --harness codex --harness pi --mobile-integration-alpha --dry-runand asserts the plan writes nothing;entries, their per-harness arguments, and both managed skill files;
dart mcp-serverfor real and completes aninitializeplustools/listhandshake over stdio;changed == falsewith byte-identical files;under
PICKFORGE_HOME, never in the project, with the secret absent fromboth
evidence.jsonandreport.mdand the copied screenshot hash intact;$HOMEpaths (.pickforge,.claude,.codex,.pi, config files, and the project's real state dir) before and after, andfails if any changed.
Everything runs in a
TempDirwithHOME,USERPROFILE,XDG_*andPICKFORGE_HOMEredirected. Child processes are spawned in their own processgroup and killed on drop, and every step has a deadline under a 300s budget.
One detail worth flagging: the isolated
HOMEalso moves the pub cache, so anoffline resolve would always miss and the fixture would silently degrade to the
minimal fallback.
PUB_CACHEfrom the real environment is passed toflutter createonly, never to the CLI under test.Also updates
AGENTS.mdanddocs/releases/UNRELEASED.md.How to run
How it was verified
Rebased onto
origin/mainat ea42c24 first. All commands run from the branch:cargo fmt --all --check— clean.cargo clippy --workspace --all-targets --locked -- -D warnings— clean(clippy 0.1.96).
cargo test --workspace --locked— 84 passed, 0 failed, 0 ignored.PICKFORGE_LIVE_FLUTTER=1 cargo test -p pickforge-cli --test live_flutter -- --nocapture— 1 passed. It logged
live Flutter fixture: flutter create --offline, so itused a real Flutter project, not the minimal fallback. Flutter 3.41.6
stable, Dart from the same SDK, Linux.
Rebasing surfaced a real break: #78 made
evidence recorddecode artifacts, andthe test's hand-written 1x1 PNG had a bad IDAT CRC, so the first live run failed
with
could not decode image. The fixture now encodes a real PNG with theimagecrate, matchingtests/evidence.rs.Not verified
#![cfg(unix)]; nobody has run it off Linux.job time is unchanged. It is a local, opt-in check by design.
flutter createsucceeded here, the minimalfixture path was never exercised.
tools/liston the MCP server: no tool is actually called,and no app is built, run or hot-reloaded.