Skip to content

Add Vitest + Playwright test harness, test DB lifecycle, and CI with flaky-test protections#12

Merged
DigitalHerencia merged 2 commits into
mainfrom
codex/configure-vitest-and-playwright-for-testing
Feb 15, 2026
Merged

Add Vitest + Playwright test harness, test DB lifecycle, and CI with flaky-test protections#12
DigitalHerencia merged 2 commits into
mainfrom
codex/configure-vitest-and-playwright-for-testing

Conversation

@DigitalHerencia

Copy link
Copy Markdown
Owner

Motivation

  • Provide a production-grade automated test harness for domain/business logic and server helpers using Vitest.
  • Add Playwright end-to-end specs to validate auth entry, tenant routing, RBAC boundaries, and core CRUD readiness.
  • Ensure isolated, deterministic test runs against a test database and enforce coverage/flake protections in CI.

Description

  • Added Vitest configuration and tests (vitest.config.ts, tests/unit/*, tests/server/*, tests/setup/vitest.setup.ts) with coverage thresholds (lines/functions/statements ≥ 70%, branches ≥ 60%) and CI-friendly worker/retry settings.
  • Added Playwright configuration and E2E suites (playwright.config.ts, tests/e2e/*) with forbidOnly, retries, trace-on-first-retry, screenshots/videos on failure, storage-state setup, and webServer orchestration for local/CI runs.
  • Added test-database lifecycle tooling and fixtures (db/test-db.ts, db/test/reset.sql, db/test/seed.sql) and npm scripts (test, test:e2e, test:db:*, test:ci) to reset/seed and prepare an isolated test DB using TEST_DATABASE_URL.
  • Added CI workflow (.github/workflows/ci-tests.yml), updated package.json/lockfiles for required dev dependencies (vitest, @vitest/coverage-v8, @playwright/test, tsx), and documented the testing strategy in README.md.

Testing

  • Ran unit/server tests with coverage via npm run test and all Vitest suites passed with coverage gates enforced (unit/server tests green and configured thresholds met).
  • Verified Playwright test discovery with npx playwright test --list which listed the configured E2E scenarios.
  • Attempted full E2E execution (npm run test:e2e) in this container but it is blocked by missing system libraries required by Playwright's headless Chromium (libatk-1.0.so.0) and occasional port collisions in the environment; npx playwright install chromium was run successfully to download browsers.
  • CI workflow added to run Vitest (coverage-gated) and Playwright (with retries/report artifacts) on GitHub Actions.

Codex Task

@vercel

vercel Bot commented Feb 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hustlers-code Error Error Feb 15, 2026 0:08am

@DigitalHerencia
DigitalHerencia merged commit effc60a into main Feb 15, 2026
1 of 7 checks passed
@DigitalHerencia
DigitalHerencia deleted the codex/configure-vitest-and-playwright-for-testing branch February 15, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant