Skip to content

Commit 7178583

Browse files
hyperpolymathclaude
andcommitted
fix(ci): unblock E2E + Zig FFI Tests after #150 cartridge.json edits
Two follow-up failures on #150's first CI run, each fixed at source: 1. **Zig FFI Tests** — failed with "no build.zig file found" for orchestrator-lsp-mcp. Root cause: the scope step's `git diff --name-only -- 'cartridges/**'` pulls a cartridge into the test set as soon as ANY file under it changes — including cartridge.json. My PR added a `status` field to 15 cartridges' cartridge.json, which pulled orchestrator-lsp-mcp into scope, but that cart's build.zig lives at `ffi/zig/build.zig` (deeper nesting) so the workflow's `cd cartridges/$cart/ffi && zig build test` fell over. Tightened the pathspec to `cartridges/*/ffi/**` so only ffi/-relevant diffs scope a cart in — matches the workflow's own `on.paths` filter, which was already `cartridges/**/ffi/**` (the pathspec and the diff filter were inconsistent before). 2. **E2E — Server did not start within 10 seconds** — Elixir backend was *found* (the setup-beam fix from the first commit worked), but `mix run --no-halt` on a cold runner spends most of the 10s window compiling deps. Two changes: (a) added `mix compile` as a workflow step so deps land in `_build/` before the test starts the server; (b) bumped the script's wait window from 10s (50 × 200ms) to 60s (300 × 200ms) so a slow CI cold start doesn't false-fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 624e08a commit 7178583

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ jobs:
7272
working-directory: elixir
7373
run: mix deps.get
7474

75+
- name: Compile Elixir deps
76+
# Pre-compile so the in-test `mix run --no-halt` doesn't have
77+
# to do it on the critical path of the 60s server-start window.
78+
working-directory: elixir
79+
run: mix compile
80+
7581
- name: Build FFI libraries
7682
run: |
7783
cd ffi/zig && zig build

.github/workflows/zig-test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ jobs:
5252
all="$(ls -d cartridges/*/ffi/ 2>/dev/null | sed 's|cartridges/||;s|/ffi/||' | sort)"
5353
if [ "$EVENT" = "pull_request" ]; then
5454
git fetch --no-tags --depth=50 origin "$BASE_REF" || true
55-
changed="$(git diff --name-only "origin/${BASE_REF}...HEAD" -- 'cartridges/**' \
55+
# Only scope cartridges whose `ffi/` actually changed —
56+
# `cartridge.json` edits (e.g. adding a status field) and
57+
# `abi/` edits should not pull a cart into this FFI test
58+
# job, which exists to validate Zig builds. Using
59+
# `cartridges/*/ffi/**` as the pathspec ensures only
60+
# ffi-relevant diffs count (also matches the workflow's
61+
# own `on.paths` filter — they were inconsistent before).
62+
changed="$(git diff --name-only "origin/${BASE_REF}...HEAD" -- 'cartridges/*/ffi/**' \
5663
| awk -F/ '{print $2}' | sort -u)"
5764
scope=""
5865
while IFS= read -r cart; do

tests/e2e_full.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,17 @@ bold "Step 1: Starting BoJ server on port $REST_PORT..."
131131
( cd "$ELIXIR_DIR" && BOJ_REST_PORT="$REST_PORT" mix run --no-halt ) > "$TMPDIR_TEST/boj-e2e-full.log" 2>&1 &
132132
PIDS+=($!)
133133

134-
# Wait for health check (up to 10 seconds)
135-
for i in $(seq 1 50); do
134+
# Wait for health check (up to 60 seconds — CI cold start can compile
135+
# Elixir deps on the critical path even when the workflow pre-runs
136+
# `mix deps.get` / `mix compile`; local runs typically come up in <1s).
137+
WAIT_ITERS=300
138+
for i in $(seq 1 $WAIT_ITERS); do
136139
if curl -sf "$BASE_URL/health" > /dev/null 2>&1; then
137140
green " Server is up (waited ~$((i * 200))ms)"
138141
break
139142
fi
140-
if [[ $i -eq 50 ]]; then
141-
red " ERROR: Server did not start within 10 seconds"
143+
if [[ $i -eq $WAIT_ITERS ]]; then
144+
red " ERROR: Server did not start within $((WAIT_ITERS * 200 / 1000)) seconds"
142145
red " Log tail:"
143146
tail -20 "$TMPDIR_TEST/boj-e2e-full.log" 2>/dev/null || true
144147
exit 1

0 commit comments

Comments
 (0)