This directory contains real AWS integration tests that actually deploy resources.
- AWS credentials configured
- Sufficient IAM permissions to create/delete CloudFormation stacks
- A dedicated test AWS account (recommended)
# Run all integration tests
npm run test:integ
# Run a specific test
npx vitest run integ-tests/deploy.test.ts --testTimeout=300000All integration test files should be prefixed with integ.:
integ.deploy.ts- Tests actual deploymentinteg.invoke.ts- Tests invoking deployed agentsinteg.destroy.ts- Tests stack destructioninteg.e2e.ts- Full end-to-end lifecycle test
Integration tests are NOT run automatically on every PR. They can be triggered:
- Manually via GitHub Actions workflow_dispatch
- On a schedule (if configured)
- Before releases
import { runCLI } from '../src/test-utils/cli-runner';
import { afterAll, describe, expect, it } from 'vitest';
describe('integ: deploy', () => {
// Use unique stack names to avoid conflicts
const stackName = `test-${Date.now()}`;
afterAll(async () => {
// ALWAYS clean up - destroy the stack
await runCLI(['destroy', '--target', stackName, '--force'], projectDir);
});
it('deploys successfully', async () => {
// Test implementation
});
});- Integration tests create real AWS resources and may incur costs
- Always include cleanup in
after()hooks - Use unique names to avoid conflicts with parallel runs
- Set appropriate timeouts (5-15 minutes for deploy operations)