test(e2e): local prod-mimic backend for peer-visibility MCP gate + make e2e-peer-visibility (task #166) #1551
Reference in New Issue
Block a user
Delete Branch "e2e/peer-visibility-local-backend-task166"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Task #166 — make peer-visibility E2E runnable on the local prod-mimic stack so developers catch the class before pushing, not at staging EC2 cost.
tests/e2e/test_peer_visibility_mcp_local.sh— local docker-compose backend for the literal MCPlist_peersgate.tests/e2e/lib/peer_visibility_assert.sh(used by both staging and local backends — only provisioning differs).tests/e2e/test_peer_visibility_mcp_staging.shto source the shared lib (assertion byte-identical; provisioning/teardown/exit-codes unchanged).peer-visibility-localjob into.gitea/workflows/e2e-peer-visibility.yml— runs on PR + push (local boot = minutes, not the 30+ min cold-EC2 path); non-required-by-design contextE2E Peer Visibility (local), same flip-to-required tracking at molecule-core#1296.make e2e-peer-visibilityso a dev can run it against an already-up local stack (make upfirst). Also fixes themake helpfilter regex to include digits (was[a-zA-Z_-]+, now[a-zA-Z0-9_-]+) so the new digit-containing target shows up.Why a local backend (not just staging)
Per standing memory
feedback_local_must_mimic_production/feedback_mandatory_local_e2e_before_ship/feedback_local_test_before_staging_e2e: the local prod-mimic stack must run a mandatory local-Postgres E2E before the staging E2E. PR #1298 codified the staging gate but staging-only; that catches regressions late + expensively. This PR closes the local-gate gap so the same byte-identical assertion runs in minutes on local docker-compose.Not auto-merged
Per task #166 instructions, this PR is explicitly not auto-merged. It should go through the standard two-eyes branch-protection review (memory
reference_merge_gate_model_changed_2026_05_18).Test plan
pr-validatejob runsbash -non all three scripts (added in the same workflow change).peer-visibility-localjob boots the local stack and runs the literal MCP assertion. RED today (the gated#162Hermes-401 /#165OpenClaw-never-online fixes haven't all landed) — non-required-by-design until then. NOT continue-on-error masked.make helplists the new target.Verification done in this branch
924c3ca9(the original staging+local-backend combined commit frome2e/peer-visibility-local-backend) cleanly onto currentorigin/main. No conflicts.bash -nclean on all three scripts (test_peer_visibility_mcp_local.sh,lib/peer_visibility_assert.sh,test_peer_visibility_mcp_staging.sh).make -n e2e-peer-visibility→bash tests/e2e/test_peer_visibility_mcp_local.sh(expected).make helpnow correctly listse2e-peer-visibilitywith its##description.curl localhost:8080/health→ connection refused), and bringing it up fresh would burn the task's 25-min time-box (docker compose build of the platform image alone is multi-minute). The script is structured so the CIpeer-visibility-localjob covers this empirically — same pattern ase2e-api.yml.Diff
684 +/94 -across 5 files (4 from cherry-pick + the new Makefile target). The bulk is the new 328-line test script — irreducible: the staging assertion is shared via the new lib so we avoid duplicating it. Exceeds the task's "≤150 lines diff" guideline because a whole new local-prod-mimic E2E test cannot fit in 150 lines; flagged here for reviewer awareness.Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
5-axis review on E2E peer-visibility local: correctness OK (shared assertion lib reused byte-identical between local/staging legs; per-run container names + ephemeral ports prevent host-network act_runner collision per feedback_act_runner_*); readability OK (extensive comments cite the feedback rules); arch OK (local prod-mimic boot mirrors e2e-api.yml E2E API Smoke Test job — proven shape); security OK (no creds leak in workflow); perf OK (5min local vs 30min cold-EC2). HONEST gate, NO continue-on-error mask. APPROVED.
DevOps review: docker-compose-class local boot, ephemeral PG+Redis, stale-platform-server kill before start, /health wait gate. Non-required-by-design context until #1296 flip-to-required (red until #162/#165 land — exactly per feedback_local_test_before_staging_e2e). APPROVED.