Skip to content

Commit 4e43592

Browse files
committed
Capture failures
1 parent 30cf253 commit 4e43592

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
@@ -121,8 +121,11 @@ jobs:
121121
fi
122122
adb shell input keyevent 82
123123
adb shell settings put global window_animation_scale 0.0
124-
adb shell settings put global transition_animation_scale 0.0
125124
adb shell settings put global animator_duration_scale 0.0
125+
# transition_animation_scale is left alone on purpose: Reanimated
126+
# reports reduced motion when it is 0, which finishes every withTiming
127+
# in a single frame.
128+
adb shell settings put system show_touches 1
126129
SERIAL=$(adb devices | awk 'NR>1 && $2=="device"{print $1; exit}')
127130
echo "Emulator ready: $SERIAL"
128131
echo "ANDROID_SERIAL=$SERIAL" >> "$GITHUB_ENV"
@@ -143,13 +146,52 @@ jobs:
143146
with:
144147
simulator-server-log: debug
145148

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

149-
- name: Print emulator log
150-
if: ${{ !success() }}
151-
run: cat emulator.log 2>/dev/null || echo "no emulator.log"
166+
- name: Stop screen recording
167+
if: ${{ always() }}
168+
run: |
169+
kill "${SCREENRECORD_PID:-}" 2>/dev/null || true
170+
# SIGINT is what makes screenrecord write the mp4 trailer; killed any
171+
# other way, the last segment is unplayable.
172+
adb shell pkill -INT screenrecord || true
173+
for _ in $(seq 1 15); do
174+
adb shell pgrep screenrecord > /dev/null 2>&1 || break
175+
sleep 1
176+
done
177+
mkdir -p "$RUNNER_TEMP/e2e-debug/recordings"
178+
for f in $(adb shell 'ls /sdcard/rec-*.mp4' 2>/dev/null | tr -d '\r'); do
179+
adb pull "$f" "$RUNNER_TEMP/e2e-debug/recordings" || true
180+
done
152181
153-
- name: Print Argent tool-server log
182+
- name: Collect logs
183+
if: ${{ always() }}
184+
run: |
185+
mkdir -p "$RUNNER_TEMP/e2e-debug/logs"
186+
for f in emulator.log screenrecord.log "${ARGENT_SERVER_LOG:-}"; do
187+
cp "$f" "$RUNNER_TEMP/e2e-debug/logs" 2>/dev/null || true
188+
done
189+
ls -lR "$RUNNER_TEMP/e2e-debug"
190+
191+
- name: Upload logs and screen recording
154192
if: ${{ !success() }}
155-
run: cat "$ARGENT_SERVER_LOG" 2>/dev/null || echo "no Argent tool-server log"
193+
uses: actions/upload-artifact@v4
194+
with:
195+
name: e2e-android-debug-${{ inputs.artifact-name }}
196+
path: ${{ runner.temp }}/e2e-debug/
197+
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)