Checks and tests per repo
Write the failing test first, make it pass, then run the repo's full checks before you open a PR. CI runs the same commands.
Tests first
For a bug fix, add a test that fails for the reported reason. For a feature, add tests for the behavior before the code. Say in the PR's Validation section which tests are new.
Commands by repository
| Repository | Default branch | Runtime | Checks |
|---|---|---|---|
| fantasy-core-pipeline | main | Python 3.11 | black --check . · mypy src/ · DB_PASSWORD=test pytest tests/ -v |
| fantasy-browser-worker | main | Node 20 | npm ci · npm run lint · npm test |
| fantasy-web-ui | master | Node 22 | npm ci · npm run lint · npx tsc -b --noEmit · npm test · npm run build |
| fantasy-infra | main | kubectl, Python 3 | kubectl kustomize overlays/production/ · kubectl kustomize overlays/draft-day/ · ./scripts/preflight-draft-sync-env.sh · python3 scripts/generate-schedules.py --check · ./tests/cronjob_alerts/run.sh |
| fantasy-project | main | Node (see .nvmrc) | npm ci · npm run test:actions · npm run build |
What blocks a merge
In core-pipeline only pytest fails CI; black and mypy report drift without blocking, but keep them clean. Infra's validation workflows use path filters, so they run only on matching changes.
Repository notes
core-pipeline
- Tests use
pytestand FastAPI'sTestClient, and need no database or broker.tests/conftest.pystubs the Postgres pool before collection; keep that patch in place. - Patch
src.api.main.run_migrationsin any test that builds aTestClient, and mockpika.BlockingConnectionfor routes that publish to RabbitMQ. - If a pinned dependency fails to build on a newer local Python, install unpinned versions in a local venv instead of editing the pins.
- After you add or change a route, regenerate the API reference:
DB_PASSWORD=test python scripts/export_openapi.py.tests/test_api_docs.pyfails otherwise. - Enable the optional pre-commit hook, which mirrors CI:
git config core.hooksPath .githooks.
browser-worker
- Tests run with Jest. Format with
npm run format. - Use descriptive named constants for numeric values in application logic, with units in the name, such as
NFL_STATE_TIMEOUT_MS.
web-ui
- Linting uses
oxlint, tests use Vitest, and the build runstsc -bbeforevite build.
infra
- Rendered manifests are deployment-specific. Keep them out of PRs and issues.
- Never commit a plain
Secret. Credentials go through anExternalSecret. - A change that renames a Service, namespace or port can silently break core-pipeline or browser-worker connection defaults.
Verify before you push
- Run your repo's commands from the table, in order.
- Confirm the new test failed before your change and passes after.
- Search your diff for secrets, real IDs, emails and hostnames.
- Update
docs/and tick Docs updated? in the PR.