docs: Update AGENTS.md with CI testing infrastructure details
- Documented the containerized CI approach using docker-compose.ci.yml - Added instructions for local CI testing with test-ci-locally.sh - Explained benefits of the approach (reproducibility, simplicity) - Updated .gitignore to ignore SurrealDB data directory 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -46,3 +46,6 @@ tests/playwright/.auth/
|
||||
|
||||
# claude settings (keep .claude/CLAUDE.md but ignore user settings)
|
||||
.claude/settings.local.json
|
||||
|
||||
# surrealdb data
|
||||
surreal/data/
|
||||
|
||||
43
AGENTS.md
43
AGENTS.md
@@ -160,28 +160,51 @@ Playwright is integrated into docker-compose for consistent testing environments
|
||||
|
||||
**CI/CD with Gitea Actions**:
|
||||
|
||||
Magnitude tests run automatically on every push and pull request via Gitea Actions:
|
||||
Magnitude tests run automatically on every push and pull request using a fully containerized setup:
|
||||
|
||||
1. **Configuration**: `.gitea/workflows/magnitude.yml`
|
||||
|
||||
2. **Workflow steps**:
|
||||
- Checkout code
|
||||
- Setup Node.js and pnpm
|
||||
- Start SurrealDB in Docker
|
||||
- Start Next.js dev server with environment variables
|
||||
- Run Magnitude tests
|
||||
- Upload test results as artifacts
|
||||
2. **Workflow steps** (simplified to just 2 steps!):
|
||||
- Create `.env` file with secrets
|
||||
- Run `docker compose -f docker-compose.ci.yml --profile test up`
|
||||
- Upload test results and show logs on failure
|
||||
- Cleanup
|
||||
|
||||
3. **Required Secrets** (configure in Gitea repository settings):
|
||||
- `ANTHROPIC_API_KEY` - For Magnitude AI vision testing
|
||||
- `TEST_BLUESKY_HANDLE` - Test account handle
|
||||
- `TEST_BLUESKY_PASSWORD` - Test account password
|
||||
- `SURREALDB_USER`, `SURREALDB_PASS`, `SURREALDB_NS`, `SURREALDB_DB`
|
||||
- `ATPROTO_CLIENT_ID`, `ATPROTO_REDIRECT_URI`
|
||||
- `GOOGLE_API_KEY`, `DEEPGRAM_API_KEY`
|
||||
- `SURREAL_JWT_SECRET`
|
||||
|
||||
4. **Test results**: Available as workflow artifacts for 30 days
|
||||
4. **CI-specific docker-compose**: `docker-compose.ci.yml`
|
||||
- Fully containerized (SurrealDB + Next.js + Magnitude)
|
||||
- Excludes surrealmcp (only needed for local MCP development)
|
||||
- Health checks ensure services are ready before tests run
|
||||
- Uses in-memory SurrealDB for speed
|
||||
- Services dependency chain: magnitude → nextjs → surrealdb
|
||||
|
||||
5. **Debugging CI failures locally**:
|
||||
```bash
|
||||
# Runs the EXACT same docker-compose setup as CI
|
||||
./scripts/test-ci-locally.sh
|
||||
|
||||
# Or manually:
|
||||
docker compose -f docker-compose.ci.yml --profile test up \
|
||||
--abort-on-container-exit \
|
||||
--exit-code-from magnitude
|
||||
```
|
||||
Since CI just runs docker-compose, you can reproduce failures **exactly** without any differences between local and CI environments!
|
||||
|
||||
6. **Test results**: Available as workflow artifacts for 30 days
|
||||
|
||||
7. **Why this approach is better**:
|
||||
- ✅ Identical local and CI environments (both use same docker-compose.ci.yml)
|
||||
- ✅ Fast debugging (no push-test-fail cycles)
|
||||
- ✅ Self-contained (all dependencies in containers)
|
||||
- ✅ Simple (just 2 steps in CI workflow)
|
||||
- ✅ Reproducible (docker-compose ensures consistency)
|
||||
|
||||
**Testing Framework Separation**:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user