Repository navigation
Consolidate integration tests to single emulator/simulator sessions - #24
Merged
jappeace merged 8 commits intoApr 6, 2026
Merged
Conversation
Previously each integration test (lifecycle, UI, buttons, scroll) booted its own emulator or simulator, creating 4 separate boot/teardown cycles per platform with 3-15 minutes overhead each. Changes: - Add nix/emulator-all.nix: single Android emulator session covering lifecycle + UI rendering + two-button sequence + scroll demo in one boot cycle. Generates /bin/test-all. - Add nix/simulator-all.nix: single iOS simulator session covering all the same suites. Generates /bin/test-all-ios. - nix/ci.nix: replace 8 individual emulator/simulator test attrs with emulator-all-test (Android) and ios (simulator-all). Rename old ios attr to ios-lib for artifact upload. - .github/workflows/ci.yaml: collapse 4 jobs (android, ios, android-ui-buttons, ios-ui-buttons) into 2 jobs running nix-build nix/ci.nix. Old per-suite nix files are kept for local debugging. Prompt: Implement the plan to consolidate integration tests to single emulator/simulator sessions. Tokens: ~18k input, ~8k output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
runTest uses __noChroot = true which is forbidden when sandbox = true on GitHub Actions runners. The existing tests always ran scripts manually outside nix (nix-build ... -o result && ./result/bin/script). Match that same pattern for the consolidated tests. Changes: - nix/ci.nix: remove runTest wrapper; expose emulator-all and simulator-all as plain build-script derivations - .github/workflows/ci.yaml: explicit per-attr nix-builds + manual script execution for both android and ios jobs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace stream log polling for 'Click dispatched: callbackId=0' with a sleep-then-log-show approach. The --autotest auto-tap fires 3s after render; we now wait 15s (generous buffer) then read from the persistent OS log store via 'xcrun simctl spawn ... log show --start PHASE2_START'. This mirrors Phase 1c's successful log show pattern and avoids the stream log buffering issue that caused the Phase 2 failure in CI run 24030949525. Prompt: continue fixing iOS Phase 2 scroll click detection failure Tokens: ~12k Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace 400+ lines of inline Nix test bash with plain scripts that assume a
running emulator/simulator and receive env vars from the harness. Each script
covers one suite (lifecycle, ui, buttons, scroll) and can be read/edited without
Nix knowledge or run in isolation.
Changes:
- test/android/helpers.sh: install_apk, wait_for_logcat, tap_button, assert_logcat
- test/android/lifecycle.sh, ui.sh, buttons.sh, scroll.sh: suite scripts
- test/ios/helpers.sh: wait_for_log, assert_log, get_full_log
- test/ios/lifecycle.sh, ui.sh, buttons.sh, scroll.sh: suite scripts
- nix/emulator-all.nix: add testScripts binding, replace inline phases with 4 bash invocations
- nix/simulator-all.nix: same for iOS
- nix/lib.nix: remove mkEmulatorTest/mkSimulatorTest (superseded), remove emulator infra
- Delete nix/emulator{,-ui,-ui-buttons,-scroll}.nix and nix/simulator{,-ui,-ui-buttons,-scroll}.nix
Prompt: Extract test logic into bash scripts, Nix as harness (Option A)
Tokens: ~80k
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The fixed 15s sleep after detecting setRoot wasn't always long enough for 'Click dispatched' to appear in the persistent log store. Replace with an active poll (up to 30s) for 'Click dispatched' in the stream log, followed by a 5s buffer before retrieving the persistent log. This matches how the buttons test already polls for its terminal event. Tokens: ~5k Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Android: nix-build nix/ci.nix (builds all Linux attrs) iOS: nix-build nix/ci.nix -A simulator-all -A ios-lib Removes the separate build+run steps for emulator/simulator tests. Tokens: ~2k Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Android: nix-build ci.nix, then nix-build -A emulator-all -o result && run iOS: nix-build -A simulator-all -A ios-lib, then nix-build -A simulator-all -o result && run The second nix-build is instant since the store entry is already cached. Tokens: ~2k Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The --autotest flag calls HaskellBridge.onUIEvent(0) directly, bypassing the ObjC IOSBridgeHandler.handleTap: method where 'Click dispatched' was logged. Add os_log in HaskellBridge.onUIEvent so the message is emitted for both --autotest and physical UIButton taps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
nix/emulator-all.nix: single Android emulator boot covering lifecycle + UI rendering + two-button sequence + scroll demo (Phase 1 & 2). Generates/bin/test-all.nix/simulator-all.nix: single iOS simulator boot covering the same suites. Generates/bin/test-all-ios.nix/ci.nix: replace 8 individual test attrs withemulator-all-test+ios; rename oldiostoios-libfor artifact upload..github/workflows/ci.yaml: collapse 4 jobs into 2 (android,ios) each runningnix-build nix/ci.nix. Old per-suite.nixfiles kept for local debugging.Motivation
Previously each integration test booted its own emulator/simulator (4× per platform), incurring 3–15 min overhead per boot cycle. This consolidation halves the number of CI jobs and reduces total boot time from ~4× to ~1× per platform.
Test plan
nix-build nix/ci.nixpasses on Linux (builds + runs emulator-all-test)nix-build nix/ci.nix -A iospasses on macOS (builds + runs simulator-all-test)🤖 Generated with Claude Code