molecule-core/tests/e2e
Hongming Wang eacc229e91 test(e2e): fix /registry/register payload — id (not workspace_id) + agent_card
The new external-runtime regression test had two payload bugs that made
step 5 fail with HTTP 400 on its first run:

1. Field name: sent {"workspace_id":...} but RegisterPayload (workspace-
   server/internal/models/workspace.go:58) declares `id` with
   binding:"required" — workspace_id is the heartbeat payload's field,
   not register's.

2. Missing required field: agent_card has binding:"required" and was
   absent. ShouldBindJSON 400'd before any handler logic ran, which is
   why the body said nothing useful.

Why this got past local verification: the test was written from memory
of the heartbeat shape, never run end-to-end before pushing, and curl
with --fail-with-body prints the body to stdout but exit-22's under
set -e — the body was suppressed before the log line could fire.

Fix:
  - Send `id` + a minimal valid agent_card ({name, skills:[{id,name}]})
    matching the canonical shape from tests/e2e/test_api.sh:96.
  - Pull the body into REGISTER_BODY shared between steps 5 and 7 so
    drift between the two register calls is impossible.
  - Drop --fail-with-body for these two calls and append HTTP_CODE via
    curl -w so the body is always visible when the call non-200s. The
    explicit grep for HTTP_CODE=200 + ||true on curl preserves the
    fail-fast contract.
  - Inline payload contract comment pointing at RegisterPayload so the
    next person editing this doesn't repeat the heartbeat-confusion
    mistake.

The url=https://example.invalid:443 is fine: runtime=external resolves
to poll mode (registry.go:resolveDeliveryMode case 3), and validateAgentURL
only fires for push.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 10:15:54 -07:00
..
_extract_token.py chore: apply round-7 review nits 2026-04-13 17:08:45 -07:00
_lib.sh feat(platform): GET /admin/workspaces/:id/test-token for E2E (#6) 2026-04-14 09:35:26 -07:00
STAGING_SAAS_E2E.md feat(e2e): pivot to admin-bearer-only auth + add sanity self-check workflow 2026-04-21 04:34:11 -07:00
test_2307_peer_visibility_staging.sh test(e2e): add staging peer-visibility harness for #2307 2026-04-29 13:26:24 -07:00
test_a2a_e2e.sh initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
test_activity_e2e.sh chore: apply code-review round-6 suggestions 2026-04-13 17:08:45 -07:00
test_api.sh fix(e2e): stop asserting current_task on public workspace GET (#966) 2026-04-19 02:19:15 -07:00
test_chat_attachments_e2e.sh feat(canvas+platform): chat attachments, model selection, deploy/delete UX 2026-04-24 13:27:51 -07:00
test_chat_attachments_multiruntime_e2e.sh feat(canvas+platform): chat attachments, model selection, deploy/delete UX 2026-04-24 13:27:51 -07:00
test_chat_upload_e2e.sh feat(chat_files): rewrite Upload as HTTP-forward to workspace (RFC #2312, PR-C) 2026-04-29 14:26:37 -07:00
test_claude_code_e2e.sh chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00
test_comprehensive_e2e.sh fix(e2e): make provisioning-status assertions robust to CI environment 2026-04-13 17:31:07 -07:00
test_dev_mode.sh fix(quickstart): hotfixes discovered during live testing session 2026-04-23 14:57:18 -07:00
test_harness_rc_normalization.sh fix(e2e-sanity): normalize unexpected curl exit codes in cleanup trap (#2159) 2026-04-27 02:55:44 -07:00
test_notify_attachments_e2e.sh test(notify): pre-sweep prior workspaces so interrupted runs don't pile up 2026-04-26 20:55:13 -07:00
test_poll_mode_e2e.sh fix(e2e): use real UUIDs for poll-mode test workspace ids 2026-04-29 23:10:36 -07:00
test_priority_runtimes_e2e.sh feat(e2e): extend priority-runtimes test to cover all 8 templates 2026-04-27 05:57:59 -07:00
test_saas_tenant.sh chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00
test_staging_external_runtime.sh test(e2e): fix /registry/register payload — id (not workspace_id) + agent_card 2026-04-30 10:15:54 -07:00
test_staging_full_saas.sh fix(e2e): teardown patience matches prod cascade duration (~30–90s) 2026-04-28 11:13:56 -07:00