Merge pull request #8 from Molecule-AI/fix/e2e-ci-flake
fix(e2e): make provisioning-status assertions robust to CI
This commit is contained in:
commit
44fccc16e7
@ -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'])")
|
||||
|
||||
@ -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"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user