Skip to content

Commit 9edd215

Browse files
committed
fix(ci): use foreground mockd (not daemon), fix spec URLs, fix 404 assertion
- Digital twins: use 'mockd start ... &' instead of daemon mode (-d) to avoid PID file timing issues in CI; increase health wait to 60s - OpenAI: add fallback URL for spec download (master vs main branch) - ci-testing: check for 'error' not 'message' in 404 response body - Fix mockd list to use --admin-url flag
1 parent 51d08f8 commit 9edd215

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,23 @@ jobs:
103103
;;
104104
openai)
105105
curl -sf -L -o third-party-apis/openai-api/openai.yaml \
106-
"https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml"
106+
"https://raw.githubusercontent.com/openai/openai-openapi/refs/heads/master/openapi.yaml" \
107+
|| curl -sf -L -o third-party-apis/openai-api/openai.yaml \
108+
"https://raw.githubusercontent.com/openai/openai-openapi/main/openapi.yaml"
107109
echo "Downloaded OpenAI spec ($(wc -c < third-party-apis/openai-api/openai.yaml) bytes)"
108110
;;
109111
esac
110112
111113
- name: Start mockd with config
112114
run: |
113-
mockd start -c ${{ matrix.sample.config }} --no-auth -d
114-
for i in $(seq 1 30); do
115+
mockd start -c ${{ matrix.sample.config }} --no-auth --log-level error &
116+
for i in $(seq 1 60); do
115117
curl -sf http://localhost:4290/health > /dev/null 2>&1 && break
116118
sleep 1
117119
done
118120
curl -sf http://localhost:4290/health
119121
echo ""
120-
mockd list --json | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'Loaded {len(d)} mocks')"
122+
mockd list --json --admin-url http://localhost:4290 | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'Loaded {len(d)} mocks')"
121123
122124
- name: Smoke test — Stripe
123125
if: matrix.sample.name == 'stripe'

ci-testing/github-actions/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/api/orders/ord_nonexi
173173
assert_status "GET nonexistent order returns 404" "404" "$STATUS"
174174

175175
BODY=$(curl -s "$BASE_URL/api/orders/ord_nonexistent")
176-
assert_contains "404 response has error message" '"message"' "$BODY"
176+
assert_contains "404 response has error field" '"error"' "$BODY"
177177

178178
# ── Results ──────────────────────────────────────────────────────────
179179

0 commit comments

Comments
 (0)