Commit 635538d
feat: real e2e CI with local Supabase + academy signup (#104)
* feat: add package tests for shared, CLI, and MCP; wire into CI
- shared: 14 unit tests covering validateParsedYaml, describeCourse,
scaffoldCourseObject, scaffoldBrandObject, fillConceptInRaw, runQualityGate
- CLI: 12 integration tests for offline commands (scaffold, validate,
describe, fill, review, create-brand) using real files on disk
- MCP: 10 unit tests covering all tool calls, tool registration, and
auth enforcement. Refactored index.ts to export handleToolCall/TOOLS
with require.main guard so tests can import without starting stdio.
- CI: added shared/CLI/MCP test steps to ci-deploy.yml so these run
on every push to main and every PR
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: repair pre-existing CLI test failures (spyOn console.error)
bun 1.3.6 doesn't support spyOn for accessor properties on console.
Replace spyOn(console, 'error') with manual save/restore in
register.test.ts and login.test.ts. Also scope bun test to src/
to avoid running compiled dist/ test files.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: exclude __tests__ from shared tsconfig build
tsc fails in CI because bun:test types aren't available during build.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: exclude __tests__ from MCP tsconfig build
Same bun:test type issue as shared package.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: real e2e CI with local Supabase + academy signup flow
Replace the stub e2e-tests CI job with a real Playwright pipeline:
- Starts local Supabase via Docker in GitHub Actions
- Runs Prisma migrations and seeds against local DB
- Builds backend, installs Playwright browsers
- Runs all e2e tests with proper env vars
- Uploads Playwright report as artifact on failure
Also adds:
- academy-signup.spec.ts: tests branded sign-up auto-joins org
- provision.service.ts: ensureLearnerMembership() for branded sites
- auth callback: passes brandOrgSlug during provision
- Vercel domain provisioning on org creation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: trigger CI for e2e pipeline
* fix: apply RLS migration after Prisma creates tables in CI
supabase start applies migrations from supabase/migrations/ before
Prisma tables exist. The RLS migration references Prisma tables
(organizations, courses, etc.) so it must run after prisma migrate deploy.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add DIRECT_URL to Prisma migration and seed steps in CI
* fix: add IF NOT EXISTS to duplicate authored_id migration
* fix: replace duplicate authored_id migration with no-op
* fix: add required academyId to seed course creation
* fix: add graspful.ai and app.graspful.ai brands to CI seeds
* fix: pre-start backend and frontend in CI instead of relying on Playwright webServer
* fix: combine services + tests into single step, set PORT=3001 for frontend
* fix: use subshells for background servers so cd works correctly
* fix: seed posthog-tam org + trim redundant e2e tests
- Add posthog-tam org with academy, course, concepts, and problems to seed
- Add electrician-prep and javascript-prep orgs (referenced by brand seeds)
- Remove 4 redundant e2e test files (course-sections, posthog-lessons,
failure-remediation, learn-deep-routes) — covered by remaining tests
- Fix subdomain-signup test to handle local Supabase auto-confirm
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: increase diagnostic load timeout in e2e tests (5s → 15s)
CI runners are slower, so the diagnostic page takes >5s to load.
Use `.or()` locator to wait for either state in a single assertion.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ce26763 commit 635538d
16 files changed
Lines changed: 552 additions & 796 deletions
File tree
- .github/workflows
- apps/web
- e2e
- src/app/auth/callback
- backend
- prisma
- migrations/20260327120000_add_problem_authored_id
- seeds
- src/auth
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
81 | 180 | | |
82 | 181 | | |
83 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
109 | 102 | | |
110 | 103 | | |
111 | 104 | | |
| |||
This file was deleted.
0 commit comments