CI Test Cases (Sprint 1)
Documents 22 CI test cases for a Next.js project with Stripe and Supabase, covering build, linting, security, and file checks.
What this file does
Documents 22 CI test cases for a Next.js project with Stripe and Supabase, covering build, linting, security, and file checks.
When to use it
- Setting up a CI pipeline for a Next.js app with Stripe and Supabase
- Adding lightweight shell-based checks before unit tests exist
- Defining a staged approach to CI test coverage across sprints
- Auditing CI for security, dependency, and environment variable checks
Assumes this stack
CI Test Cases (Sprint 1)
Current CI coverage
- The current CI pipeline only runs a production build.
- There are no automated unit, integration, or end-to-end tests configured yet.
Sprint 1 basic CI test cases
These are intentionally lightweight and meant to cover the whole codebase at a high level.
CI-001: Dependency installation
Goal: Ensure the project installs cleanly in CI. Steps:
- Run
npm ci --legacy-peer-deps. Expected result: Install succeeds without errors.
CI-002: Linting
Goal: Enforce code quality across the app and API routes. Steps:
- Run
npm run lint. Expected result: No ESLint errors.
CI-003: Type checking
Goal: Catch TypeScript type errors in pages, components, and API routes. Steps:
- Run
npx tsc --noEmit. Expected result: No TypeScript errors.
CI-004: Next.js build
Goal: Verify the entire app (pages, components, API routes) compiles. Steps:
- Set required env placeholders (Stripe + Supabase).
- Run
npm run build. Expected result: Build completes successfully.
CI-005: Static route compilation smoke check
Goal: Ensure key routes compile without runtime-only errors. Scope:
/(home)/eventsand/events/[slug]/eventDetails/buy,/success,/cancel/login,/register,/account,/submit-eventExpected result: All routes included in the build output without compile errors.
CI-006: API route compilation smoke check
Goal: Ensure API routes compile and are included in the build. Scope:
/api/checkout/api/events/api/ticket-types/api/auth/callback/api/auth/signoutExpected result: Build completes with no route handler compile errors.
CI-007: Supabase client import check
Goal: Ensure Supabase client modules compile in both server and client contexts. Scope:
lib/supabase/client.tslib/supabase/server.tslib/supabase/middleware.tsExpected result: No build-time import or type errors.
CI-008: Stripe server SDK import check
Goal: Ensure Stripe server SDK is properly used in server-only routes. Scope:
/api/checkoutroute Expected result: Build completes with no server/client boundary errors.
Additional CI test cases (Enhanced)
CI-009: Security audit
Goal: Detect known vulnerabilities in dependencies. Steps:
- Run
npm ci --legacy-peer-deps. - Run
npm audit --audit-level=high. Expected result: No high or critical severity vulnerabilities reported. Notes: Set toallow_failure: trueto avoid blocking builds for low-risk issues.
CI-010: Dependency check
Goal: Identify unused dependencies that bloat the project. Steps:
- Run
npm ci --legacy-peer-deps. - Run
npx depcheck --ignores="@types/*,eslint-config-next,@tailwindcss/postcss". Expected result: No unused dependencies found (excluding type definitions and build tools). Notes: Helps maintain a clean package.json and reduce bundle size.
CI-011: Environment variable security check
Goal: Prevent hardcoded API keys or secrets from being committed. Steps:
- Search source files for patterns like
sk_live_,pk_live_,rk_live_(Stripe live keys). - Check app/, lib/, and other source directories. Expected result: No hardcoded live API keys found. Notes: Critical security check to prevent accidental secret exposure.
CI-012: Build artifact generation
Goal: Generate and preserve build artifacts for downstream jobs. Steps:
- Complete successful build.
- Save
.next/directory as artifact. Expected result: Artifacts available for 1 day, accessible by quality jobs. Notes: Enables build size analysis and deployment validation.
CI-013: Build size monitoring
Goal: Track and monitor the size of production builds. Steps:
- Use artifacts from build job.
- Calculate total
.next/directory size. - Report size metrics. Expected result: Build size reported (informational). Notes: Future enhancement: set size thresholds and fail if exceeded.
CI-014: Package.json validation
Goal: Ensure package.json has required fields and valid structure. Steps:
- Parse package.json as JSON.
- Verify presence of name, version, scripts, and dependencies fields. Expected result: All required fields present and valid. Notes: Catches malformed package.json before deployment.
CI-015: Cache efficiency
Goal: Optimize CI pipeline performance using dependency caching. Steps:
- Cache
node_modules/and.next/cache/directories. - Use branch-specific cache keys.
Expected result: Subsequent pipeline runs faster due to cache hits.
Notes: Reduces
npm citime and build compilation time.
CI-016: Multi-stage pipeline execution
Goal: Verify security checks run before tests, tests before build, and quality checks after build. Steps:
- Trigger pipeline.
- Observe stage execution order: security → test → build → quality. Expected result: Stages execute in correct order; failures in early stages prevent later stages. Notes: Optimizes CI time by failing fast on security or linting issues.
CI-017: Parallel job execution
Goal: Maximize CI efficiency by running independent jobs in parallel. Steps:
- Observe security-audit and dependency-check run in parallel (security stage).
- Observe lint and typecheck run in parallel (test stage). Expected result: Parallel jobs complete faster than sequential execution. Notes: Reduces total pipeline execution time.
CI-018: Protected branch enforcement
Goal: Ensure CI runs on protected branches (main, production). Steps:
- Configure cache keys with
${CI_COMMIT_REF_SLUG}-protected. - Push to protected branch. Expected result: CI runs successfully with branch-specific cache. Notes: Prevents cache poisoning across branches.
CI-019: Merge conflict marker check
Goal: Catch unresolved merge conflicts before they reach build or deploy stages. Steps:
- Scan tracked source files for
<<<<<<<,=======, or>>>>>>>markers. - Fail the job if any marker is found.
Expected result: No merge conflict markers exist in the repository.
Notes: Very fast and easy to implement with a single
grepcommand.
CI-020: Required file presence check
Goal: Ensure the project keeps the minimum files needed for build and deployment. Steps:
- Verify the presence of key files such as
package.json,package-lock.json,next.config.ts, andtsconfig.json. - Verify critical API route files still exist. Expected result: All required files are present. Notes: Useful as a quick structural smoke test after refactors.
CI-021: Environment template check
Goal: Ensure .env.example includes the core variables needed by contributors and CI.
Steps:
- Check that
.env.exampleexists. - Verify it contains
NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY, andNEXT_PUBLIC_BASE_URL. Expected result: The environment template is present and includes the required keys. Notes: Easy to implement with a small shell loop.
CI-022: Database asset presence check
Goal: Ensure the committed SQL setup files required for local and CI setup are available. Steps:
- Verify
db/schema.sql,db/seeds.sql,db/profiles.sql, anddb/guest_checkout.sqlexist. Expected result: All expected database SQL files are present. Notes: Lightweight guard against accidental file deletion.
Notes
- These test cases are documented for Sprint 1; implementation can be staged later.
- Adding a minimal
testscript and a test runner can be deferred to Sprint 2+. - Enhanced CI now includes security, quality, and monitoring jobs.
- The newest additions are intentionally low-cost shell-based checks suited for quick CI wins.
- Consider adding actual unit/integration tests in Sprint 2+ using Jest or Vitest.
What's inside
22 test cases across basic CI, enhanced CI, and notes sections, each with goal, steps, and expected result.
Change this for your project
- Replace
fttcata/group35stripewith your own repository name - Replace
NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY, andNEXT_PUBLIC_BASE_URLwith your own env variables - Replace
db/schema.sql,db/seeds.sql,db/profiles.sql, anddb/guest_checkout.sqlwith your own database file paths
Where it goes
Keep alongside your test suite. Used to define and score model evaluations.
Worth borrowing
- Using shell commands like
grepfor merge conflict markers as a fast pre-build check - Staging CI improvements across sprints to avoid overwhelming initial setup
- Running security and lint checks before build to fail fast
Related Documents
AI Tools for Developers
Curates a personal reference of AI coding tools, models, and setup instructions for VS Code, Xcode, and Cursor.
Evaluating AI Agent Systems: Metrics, Benchmarks, and Quality Assurance (2024-2026)
Surveys 2024-2026 metrics, benchmarks, and monitoring tools for evaluating AI agent systems, with recommendations for a self-improving coding agent.
IATA BCBP Standard Compliance
Documents which IATA BCBP fields and barcode formats a Swift library implements, including Version 8 gender code support.
Voice AI Leaderboards, Benchmarks, and Evaluation Gaps (Jan 2025 -- Feb 2026)
Surveys 20+ voice AI benchmarks from Jan 2025, Feb 2026, identifies evaluation gaps, and provides leaderboard data for STT, TTS, and end-to-end voice agents.