Skip to content

Commit a4575c5

Browse files
sunnylqmclaude
andcommitted
fix(ci): make debug-smoke emulator script lines self-contained
emulator-runner executes each script line in its own sh -c, so a bare cd never carries over — detox ran from the repo root and failed with 'Could not resolve "jest" package'. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent c9abb7b commit a4575c5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/e2e_android.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,12 @@ jobs:
236236
arch: x86_64
237237
avd-name: api34
238238
emulator-boot-timeout: 900
239+
# 注意:emulator-runner 把 script 的每一行单独用 sh -c 执行,
240+
# cd 不会跨行生效,所以每行必须自包含。
239241
script: |
240-
cd Example/e2etest
241242
for i in $(seq 1 90); do curl -sf http://localhost:8081/status >/dev/null && break; sleep 2; done
242-
curl -sf --max-time 420 -o /dev/null "http://localhost:8081/index.bundle?platform=android&dev=true&minify=false" || { echo '::error::Metro dev bundle failed to build'; tail -n 100 .e2e-artifacts/metro.log; exit 1; }
243-
bunx detox test --configuration android.emu.debug --config e2e/smoke/jest.config.js --no-start --headless --record-logs all --retries 1
243+
curl -sf --max-time 420 -o /dev/null "http://localhost:8081/index.bundle?platform=android&dev=true&minify=false" || { echo '::error::Metro dev bundle failed to build'; tail -n 100 Example/e2etest/.e2e-artifacts/metro.log; exit 1; }
244+
cd Example/e2etest && bunx detox test --configuration android.emu.debug --config e2e/smoke/jest.config.js --no-start --headless --record-logs all --retries 1
244245
245246
- name: Upload Detox artifacts
246247
# cancelled() 覆盖 job 超时被杀的场景,否则超时时拿不到现场

0 commit comments

Comments
 (0)