From e3db196077ad4702725e5606b1e16399065a5d65 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Mon, 13 Apr 2026 17:31:07 -0700 Subject: [PATCH] fix(e2e): make provisioning-status assertions robust to CI environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI run of test_api.sh failed on "Re-imported workspace exists" because the assertion checked for status:"provisioning" but the async provisioner flipped the workspace to status:"failed" first (CI has no Docker images for agent runtimes — autogen/langgraph containers can't actually start there). Root cause is the same thing the rest of the E2E suite handles: the test is about bundle round-trip fidelity, not provisioning success. Fixes: - test_api.sh: assert workspace id is present, not a specific status - test_comprehensive_e2e.sh: send a fresh heartbeat before the "Dev status online after register" check so status is re-asserted to online regardless of what the provisioner did async Verified locally against the same no-Docker-image state as CI: - test_api.sh -> 62/62 - test_comprehensive_e2e.sh -> 67/67 Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/e2e/test_api.sh | 7 +++++-- tests/e2e/test_comprehensive_e2e.sh | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/e2e/test_api.sh b/tests/e2e/test_api.sh index dd02fc1b..61b443cb 100644 --- a/tests/e2e/test_api.sh +++ b/tests/e2e/test_api.sh @@ -282,9 +282,12 @@ else FAIL=$((FAIL + 1)) fi -# Verify re-imported workspace has same config +# Verify re-imported workspace exists by name — status may be "provisioning", +# "online", or "failed" depending on runtime availability in the environment +# (CI has no Docker, so autogen/langgraph containers never come up). The +# round-trip assertion is about bundle fidelity, not provisioning success. R=$(curl -s "$BASE/workspaces/$NEW_ID") -check "Re-imported workspace exists" '"status":"provisioning"' "$R" +check "Re-imported workspace exists" "\"id\":\"$NEW_ID\"" "$R" REIMPORT_NAME=$(echo "$R" | python3 -c "import sys,json; print(json.load(sys.stdin)['name'])") REIMPORT_TIER=$(echo "$R" | python3 -c "import sys,json; print(json.load(sys.stdin)['tier'])") diff --git a/tests/e2e/test_comprehensive_e2e.sh b/tests/e2e/test_comprehensive_e2e.sh index 66390194..9d4247ca 100755 --- a/tests/e2e/test_comprehensive_e2e.sh +++ b/tests/e2e/test_comprehensive_e2e.sh @@ -240,9 +240,13 @@ echo "" echo "--- Section 3: Registry & Heartbeat ---" # Dev was already registered in Section 2 right after creation (to beat -# the provisioner in the token-issuance race). Re-assert the status here. - -# Verify Dev is now online +# the provisioner in the token-issuance race). The async provisioner +# may have flipped the status to "failed" in the meantime (no real +# container image in test env). Send a fresh heartbeat first so status +# goes back to online before we assert. +curl -s -X POST "$BASE/registry/heartbeat" -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DEV_TOKEN" \ + -d "{\"workspace_id\":\"$DEV_ID\",\"active_tasks\":0,\"uptime_seconds\":1}" > /dev/null R=$(curl -s "$BASE/workspaces/$DEV_ID") check "Dev status online after register" '"status":"online"' "$R"