Skip to content

CICD - Unit | Integration | E2E - #125

Merged
JoanMVPopov merged 116 commits into
mainfrom
cicd
Aug 30, 2026
Merged

CICD - Unit | Integration | E2E#125
JoanMVPopov merged 116 commits into
mainfrom
cicd

Conversation

@JoanMVPopov

@JoanMVPopov JoanMVPopov commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

Closes CAI-165.

This PR modernizes our CI/CD and test setup, adds the full test suite, and lands the production Supabase stack definition. It is a large change, so the deep detail lives in the following articles:

CI/CD pipeline

  • Adds .github/workflows/ci.yml with two jobs that run in parallel and both gate merges to main: unit and integration on the runner, and e2e against the real staging
  • The e2e job drives staging through the Coolify API with the scripts in scripts/cicd/ (stop both apps, deploy Supabase, wipe the DB, deploy SvelteKit, run Playwrig
  • CI runs the Supabase subset from a small compose override (cicd/docker-compose.ci.yml, database on tmpfs) with committed throwaway env files.

Unit, integration, and e2e tests

  • Unit and integration (Vitest) run from one script (scripts/run-integration.sh) that works both locally and in CI.
  • Adds a local e2e runner (scripts/run-e2e.sh) and the Playwright setup, plus the e2e suite under tests/e2e.
  • Adds a local test stack (docker/docker-compose.test.yml, compose project cait-test) that reuses the dev ports and persists between runs for faster iteration.
  • Splits init-db.sh out of the build. npm run build is now just the vite build, and migrations and seeding run at server startup instead.

Production VPS

  • Adds docker/docker-compose.prod.yml, the self-hosted Supabase stack the production VPS now runs (S3 storage via minio, the pooler, SAML SSO, and the rest).
  • Production was migrated onto this stack (from a Coolify service to an application) with the real data, files, and SSO carried over. The runbook and the problems we hit are in the migration article above.
  • The main goal of this transition was to align the dev stack, staging, and prod as much as possible, reducing version drifts and preventing regression bugs.

Misc

  • Quite a few frontend bugs were fixed during the creation of the e2e suite, as some allowed (non-auth) users to access pages they shouldn't be able to. While backend checks prevented further destructive actions, such behaviour was corrected via direct code changes on the go, rather than scheduling additional PRs. This was done to save time and bring the branch closer to completion
  • Documentation updates (root README, docker README, YouTrack articles)

@JoanMVPopov JoanMVPopov self-assigned this Apr 20, 2026
@github-actions

github-actions Bot commented Apr 20, 2026

Copy link
Copy Markdown

Coverage Report for Unit

Status Category Percentage Covered / Total
🟢 Lines 51.45% (🎯 25%) 512 / 995
🟢 Statements 49.86% (🎯 25%) 540 / 1083
🟢 Functions 43.05% (🎯 25%) 127 / 295
🟢 Branches 48.58% (🎯 25%) 274 / 564
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/PiscinaUtils/runner.ts 77.27% 27.77% 93.33% 80.32% 124, 164, 183-191, 200, 255-263
src/lib/database/publication.ts 81.08% 60% 78.57% 81.08% 112-136, 258-265
src/lib/util/coursesLogic.ts 68.57% 50% 45.45% 76.92% 18, 19, 20, 27, 58-71
src/lib/util/validatePublication.ts 50% 60% 80% 70% 33-36, 40, 41
Generated in workflow #46 for commit a2ef429 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Apr 20, 2026

Copy link
Copy Markdown

Coverage Report for Integration

Status Category Percentage Covered / Total
🟢 Lines 17.44% (🎯 4%) 235 / 1347
🟢 Statements 16.5% (🎯 4%) 244 / 1478
🟢 Functions 27.64% (🎯 4%) 102 / 369
🟢 Branches 12.31% (🎯 4%) 91 / 739
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/similarityIndex.mjs 0% 0% 0% 0% 10-52
src/lib/MetadataSimilarityUtils/similarityUtils.mjs 0% 0% 0% 0% 10-94
src/lib/PiscinaUtils/runner.ts 0% 0% 0% 0% 46-263
src/lib/database/publication.ts 94.59% 100% 100% 94.59% 120, 136
src/lib/util/coursesLogic.ts 0% 0% 0% 0% 17-71
src/lib/util/validatePublication.ts 0% 0% 0% 0% 3-53
Generated in workflow #46 for commit a2ef429 by the Vitest Coverage Report Action

…due to mistakenly deleting .svelte components
…material type draft inconsistency, fix zip download
@JoanMVPopov
JoanMVPopov merged commit d99b5d6 into main Aug 30, 2026
2 checks passed
@zakrok

zakrok commented Aug 31, 2026

Copy link
Copy Markdown
Member

No way it got merged!

@zakrok
zakrok deleted the cicd branch August 31, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants