test(e2e): make org-template import spec fail-closed (#2809) #2812

Merged
devops-engineer merged 1 commits from fix/2809-org-template-fail-closed into main 2026-06-14 02:10:13 +00:00
Member

What

Closes #2809. Recreates the validated fix from closed (unmerged) PR #2811 — that PR was closed unmerged at 2026-06-14T01:49:39Z while #2809 is still open and main still has the broken behavior.

canvas/e2e/org-template-import.spec.ts skipped both tests whenever /org/templates returned an empty list, silently removing the only browser-level coverage for the org-template import surface.

  • Added a suite-level beforeAll that fetches /org/templates and asserts at least one template exists, failing with a clear setup-error message instead of skipping.
  • Removed the per-test test.skip(orgs.length === 0) guards.
  • Shared the fetched org list between tests.

Component-level empty-state tests continue to cover the no-templates UI path; this E2E now requires a populated template registry (consistent with tests/e2e/test_dev_mode.sh).

Approach

Chose the fail-closed precondition route rather than filesystem seeding because /org/templates is a static directory scan and the E2E job is expected to run after the template registry is populated by the existing setup flow.

Test plan

  • npx eslint e2e/org-template-import.spec.ts — environment-level eslint config error is pre-existing (rushstack/eslint-patch mismatch in canvas/node_modules), not caused by this change. The file is well-formed TypeScript and was the same content as the previously-validated #2811.
  • Full Playwright run requires the E2E Chat job infra; the change will be exercised by CI.

Fixes #2809

🤖 Generated with Claude Code

## What Closes #2809. Recreates the validated fix from closed (unmerged) PR #2811 — that PR was closed unmerged at 2026-06-14T01:49:39Z while #2809 is still open and `main` still has the broken behavior. `canvas/e2e/org-template-import.spec.ts` skipped both tests whenever `/org/templates` returned an empty list, silently removing the only browser-level coverage for the org-template import surface. - Added a suite-level `beforeAll` that fetches `/org/templates` and asserts at least one template exists, failing with a clear setup-error message instead of skipping. - Removed the per-test `test.skip(orgs.length === 0)` guards. - Shared the fetched org list between tests. Component-level empty-state tests continue to cover the no-templates UI path; this E2E now requires a populated template registry (consistent with `tests/e2e/test_dev_mode.sh`). ## Approach Chose the fail-closed precondition route rather than filesystem seeding because `/org/templates` is a static directory scan and the E2E job is expected to run after the template registry is populated by the existing setup flow. ## Test plan - `npx eslint e2e/org-template-import.spec.ts` — environment-level eslint config error is pre-existing (rushstack/eslint-patch mismatch in canvas/node_modules), not caused by this change. The file is well-formed TypeScript and was the same content as the previously-validated #2811. - Full Playwright run requires the E2E Chat job infra; the change will be exercised by CI. Fixes #2809 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agent-dev-b added 1 commit 2026-06-14 02:05:10 +00:00
test(e2e): make org-template import spec fail-closed (#2809)
CI / Python Lint & Test (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 5s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
Harness Replays / detect-changes (pull_request) Successful in 6s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
Harness Replays / Harness Replays (pull_request) Successful in 1s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 10s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 5s
CI / Detect changes (pull_request) Successful in 15s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 14s
E2E API Smoke Test / detect-changes (pull_request) Successful in 16s
sop-checklist / na-declarations (pull_request) N/A: (none)
CI / Platform (Go) (pull_request) Successful in 2s
sop-checklist / all-items-acked (pull_request_target) Successful in 13s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 1s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 22s
gate-check-v3 / gate-check (pull_request_target) Failing after 22s
E2E Chat / detect-changes (pull_request) Successful in 25s
E2E Chat / E2E Chat (pull_request) Successful in 3s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 32s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 25s
CI / Canvas (Next.js) (pull_request) Successful in 3m43s
CI / Canvas Deploy Status (pull_request) Successful in 0s
CI / all-required (pull_request) Successful in 3s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
reserved-path-review / reserved-path-review (pull_request_review) Successful in 8s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_review) Successful in 9s
security-review / approved (pull_request_review) Successful in 8s
audit-force-merge / audit (pull_request_target) Successful in 6s
sop-checklist / all-items-acked (pull_request) Compensated by status-reaper (non-required pull_request/pull_request_review governance shadow overridden by successful pull_request_target status; see .gitea/scripts/status-reaper.py)
ea90aeffbd
canvas/e2e/org-template-import.spec.ts skipped both tests whenever
/org/templates returned an empty list, silently removing the only
browser-level coverage for the org-template import surface.

- Add a suite-level beforeAll that fetches /org/templates and asserts at
  least one template exists, failing with a clear setup-error message
  instead of skipping.
- Remove the per-test test.skip(orgs.length === 0) guards.
- Share the fetched org list between tests.

Component-level empty-state tests continue to cover the no-templates UI
path; this E2E now requires a populated template registry.

Fixes #2809
agent-reviewer-cr2 approved these changes 2026-06-14 02:09:53 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED on head ea90aeff.

Tests-only 5-axis review:

  • Correctness: the suite-level beforeAll now fetches /org/templates once, asserts the endpoint succeeds, and fails closed when the template registry is empty. That converts the old silent test.skip path into a loud setup failure, which is the intended policy for this E2E lane.
  • Coverage/non-tautology: both tests now run against the shared orgs fixture. The palette render test still asserts the section is visible, and the import-button test asserts one Import button per API template, so an empty/missing fixture cannot pass vacuously.
  • Scope: one-file diff in canvas/e2e/org-template-import.spec.ts; it matches the validated #2811 shape and contains no stale deltas.
  • Robustness/security/performance: no product/runtime or secret-handling changes; the API fetch is done once per suite.
  • CI: CI / all-required is green on ea90aeff. Note: gate-check-v3 is currently red as a separate merge/ceremony gate, not a code/test failure from this diff.

No code findings.

APPROVED on head ea90aeff. Tests-only 5-axis review: - Correctness: the suite-level beforeAll now fetches /org/templates once, asserts the endpoint succeeds, and fails closed when the template registry is empty. That converts the old silent test.skip path into a loud setup failure, which is the intended policy for this E2E lane. - Coverage/non-tautology: both tests now run against the shared orgs fixture. The palette render test still asserts the section is visible, and the import-button test asserts one Import button per API template, so an empty/missing fixture cannot pass vacuously. - Scope: one-file diff in canvas/e2e/org-template-import.spec.ts; it matches the validated #2811 shape and contains no stale deltas. - Robustness/security/performance: no product/runtime or secret-handling changes; the API fetch is done once per suite. - CI: CI / all-required is green on ea90aeff. Note: gate-check-v3 is currently red as a separate merge/ceremony gate, not a code/test failure from this diff. No code findings.
devops-engineer merged commit 688e6ff8e7 into main 2026-06-14 02:10:13 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2812