Skip to content

test: live e2e .mjs smokes (pages, admin, agent, reports, nav, specialists) need a CI harness with next start #177

@jravinder

Description

@jravinder

Problem

Six .mjs smokes assume a running Next server (localhost:3001 by default) and fetch real routes:

  • tests/e2e_pages_smoke.mjs — homepage, dataset pages, ticker numbers
  • tests/e2e_admin_smoke.mjs/api/admin/runs
  • tests/e2e_agent_smoke.mjs/api/agent SSE
  • tests/e2e_reports_smoke.mjs/reports/[slug]
  • tests/e2e_nav_consistency.mjs — header/footer
  • tests/specialists_smoke.mjsapp/lib/specialists.ts paths

Right now the only way to run them is manual: open one terminal with npm run dev, another with node tests/e2e_pages_smoke.mjs. Nothing in CI exercises the homepage, the admin console, or the SSE stream — meaning the visible-to-judges surfaces are protected only by the developer remembering to run the smokes locally.

Companion to the broader CI test-coverage issue, but separated because this one needs a different mechanism (background server + wait-for-port + cleanup) than fast unit tests.

Fix

Add an e2e-smoke job to .github/workflows/ci.yml:

  1. npm ci
  2. npm run build
  3. PORT=3001 npx next start & (background)
  4. npx wait-on http://localhost:3001/api/cache-stats (30s timeout)
  5. node --test tests/e2e_pages_smoke.mjs tests/e2e_admin_smoke.mjs tests/e2e_reports_smoke.mjs tests/e2e_nav_consistency.mjs tests/specialists_smoke.mjs
  6. Skip e2e_agent_smoke.mjs for now — it needs OPENAI_API_KEY and is the right candidate for a separate e2e-live job gated on secrets.OPENAI_API_KEY

Build env will need SUPABASE_URL, SUPABASE_KEY, DATABASE_URL etc. — set CI-only stub values that let the routes return shape-correct empty responses (matches what the .mjs smokes already assert).

Code pointers

  • .github/workflows/ci.yml
  • tests/e2e_pages_smoke.mjs:1-30 — has the usage docstring with the port pattern
  • tests/e2e_agent_smoke.mjs — flag as live-only

Acceptance

  • e2e-smoke job green on PR, exercising the 5 non-live smokes
  • Server PID cleanup on job exit (no zombie processes)
  • Job fails red if any smoke 500s or returns a missing-substring assertion
  • Documented in tests/README.md (or AGENTS.md test section)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:infraDeploy, CI, secrets, envauto-research:2026-05-16Filed by auto-research skill on 2026-05-16enhancementNew feature or requestfleet:readyInternal fleet queue — for pickup-next

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions