Skip to content

Commit 52ffbcc

Browse files
committed
Capture failures
1 parent 53ba0cb commit 52ffbcc

4 files changed

Lines changed: 111 additions & 11 deletions

File tree

‎.github/actions/argent-server/action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Start Argent tool-server
22
description: >-
33
Installs the Argent CLI and starts a tool-server for later steps and
4-
ARGENT_SERVER_LOG for the caller to print on failure.
4+
ARGENT_SERVER_LOG for the caller to collect on failure.
55
66
inputs:
77
port:
@@ -37,7 +37,7 @@ runs:
3737
SIMULATOR_SERVER_LOG: ${{ inputs.simulator-server-log }}
3838
run: |
3939
LOG="$RUNNER_TEMP/argent-server.log"
40-
# Exported before anything can fail, so the caller's log-printing step
40+
# Exported before anything can fail, so the caller's log-collecting step
4141
# can find it even when startup is what went wrong.
4242
echo "ARGENT_SERVER_LOG=$LOG" >> "$GITHUB_ENV"
4343

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

Lines changed: 48 additions & 6 deletions
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,16 +149,55 @@ 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

152-
- name: Print emulator log
153-
if: ${{ !success() }}
154-
run: cat emulator.log 2>/dev/null || echo "no emulator.log"
169+
- name: Stop screen recording
170+
if: ${{ always() }}
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/e2e-debug/recordings"
181+
for f in $(adb shell 'ls /sdcard/rec-*.mp4' 2>/dev/null | tr -d '\r'); do
182+
adb pull "$f" "$RUNNER_TEMP/e2e-debug/recordings" || true
183+
done
155184
156185
# The tool-server log also carries the device backend's stderr
157186
# (`[sim <serial>]` lines), where a failed connection to the emulator is
158187
# explained.
159-
- name: Print Argent tool-server log
188+
- name: Collect logs
189+
if: ${{ always() }}
190+
run: |
191+
mkdir -p "$RUNNER_TEMP/e2e-debug/logs"
192+
for f in emulator.log screenrecord.log "${ARGENT_SERVER_LOG:-}"; do
193+
cp "$f" "$RUNNER_TEMP/e2e-debug/logs" 2>/dev/null || true
194+
done
195+
ls -lR "$RUNNER_TEMP/e2e-debug"
196+
197+
- name: Upload logs and screen recording
160198
if: ${{ !success() }}
161-
run: cat "$ARGENT_SERVER_LOG" 2>/dev/null || echo "no Argent tool-server log"
199+
uses: actions/upload-artifact@v4
200+
with:
201+
name: e2e-android-debug-${{ inputs.artifact-name }}
202+
path: ${{ runner.temp }}/e2e-debug/
203+
if-no-files-found: ignore

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

Lines changed: 60 additions & 2 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"
@@ -82,12 +102,50 @@ jobs:
82102
- name: Install Argent and start the tool-server
83103
uses: ./.github/actions/argent-server
84104

105+
# h264 rather than the default hevc, which most browsers cannot play.
106+
- name: Start screen recording
107+
run: |
108+
mkdir -p "$RUNNER_TEMP/e2e-debug/recordings"
109+
nohup xcrun simctl io "$SIMULATOR_UDID" recordVideo --codec h264 --force \
110+
"$RUNNER_TEMP/e2e-debug/recordings/rec.mp4" > recordvideo.log 2>&1 &
111+
echo "RECORDING_PID=$!" >> "$GITHUB_ENV"
112+
# simctl only records from the first processed frame, which it
113+
# announces; without the wait the tests start before the recording.
114+
for _ in $(seq 1 30); do
115+
if grep -q "Recording started" recordvideo.log 2>/dev/null; then break; fi
116+
sleep 1
117+
done
118+
85119
- name: Run E2E tests
86120
run: argent flow run ./.argent/flows --device $SIMULATOR_UDID
87121

122+
- name: Stop screen recording
123+
if: ${{ always() }}
124+
run: |
125+
# SIGINT is what makes recordVideo write the mp4 trailer; killed any
126+
# other way, the file is unplayable.
127+
kill -INT "${RECORDING_PID:-}" 2>/dev/null || true
128+
for _ in $(seq 1 15); do
129+
kill -0 "${RECORDING_PID:-}" 2>/dev/null || break
130+
sleep 1
131+
done
132+
88133
# The tool-server log also carries the device backend's stderr
89134
# (`[sim <udid>]` lines), where a failed connection to the simulator is
90135
# explained.
91-
- name: Print Argent tool-server log
136+
- name: Collect logs
137+
if: ${{ always() }}
138+
run: |
139+
mkdir -p "$RUNNER_TEMP/e2e-debug/logs"
140+
for f in recordvideo.log "${ARGENT_SERVER_LOG:-}"; do
141+
cp "$f" "$RUNNER_TEMP/e2e-debug/logs" 2>/dev/null || true
142+
done
143+
ls -lR "$RUNNER_TEMP/e2e-debug"
144+
145+
- name: Upload logs and screen recording
92146
if: ${{ !success() }}
93-
run: cat "$ARGENT_SERVER_LOG" 2>/dev/null || echo "no Argent tool-server log"
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: e2e-ios-debug-${{ inputs.artifact-name }}
150+
path: ${{ runner.temp }}/e2e-debug/
151+
if-no-files-found: ignore

‎.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)