Skip to content

Commit c07fbdf

Browse files
committed
temp: try to figure out failure
1 parent 678984f commit c07fbdf

3 files changed

Lines changed: 120 additions & 2 deletions

File tree

‎.github/workflows/android-e2e.yml‎

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ jobs:
123123
fi
124124
adb shell input keyevent 82
125125
adb shell settings put global window_animation_scale 0.0
126-
adb shell settings put global transition_animation_scale 0.0
127126
adb shell settings put global animator_duration_scale 0.0
127+
# transition_animation_scale is left alone on purpose: Reanimated
128+
# reports reduced motion when it is 0, which finishes every withTiming
129+
# in a single frame.
130+
adb shell settings put system show_touches 1
128131
SERIAL=$(adb devices | awk 'NR>1 && $2=="device"{print $1; exit}')
129132
echo "Emulator ready: $SERIAL"
130133
echo "ANDROID_SERIAL=$SERIAL" >> "$GITHUB_ENV"
@@ -146,9 +149,49 @@ jobs:
146149
# Logs how the backend discovers the emulator; drop once this is green.
147150
simulator-server-log: debug
148151

152+
# `screenrecord` stops on its own after 3 minutes, so record in segments
153+
# until the stop step interrupts it.
154+
- name: Start screen recording
155+
run: |
156+
adb shell 'rm -f /sdcard/rec-*.mp4'
157+
nohup bash -c '
158+
i=0
159+
while adb shell screenrecord --bit-rate 2000000 --time-limit 180 \
160+
"/sdcard/rec-$(printf %03d "$i").mp4"; do
161+
i=$((i + 1))
162+
done
163+
' > screenrecord.log 2>&1 &
164+
echo "SCREENRECORD_PID=$!" >> "$GITHUB_ENV"
165+
149166
- name: Run E2E tests
150167
run: argent flow run ./.argent/flows --device "$ANDROID_SERIAL"
151168

169+
- name: Stop screen recording
170+
if: ${{ !success() }}
171+
run: |
172+
kill "${SCREENRECORD_PID:-}" 2>/dev/null || true
173+
# SIGINT is what makes screenrecord write the mp4 trailer; killed any
174+
# other way, the last segment is unplayable.
175+
adb shell pkill -INT screenrecord || true
176+
for _ in $(seq 1 15); do
177+
adb shell pgrep screenrecord > /dev/null 2>&1 || break
178+
sleep 1
179+
done
180+
mkdir -p "$RUNNER_TEMP/recordings"
181+
for f in $(adb shell 'ls /sdcard/rec-*.mp4' 2>/dev/null | tr -d '\r'); do
182+
adb pull "$f" "$RUNNER_TEMP/recordings" || true
183+
done
184+
ls -la "$RUNNER_TEMP/recordings"
185+
cat screenrecord.log 2>/dev/null || true
186+
187+
- name: Upload screen recording
188+
if: ${{ !success() }}
189+
uses: actions/upload-artifact@v4
190+
with:
191+
name: e2e-android-recording-${{ inputs.artifact-name }}
192+
path: ${{ runner.temp }}/recordings/
193+
if-no-files-found: ignore
194+
152195
- name: Print emulator log
153196
if: ${{ !success() }}
154197
run: cat emulator.log 2>/dev/null || echo "no emulator.log"

‎.github/workflows/ios-e2e.yml‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,26 @@ jobs:
7474
xcrun simctl bootstatus "$UDID"
7575
echo "SIMULATOR_UDID=$UDID" >> "$GITHUB_ENV"
7676
77+
- name: Disable keyboard intelligence on the simulator
78+
run: |
79+
KEYS=(
80+
KeyboardPrediction
81+
KeyboardAutocorrection
82+
KeyboardCheckSpelling
83+
KeyboardAutocapitalization
84+
KeyboardPeriodShortcut
85+
KeyboardCapsLock
86+
KeyboardContinuousPathEnabled
87+
)
88+
for key in "${KEYS[@]}"; do
89+
xcrun simctl spawn "$SIMULATOR_UDID" defaults write "Apple Global Domain" "$key" -bool false
90+
xcrun simctl spawn "$SIMULATOR_UDID" defaults write com.apple.Preferences "$key" -bool false
91+
done
92+
# Suppress the slide-to-type intro overlay a fresh sim shows on first keyboard use
93+
xcrun simctl spawn "$SIMULATOR_UDID" defaults write com.apple.keyboard.preferences \
94+
DidShowContinuousPathIntroduction -bool true
95+
xcrun simctl spawn "$SIMULATOR_UDID" defaults read "Apple Global Domain" | grep Keyboard || true
96+
7797
- name: Install app on simulator
7898
run: |
7999
echo "Installing $APP_PATH on $SIMULATOR_UDID"
@@ -85,6 +105,61 @@ jobs:
85105
- name: Run E2E tests
86106
run: argent flow run ./.argent/flows --device $SIMULATOR_UDID
87107

108+
# Interpreting the artifacts:
109+
# - screen.png taken first, closest to the failure state (software keyboard
110+
# still visible = the dismissal never completed).
111+
# - probe-flow.txt distinguishes wedged from recovered: "ViewInspector RPC
112+
# timed out" = the app STILL cannot serve a main-thread read minutes after
113+
# the failure (true wedge); a plain "not visible" assert failure = the
114+
# tree was readable again (bounded stall that recovered).
115+
# - sample-app.txt runs WHILE the probe is in flight, so a wedged main
116+
# thread is caught parked in the culprit frames.
117+
# - spindump-system.txt covers the XPC peers (keyboard daemon, backboardd)
118+
# in case main is waiting on another process.
119+
- name: Capture app diagnostics
120+
if: ${{ !success() }}
121+
run: |
122+
DIAG="$RUNNER_TEMP/diagnostics"
123+
mkdir -p "$DIAG"
124+
125+
xcrun simctl io "$SIMULATOR_UDID" screenshot "$DIAG/screen.png" || true
126+
127+
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$APP_PATH/Info.plist")
128+
PID=$(xcrun simctl spawn "$SIMULATOR_UDID" launchctl list 2>/dev/null \
129+
| awk -v label="UIKitApplication:$BUNDLE_ID" '$3 ~ label {print $1}' | head -1)
130+
131+
# One-step throwaway flow: reads the UI tree through the same
132+
# native-devtools path the real flows use. The assert is expected to
133+
# fail either way; only the failure REASON matters (see above).
134+
mkdir -p "$RUNNER_TEMP/probe-flow"
135+
cat > "$RUNNER_TEMP/probe-flow/probe.yaml" <<'EOF'
136+
steps:
137+
- assert: { visible: "argent-diagnostic-probe-nonexistent" }
138+
EOF
139+
140+
if [ -n "$PID" ] && [ "$PID" != "-" ]; then
141+
echo "Sampling $BUNDLE_ID (pid $PID) while probing the UI tree"
142+
sample "$PID" 15 -file "$DIAG/sample-app.txt" &
143+
SAMPLE_JOB=$!
144+
argent flow run "$RUNNER_TEMP/probe-flow" --device "$SIMULATOR_UDID" \
145+
2>&1 | tee "$DIAG/probe-flow.txt" || true
146+
wait "$SAMPLE_JOB" || true
147+
else
148+
echo "$BUNDLE_ID is not running; nothing to sample" | tee "$DIAG/app-not-running.txt"
149+
argent flow run "$RUNNER_TEMP/probe-flow" --device "$SIMULATOR_UDID" \
150+
2>&1 | tee "$DIAG/probe-flow.txt" || true
151+
fi
152+
153+
sudo spindump -notarget 5 20 -file "$DIAG/spindump-system.txt" || true
154+
155+
- name: Upload diagnostics
156+
if: ${{ !success() }}
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: e2e-ios-diagnostics-${{ inputs.artifact-name }}
160+
path: ${{ runner.temp }}/diagnostics/
161+
if-no-files-found: ignore
162+
88163
# The tool-server log also carries the device backend's stderr
89164
# (`[sim <udid>]` lines), where a failed connection to the simulator is
90165
# explained.

‎.github/workflows/ios.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
# simulator runtime matches the SDK.
4444
- name: Pin versions
4545
id: versions
46-
run: echo "xcode=26.4.1" >> "$GITHUB_OUTPUT"
46+
run: echo "xcode=26.6" >> "$GITHUB_OUTPUT"
4747

4848
expo-example:
4949
if: github.repository == 'software-mansion/react-native-gesture-handler'

0 commit comments

Comments
 (0)