-
Notifications
You must be signed in to change notification settings - Fork 473
test(expo): maestro improvements #9716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+279
−155
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
62b336a
test(expo): keep maestro reports and debug output from every run
wobsoriano 4f1a9dd
Merge branch 'main' into rob/maestro-ci-hardening
wobsoriano 6bfa52a
ci(e2e): split the maestro flows across two devices per job
wobsoriano 02345a6
test(expo): fold the restart check into the sign-in flow
wobsoriano 547927e
ci(e2e): fail the maestro run on any first-attempt flow failure
wobsoriano 1a267f0
test(expo): report the sign-out outcome in the fixture
wobsoriano ba99797
ci(e2e): bound the iOS simulator boot wait
wobsoriano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/usr/bin/env bash | ||
| # Boots N simulators of one model on the newest installed iOS runtime and | ||
| # configures each for Maestro. `boot` returns as soon as the boots are issued | ||
| # so they overlap the native build; `wait` blocks until every one is usable. | ||
| # | ||
| # Usage: ./boot-ios-simulators.sh boot <count> [model] # exports MAESTRO_UDID | ||
| # ./boot-ios-simulators.sh wait # reads MAESTRO_UDID | ||
| set -euo pipefail | ||
|
|
||
| boot() { | ||
| local count=$1 model=${2:-iPhone 17 Pro} | ||
| local runtime device_type udids=() i | ||
| # The runtime matching the SDK the app was built with, so a newer beta | ||
| # runtime installed on the runner does not change the OS under test. | ||
| sdk=$(xcrun --sdk iphonesimulator --show-sdk-version) | ||
| runtime=$(xcrun simctl list runtimes available -j | jq -r --arg v "$sdk" \ | ||
| '[.runtimes[] | select(.platform == "iOS")] | (map(select(.version == $v)) + .) | first | .identifier') | ||
| device_type=$(xcrun simctl list devicetypes -j | jq -r --arg m "$model" '.devicetypes[] | select(.name == $m) | .identifier') | ||
| for i in $(seq 1 "$count"); do | ||
| udids+=("$(xcrun simctl create "$model $i" "$device_type" "$runtime")") | ||
| xcrun simctl boot "${udids[$((i - 1))]}" | ||
| done | ||
| MAESTRO_UDID=$(IFS=,; echo "${udids[*]}") | ||
| echo "Booting $count x $model on $runtime: $MAESTRO_UDID" | ||
| if [ -n "${GITHUB_ENV:-}" ]; then echo "MAESTRO_UDID=$MAESTRO_UDID" >> "$GITHUB_ENV"; fi | ||
| } | ||
|
|
||
| wait_ready() { | ||
| local udid key | ||
| IFS=, read -r -a udids <<< "${MAESTRO_UDID:?MAESTRO_UDID is required}" | ||
| for udid in "${udids[@]}"; do | ||
| # bootstatus blocks with no deadline of its own; a simulator that never | ||
| # finishes booting would otherwise hold the job until its timeout. | ||
| xcrun simctl bootstatus "$udid" -b & | ||
| local pid=$! elapsed=0 | ||
| while kill -0 "$pid" 2>/dev/null; do | ||
| if [ "$elapsed" -ge 240 ]; then | ||
| kill "$pid" 2>/dev/null || true | ||
| wait "$pid" 2>/dev/null || true | ||
| echo "::error::$udid did not finish booting within ${elapsed}s" | ||
| xcrun simctl list devices -j | jq -r --arg u "$udid" '.devices[][] | select(.udid == $u) | "\(.name): \(.state)"' | ||
| return 1 | ||
| fi | ||
| sleep 5 | ||
| elapsed=$((elapsed + 5)) | ||
| done | ||
| wait "$pid" | ||
| # Kill animations + predictive keyboard: animations add latency to every | ||
| # tap; predictive text hijacks inputText targets. | ||
| xcrun simctl spawn "$udid" defaults write com.apple.UIKit UIAnimationDragCoefficient -float 0.01 || true | ||
| xcrun simctl spawn "$udid" defaults write -g ApplePersistenceIgnoreState -bool YES || true | ||
| xcrun simctl spawn "$udid" defaults write com.apple.keyboard.ContinuousPath -bool NO || true | ||
| xcrun simctl spawn "$udid" defaults write com.apple.keyboard.AutoCapitalization -bool NO || true | ||
| xcrun simctl spawn "$udid" defaults write com.apple.keyboard.AutoCorrection -bool NO || true | ||
| xcrun simctl spawn "$udid" defaults write com.apple.keyboard.Prediction -bool NO || true | ||
| # The one-time keyboard tutorial sheets carry their own Continue button, | ||
| # which can hijack taps on the AuthView's Continue. | ||
| for key in DidShowContinuousPathIntroduction DidShowGestureKeyboardIntroduction KeyboardDidShowProductivityTutorial UIKeyboardDidShowInternationalInfoIntroduction; do | ||
| xcrun simctl spawn "$udid" defaults write com.apple.keyboard.preferences "$key" -bool YES || true | ||
| done | ||
| done | ||
| } | ||
|
|
||
| case "${1:-}" in | ||
| boot) boot "${2:?count is required}" "${3:-}" ;; | ||
| wait) wait_ready ;; | ||
| *) echo "usage: $0 boot <count> [model] | wait" >&2; exit 2 ;; | ||
| esac | ||
22 changes: 0 additions & 22 deletions
22
integration/tests/expo-native/flows/session-persists-across-restart.yaml
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,22 @@ | ||
| # Native AuthView email+password sign-in, asserting the native->JS session | ||
| # sync, then JS-side sign-out asserting the reverse direction. | ||
| # sync; then a restart WITHOUT clearing state, asserting the session is | ||
| # restored from secure-store with no re-auth (bridge + token cache | ||
| # persistence); then JS-side sign-out asserting the reverse direction. | ||
| appId: com.clerk.exponativebuildfixture | ||
| name: Native AuthView sign-in syncs to JS | ||
| name: Native AuthView sign-in syncs to JS and survives a restart | ||
| --- | ||
| - runFlow: subflows/open-app.yaml | ||
| - tapOn: | ||
| id: 'open-auth-view-button' | ||
| - runFlow: subflows/sign-in-email-password.yaml | ||
| - runFlow: subflows/assert-signed-in.yaml | ||
| - stopApp | ||
| - launchApp | ||
| - extendedWaitUntil: | ||
| visible: 'signed in' | ||
| timeout: 45000 | ||
| - assertVisible: | ||
| id: 'user-id' | ||
| - tapOn: | ||
| id: 'sign-out-button' | ||
| - runFlow: subflows/assert-signed-out.yaml |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.