Comprehensive testing documentation for the Ambient Code Platform.
Location: e2e/
Framework: Cypress
Environment: Kind cluster (Kubernetes in Docker)
Purpose: Test complete user journeys against a deployed platform instance.
Quick Start:
make kind-up
make test-e2e
make kind-downDocumentation:
- E2E Testing README - Complete guide
- E2E Testing Guide - Writing tests
- Kind Local Dev - Environment setup
Test Suites:
vteam.cy.ts(5 tests) - Platform smoke testssessions.cy.ts(7 tests) - Session management- Runtime: ~15 seconds total
Location: components/backend/tests/
Test Types:
- Unit Tests - Component logic in isolation
- Contract Tests - API contract validation
- Integration Tests - End-to-end with real Kubernetes cluster
Quick Start:
cd components/backend
make test # All tests
make test-unit # Unit only
make test-contract # Contract only
make test-integration # Integration (requires cluster)Documentation: Backend Test Guide
Location: components/frontend/
Test Types:
- Component Tests - React component testing (Jest)
- E2E Tests - User interface testing (Cypress)
Quick Start:
cd components/frontend
npm test
npm run lint
npm run build # Must pass with 0 errors, 0 warningsDocumentation: Frontend README
Location: components/operator/
Test Types:
- Controller reconciliation tests
- CRD validation tests
- Watch loop tests
Quick Start:
cd components/operator
go test ./... -vDocumentation: Operator README
Local Development:
- Run unit tests during development
- Run contract tests before commit
- Run integration tests before PR
Pull Request:
- All tests run automatically in CI
- E2E tests run in Kind cluster
- Linting and formatting checks
Before Merge:
- ✅ All tests passing
- ✅ Linting clean
- ✅ Code reviewed
| Environment | Purpose | Setup |
|---|---|---|
| Unit | Fast feedback | Local machine |
| Contract | API validation | Local machine |
| Integration | K8s integration | Kind or test cluster |
| E2E | Full system | Kind cluster |
GitHub Actions Workflows:
e2e.yml- E2E tests in Kind on every PRgo-lint.yml- Go code quality checksfrontend-lint.yml- Frontend quality checkstest-local-dev.yml- Local dev environment validation
# All E2E tests
make test-e2e-local
# Backend tests
cd components/backend && make test
# Frontend tests
cd components/frontend && npm test
# Operator tests
cd components/operator && go test ./...
# Run linters
make lintKind (Local):
make kind-up
make test-e2eExternal Cluster:
export CYPRESS_BASE_URL=https://your-frontend.com
export TEST_TOKEN=$(oc whoami -t)
cd e2e && npm test- Backend: Check with
make test-coveragein backend directory - Frontend: Check with
npm run coverage(if configured) - E2E: 12 tests covering critical user journeys
- Backend: Aim for 60%+ coverage
- Critical paths: 80%+ coverage
- New features: Must include tests
cd e2e
npm run test:headed # Opens Cypress UIcd components/backend
go test ./... -v -run TestSpecificTest# E2E test logs
cat e2e/cypress/videos/*.mp4 # Test recordings
cat e2e/cypress/screenshots/*.png # Failure screenshots
# Backend test logs
cd components/backend && go test ./... -v 2>&1 | tee test.logE2E Tests:
- Test user journeys, not isolated elements
- Reuse workspaces across tests
- Use meaningful test descriptions
- Keep tests fast (<30 seconds each)
Backend Tests:
- Use table-driven tests (Go convention)
- Mock external dependencies
- Test error cases
- Follow patterns in existing tests
Frontend Tests:
- Test component behavior, not implementation
- Mock API calls
- Test accessibility
- Test error states
See existing tests for patterns:
e2e/cypress/e2e/vteam.cy.ts- E2E test patternscomponents/backend/handlers/*_test.go- Backend test patterns
- Check Kind cluster is running:
kubectl get pods -n ambient-code - Verify frontend is accessible:
curl http://localhost:8080 - Check test logs in
e2e/cypress/videos/
- Check cluster connection:
kubectl cluster-info - Verify namespace exists:
kubectl get ns ambient-code - Check permissions:
kubectl auth can-i create jobs -n ambient-code
- Environment differences (check GitHub Actions logs)
- Timeout issues (CI may be slower)
- Resource constraints (CI has memory limits)
Related Documentation: