Skip to content

CI - Unit & Integration#125

Open
JoanMVPopov wants to merge 17 commits intomainfrom
cicd
Open

CI - Unit & Integration#125
JoanMVPopov wants to merge 17 commits intomainfrom
cicd

Conversation

@JoanMVPopov
Copy link
Copy Markdown
Collaborator

@JoanMVPopov JoanMVPopov commented Apr 20, 2026

This PR aims to bring the Unit & Integration up to speed with the current state of the repo. It does not add new features, nor does it add any tests. It is purely for DevOps purposes. See the info below:

What's in this PR

Workflow - .github/workflows/ci.yml

  • Triggers on pull_request to main
  • Single job Unit & Integration Tests (ubuntu-latest, 10-min timeout)
  • Node version from .nvmrc (22)
  • Steps: npm cinpm run test:unitnpm run test:integration → upload coverage artifacts → post coverage PR comments
  • cancel-in-progress concurrency per PR
  • Permissions scoped to contents: read + pull-requests: write

Integration test infrastructure

  • cicd/docker-compose.ci.yml - Supabase subset (db, kong, supavisor, auth, analytics, rest, storage, minio, imgproxy). DB uses tmpfs for speed.
  • cicd/.env.ci - throwaway dev credentials for the compose file (safe to commit)
  • cicd/.env.app.ci — app runtime env (DATABASE_URL, SUPABASE URLs, etc.). Loaded into $GITHUB_ENV by the workflow so both unit and integration steps inherit it
  • scripts/run-integration.sh - brings the stack up, waits for health, exports app env, builds + previews the app, runs vitest, tears down (runs cleanup even on test failure)

Vitest configs

  • vitest.config.unit.ts and vitest.config.integration.ts
  • Split coverage dirs: reports/coverage/unit and reports/coverage/integration
  • Coverage reporters: text, html, json-summary, json + reportOnFailure: true
  • Coverage thresholds set to current coverage % (lines/branches/functions/statements)
  • github-actions reporter gated on GITHUB_ACTIONS env (inline annotations + job summary)
  • retry: 2 on integration tests only

Coverage reporting

  • HTML coverage uploaded as artifacts (coverage-unit, coverage-integration)
  • davelosert/vitest-coverage-report-action posts a summary comment on the PR for each suite

Not in this PR (follow-ups)

  • E2E stage - postponed until real Playwright tests exist and staging secrets are provisioned (soon :) )
  • Test failures / Adding new tests - out of scope for this PR. The coverage is not very good right now (see reports for info), but that number will increase over the next few sprints

How to verify

  1. CI runs automatically on this PR - check the Actions tab
  2. Download coverage artifacts from the run page for the full HTML report
  3. Coverage summary comments should appear on the PR for unit + integration

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

github-actions Bot commented Apr 20, 2026

Coverage Report for Unit

Status Category Percentage Covered / Total
🔵 Lines 36.2% (🎯 25%) 328 / 906
🔵 Statements 35.58% (🎯 25%) 347 / 975
🔵 Functions 29.71% (🎯 25%) 82 / 276
🔵 Branches 32.94% (🎯 25%) 143 / 434
File CoverageNo changed files found.
Generated in workflow #14 for commit 9a7e1e4 by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Coverage Report for Integration

Status Category Percentage Covered / Total
🔵 Lines 5.5% (🎯 4%) 69 / 1253
🔵 Statements 5.13% (🎯 4%) 70 / 1362
🔵 Functions 6.08% (🎯 4%) 21 / 345
🔵 Branches 5.27% (🎯 4%) 32 / 607
File CoverageNo changed files found.
Generated in workflow #14 for commit 9a7e1e4 by the Vitest Coverage Report Action

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.

2 participants