Repository navigation
fix(workspace): isolate host and device integration test roots - #141
Closed
shroominic wants to merge 1 commit into
Closed
shroominic wants to merge 1 commit into
shroominic wants to merge 1 commit into
Conversation
`make test-integration` handed `test/integration/*` and `integration_test/*` to one `flutter test` call, which Flutter rejects: Integration tests and unit tests cannot be run in a single invocation. The two roots now run as separate lanes. The host lane keeps its behaviour (`test/integration/*` plus tag-marked files, and `integration_test/*` for plain Dart packages). The device lane runs `integration_test/*` in its own invocation and only against hardware named by `FLUTTER_TEST_DEVICE_ID`; otherwise it reports the deferred files and the knob that enables them, so a host without a device stays green instead of failing closed on a lane it cannot run. Adds scripts/test-workspace-integration-runner.rb, which drives the real script against a fixture repository with stubbed Flutter tooling and pins the lane split, the deferral notice, the device-id plumbing, and the existing nothing-found diagnostic. The check runs from `make tooling-check`.
This was referenced Sep 18, 2026
Open
Owner
Author
|
Carried by the GS1 consolidation in PR #209 (branch feature/cbio-gs1, head 3eca4f4). This PR is contained in the consolidated line; the merge that carries it is 5f41ba9. Closing as subsumed by the consolidation - not as won't fix. The per-defect evidence stays in this thread, and the carrying commit above is where the change now lives. |
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.
Fixes #140.
What was wrong
scripts/flutter-workspace.shcollectedtest/integration/*andintegration_test/*into one argument list and handed both to a singleflutter testcall. Flutter rejects that mix, somake test-integrationexited2 on any tree that contains an
openhealth/integration_test/directory:The runner is unchanged from
main; the target only went red once the sensorlanes added the device-backed root.
What changed
Two lanes, discovered and run separately:
test/integration/*plus tag-marked files, unchanged behaviour.Plain Dart packages keep
integration_test/*as an ordinary test root, sincethe device concept only exists for Flutter projects.
integration_test/*in its ownflutter testinvocation. Thoseharnesses are device-backed, so they run with
--device-id <id>whenFLUTTER_TEST_DEVICE_IDis set, and are otherwise reported as deferred nextto the variable that enables them. A host without a device no longer fails
closed on a lane it cannot run.
Decision recorded (non-blocking)
The defect is that one invocation mixed the roots. The minimal correct
equivalent has to also stop a device-less host from treating device-backed
harnesses as runnable: with only the split,
make test-integrationwould movefrom "mixed invocation" to "no device found" and CI would stay red for the same
trees. The device lane is therefore explicit and opt-in through
FLUTTER_TEST_DEVICE_ID, and it never goes quiet: the deferral message nameseach file and the knob. CI (
ubuntu-latest, no hardware) is green; a developerwith a phone runs the same target with the variable set.
Tests
New
scripts/test-workspace-integration-runner.rbdrives the real scriptagainst a fixture repository with stubbed Flutter tooling, so it runs anywhere.
It was written first and failed against the unmodified script (the stub recorded
flutter test --no-pub integration_test/device_test.dart test/integration/demo_test.dart);it passes after the change. It pins: no invocation mixes the roots, the host
lane runs exactly once, the device lane is deferred without
FLUTTER_TEST_DEVICE_ID, the device lane targets the named device when it isset, host-only trees keep the single-invocation shape, and the existing
nothing-found diagnostic still fails closed. It runs from
make tooling-check.Verification (this branch, plus a throwaway
integration_test/fixture)make test-integration(both roots present)All tests passed!, device lane deferred with the enabling variable namedmake test-integration(fixture removed, as onmain)make test-unitmake lintmake format-checkmake tooling-checkImpact
Unblocks the red
make test-integrationCI on the sensor aggregates #128(
release/v0.3.0) and #139 (release/v0.4.0), and on any lane that adds8000 openhealth/integration_test/. No lane branch is modified by this PR.