diff --git a/AGENTS.md b/AGENTS.md index e79b019b7..acae041f7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -190,13 +190,14 @@ packages/core/src/ ### CI/CD Integration -- GitHub Actions runs `yarn install` and `yarn test` +- GitHub Actions unit tests run in `.github/workflows/test-unit.yml` as a matrix (`core`, `web`, `backend`, `scripts`) using `yarn test ` on `push`. +- End-to-end tests run separately in `.github/workflows/test-e2e.yml` on pull requests to `main`. ## Troubleshooting ### Common Issues -- **Test failures**: Run `yarn test:core`, `yarn test:web`, and `yarn test:backend` individually to narrow the scope of the failure +- **Test failures**: Run `yarn test:core`, `yarn test:web`, `yarn test:backend`, and `yarn test:scripts` individually to narrow the scope of the failure - **Backend won't start**: Missing environment variables in `packages/backend/.env`, use web-only development (`yarn dev:web`) - Environment: Copy from `packages/backend/.env.local.example` to `packages/backend/.env` (there is no `.env.example`). - Webpack dev server warns about a missing `.env.local` file; this is harmless—it falls back to `process.env`. diff --git a/docs/agent-onboarding.md b/docs/agent-onboarding.md index c17d640e7..00957e35b 100644 --- a/docs/agent-onboarding.md +++ b/docs/agent-onboarding.md @@ -79,5 +79,6 @@ Run the smallest relevant checks first: - Core-only changes: `yarn test:core` - Web-only changes: `yarn test:web` - Backend-only changes: `yarn test:backend` +- Scripts-only changes: `yarn test:scripts` - Cross-package type changes: `yarn test:core && yarn test:web && yarn test:backend` - Before handoff: `yarn type-check` diff --git a/docs/testing-playbook.md b/docs/testing-playbook.md index 639c4d57e..936fa9823 100644 --- a/docs/testing-playbook.md +++ b/docs/testing-playbook.md @@ -16,6 +16,34 @@ yarn type-check Avoid defaulting to `yarn test` unless you really need the full suite. +## CI Unit Test Workflow + +Source of truth: + +- `.github/workflows/test-unit.yml` +- `.github/workflows/test-e2e.yml` + +Unit workflow (`test-unit.yml`): + +- triggers on `push` +- runs a matrix across `core`, `web`, `backend`, and `scripts` +- uses `fail-fast: false`, so one failing lane does not cancel the others +- runs `yarn test ` in each lane after dependency install +- passes timezone through `TZ: ${{ vars.TZ }}` + +Local parity commands: + +```bash +yarn test core +yarn test web +yarn test backend +yarn test scripts +``` + +`yarn test:` aliases are equivalent and usually easier to remember. + +E2E workflow (`test-e2e.yml`) is separate and runs on pull requests to `main` via `yarn test:e2e`. + ## Jest Project Layout Source: