Last sweep of code-review items before merging PR #5. ## _lib.sh cleanup - Removed unused e2e_register and e2e_heartbeat helpers (dead code — no caller ever invoked them) - Standardized on $BASE variable set via : "${BASE:=...}" so every script uses one name (was mixed $BASE / $e2e_base) - e2e_extract_token now writes stderr warnings on JSON parse failure or missing auth_token, instead of silently returning empty. Previous behavior made downstream "missing workspace auth token" 401s much harder to diagnose ## Script cleanup - test_api.sh, test_comprehensive_e2e.sh, test_activity_e2e.sh all drop the redundant `e2e_base + BASE="$e2e_base"` aliasing; sourcing _lib.sh sets BASE via : "${BASE:=...}" default ## CI hardening (.github/workflows/ci.yml) - Postgres credentials now match .env.example (dev:dev — was molecule:molecule, caused confusion for local repros) - Added Go module cache via actions/setup-go cache:true + cache-dependency-path: platform/go.sum. ~30s cold-run improvement - New pre-E2E step asserts migrations actually ran by checking for the 'workspaces' table. Catches future migration-author mistakes before they surface as obscure E2E failures ## Follow-up issue Filed Molecule-AI/molecule-monorepo#6 for the deterministic token- mint admin endpoint. PR #5 uses an empirical "beat the container" race (5/5 wins in benchmarks); issue #6 tracks the real fix for any future CI load that invalidates the assumption. ## Verification - bash tests/e2e/test_api.sh -> 62/62 - bash tests/e2e/test_comprehensive_e2e.sh -> 67/67 - python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))" -> ok ## Operational note Hourly PR-triage + issue-pickup cron scheduled this session (job id 0328bc8f, fires at :17 past each hour). Runtime reports it as session-only despite durable:true — re-invoke via /loop or CronCreate in a fresh session if needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| e2e | ||
| README.md | ||
Tests
This repo uses the standard monorepo testing convention: unit tests live with their package, cross-component E2E tests live here.
Where to find tests
| Scope | Location |
|---|---|
| Go unit + integration (platform, CLI, handlers) | platform/**/*_test.go — run with cd platform && go test -race ./... |
| TypeScript unit (canvas components, hooks, store) | canvas/src/**/__tests__/ — run with cd canvas && npm test -- --run |
| TypeScript unit (MCP server handlers) | mcp-server/src/__tests__/ — run with cd mcp-server && npx jest |
| Python unit (workspace runtime, adapters) | workspace-template/tests/ — run with cd workspace-template && python3 -m pytest |
| Python unit (SDK: plugin + remote agent) | sdk/python/tests/ — run with cd sdk/python && python3 -m pytest |
| Cross-component E2E (spans platform + runtime + HTTP) | tests/e2e/ ← you are here |
Why split this way
- Go requires co-located
_test.gofiles to access unexported symbols. - Per-package test commands keep the inner loop fast — changing canvas doesn't re-run Go tests.
tests/e2e/covers scenarios that no single package owns: a full workspace lifecycle, A2A across two provisioned agents, delegation chains, bundle round-trips.
Running E2E
Every E2E script here assumes the platform is running at localhost:8080 and (where noted) provisioned agents are online. See the header comment of each .sh for specifics.