Skip to content

Commit 7e0f576

Browse files
committed
Print log, move server start android
1 parent 085d4c1 commit 7e0f576

2 files changed

Lines changed: 29 additions & 32 deletions

File tree

.github/workflows/android-e2e.yml

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,6 @@ jobs:
5858
sudo udevadm control --reload-rules
5959
sudo udevadm trigger --name-match=kvm
6060
61-
# Start the tool-server out-of-band and hand `flow run` its URL, so it
62-
# reuses this server instead of spawning one in-process and hitting the
63-
# hard ~15s startup timeout on cold CI runners. The `/tools` endpoint is
64-
# ready without a device attached, so we can start it before the emulator
65-
# boots; the background process persists across steps and the emulator
66-
# step below inherits ARGENT_TOOLS_URL via $GITHUB_ENV.
67-
#
68-
# `server start --detach` can fail to return on CI (its parent keeps the
69-
# child's stdout pipe referenced), so background it with output redirected
70-
# to a file — never the runner's pipe — and poll the port for readiness
71-
# ourselves.
72-
- name: Start Argent tool-server
73-
run: |
74-
nohup argent server start --detach --no-auth --port 3001 \
75-
> argent-server.log 2>&1 &
76-
echo "Waiting for Argent tool-server on :3001..."
77-
for i in $(seq 1 60); do
78-
if curl -fsS http://127.0.0.1:3001/tools >/dev/null 2>&1; then
79-
echo "tool-server is ready"
80-
echo "ARGENT_TOOLS_URL=http://127.0.0.1:3001" >> "$GITHUB_ENV"
81-
exit 0
82-
fi
83-
sleep 2
84-
done
85-
echo "Argent tool-server failed to become ready in time" >&2
86-
cat argent-server.log >&2
87-
exit 1
88-
8961
- name: Set up emulator and run tap E2E test
9062
uses: reactivecircus/android-emulator-runner@v2
9163
with:
@@ -96,8 +68,26 @@ jobs:
9668
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
9769
disable-animations: true
9870
# android-emulator-runner runs each line of `script` as a separate
99-
# `sh -c`, so variables don't persist between lines and multi-line
100-
# constructs (if/fi) break. Keep every command self-contained on one line.
71+
# `sh -c`, so exported vars don't persist between lines and multi-line
72+
# constructs (if/fi) break. Keep every command self-contained on one
73+
# line and pass ARGENT_TOOLS_URL inline.
74+
#
75+
# Start the tool-server HERE (not in an earlier step) so the
76+
# simulator-server it spawns inherits this action's HOME, adb, and SDK
77+
# env. That backend discovers the emulator's gRPC endpoint from
78+
# $HOME/.android/avd/running/*.ini and shells out to adb, so it must
79+
# share the emulator's exact environment. Backgrounded with our own
80+
# readiness poll to dodge flow-run's hard ~15s in-process startup
81+
# timeout; the process persists after its launching `sh -c` exits.
10182
script: |
102-
adb install -r "$(find apps/expo-example/android/app/build/outputs/apk/release -name '*.apk' | head -1)"
103-
argent flow run simple-tap-test --device "$(adb devices | awk 'NR>1 && $2=="device"{print $1; exit}')"
83+
nohup argent server start --detach --no-auth --port 3001 > "$GITHUB_WORKSPACE/argent-server.log" 2>&1 &
84+
for i in $(seq 1 60); do curl -fsS http://127.0.0.1:3001/tools >/dev/null 2>&1 && break; sleep 2; done
85+
adb install -r "$(find "$GITHUB_WORKSPACE/apps/expo-example/android/app/build/outputs/apk/release" -name '*.apk' | head -1)"
86+
ARGENT_TOOLS_URL=http://127.0.0.1:3001 argent flow run simple-tap-test --device "$(adb devices | awk 'NR>1 && $2=="device"{print $1; exit}')"
87+
88+
# The simulator-server's stderr (prefixed `[sim <udid>]`) is written to the
89+
# tool-server log — this is where a "simulator-server exited before ready"
90+
# crash reason shows up. Always print it so failures are diagnosable.
91+
- name: Print Argent tool-server log
92+
if: always()
93+
run: cat argent-server.log 2>/dev/null || echo "no argent-server.log"

.github/workflows/ios-e2e.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,10 @@ jobs:
113113
114114
- name: Run tap E2E test
115115
run: argent flow run simple-tap-test --device $SIMULATOR_UDID
116+
117+
# The simulator-server's stderr (prefixed `[sim <udid>]`) is written to the
118+
# tool-server log — this is where a "simulator-server exited before ready"
119+
# crash reason shows up. Always print it so failures are diagnosable.
120+
- name: Print Argent tool-server log
121+
if: always()
122+
run: cat argent-server.log 2>/dev/null || echo "no argent-server.log"

0 commit comments

Comments
 (0)