Testing and CI Guidelines
Core Principles
- •Strict Containment: Tests MUST NOT make external API calls (LLM, YouTube, Twitter).
- •Fail Fast: Tests should fail immediately if configuration is wrong.
Environment Variables
The test runner (scripts/tasks.ts test) enforces these variables. ALways use them when running tests manually or verifying code.
- •
SKIP_LLM=true: Mocks LLM calls. Agents will try to loadoutput.yamlfrom their run store instead of calling Gemini. - •
DRY_RUN=true: Prevents side effects (uploads, posts).
Running Tests
Always use the project task runner:
bash
npm test # OR npx tsx scripts/tasks.ts test
Writing New Tests
- •Location: Place new tests in
tests/. - •Setup: Import
tests/setup.jsat the top of the file. - •Naming:
*.test.ts. - •Mocking:
- •If testing an Agent, seed the
AssetStorewith expected "outputs" if you expectSKIP_LLMto work. - •Use
AssetStoreto scaffold a temporary run directory.
- •If testing an Agent, seed the
CI Configuration
- •Workflow:
.github/workflows/ci.yml - •The CI runs
npm test. - •Dependencies: ensure all dev tools (like
fs-extra) are indevDependencies.