Add integration testing guide and prompts
- docs/workflow/INTEGRATION-TESTING.md - Full guide on integration testing - What it is vs unit/e2e tests - 5 principles to test per integration point - Folder structure suggestions - Self-improving loop for human findings - integration-tests/ - Template for project's integration tests - README.md - What to test (Feynman fills per project) - package.json - Test runner setup - scripts/setup.sh - Service startup - scripts/teardown.sh - Cleanup - docs/workflow/WORKFLOW.md - Added integration testing references - docs/workflow/AGENT-PROMPTS.md - Added integration testing prompts - docs/workflow/INDEX.md - Updated file structure
This commit is contained in:
102
integration-tests/README.md
Normal file
102
integration-tests/README.md
Normal file
@@ -0,0 +1,102 @@
|
||||
# Integration Tests
|
||||
|
||||
**This file documents what integration tests should exist in this project.**
|
||||
|
||||
Feynman will fill this out by surveying the codebase. Human reviews and approves.
|
||||
|
||||
---
|
||||
|
||||
## Integration Points
|
||||
|
||||
| # | From System | To System | What We Test | Status |
|
||||
|---|------------|----------|--------------|--------|
|
||||
| — | — | — | — | — |
|
||||
|
||||
---
|
||||
|
||||
## What to Test Per Integration Point
|
||||
|
||||
For each integration point above, document what to test:
|
||||
|
||||
### Integration Point #1: [FILL: System A ↔ System B]
|
||||
|
||||
**What to test:**
|
||||
|
||||
1. **Happy Path**
|
||||
- [ ] TODO
|
||||
|
||||
2. **Data Integrity**
|
||||
- [ ] TODO
|
||||
|
||||
3. **Error Handling**
|
||||
- [ ] TODO
|
||||
|
||||
4. **Auth**
|
||||
- [ ] TODO
|
||||
|
||||
5. **Timing/Async**
|
||||
- [ ] TODO
|
||||
|
||||
---
|
||||
|
||||
## Known Integration Test Gaps
|
||||
|
||||
<!-- Issues or TODOs for missing tests -->
|
||||
|
||||
- TODO: [Describe missing test]
|
||||
|
||||
---
|
||||
|
||||
## Tests to Implement
|
||||
|
||||
| # | Test Description | Integration Point | Status |
|
||||
|---|-----------------|------------------|--------|
|
||||
| 1 | TODO | TODO | TODO |
|
||||
|
||||
---
|
||||
|
||||
## Human Findings (Regression Tests Added)
|
||||
|
||||
When human finds a bug during manual testing, document it here. Agent implements a regression test.
|
||||
|
||||
| Date | What Human Found | Test Added? | Test File |
|
||||
|------|------------------|-------------|-----------|
|
||||
| — | — | — | — |
|
||||
|
||||
---
|
||||
|
||||
## How to Run Tests
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Setup services (if needed)
|
||||
pnpm run test:integration:setup
|
||||
|
||||
# Run all integration tests
|
||||
pnpm run test:integration
|
||||
|
||||
# Run specific integration point tests
|
||||
pnpm run test:integration -- --grep "auth"
|
||||
|
||||
# Teardown (if needed)
|
||||
pnpm run test:integration:teardown
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Services Required for Tests
|
||||
|
||||
<!-- Document what services need to be running for tests to pass -->
|
||||
|
||||
| Service | How to Start | Port | Notes |
|
||||
|---------|-------------|------|-------|
|
||||
| — | — | — | — |
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
<!-- Any project-specific notes about testing -->
|
||||
|
||||
15
integration-tests/package.json
Normal file
15
integration-tests/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "integration-tests",
|
||||
"version": "1.0.0",
|
||||
"description": "Integration tests for this project",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:setup": "bash scripts/setup.sh",
|
||||
"test:teardown": "bash scripts/teardown.sh"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "latest"
|
||||
}
|
||||
}
|
||||
26
integration-tests/scripts/setup.sh
Normal file
26
integration-tests/scripts/setup.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Setup script for integration tests
|
||||
# Run this before tests to start required services
|
||||
#
|
||||
# Edit this file to match your project's needs.
|
||||
#
|
||||
|
||||
echo "=========================================="
|
||||
echo "Integration Tests Setup"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
# TODO: Add commands to start services
|
||||
# Example:
|
||||
# echo "Starting backend server..."
|
||||
# cd ../backend && pnpm start &
|
||||
# sleep 5
|
||||
#
|
||||
# echo "Starting database..."
|
||||
# docker compose up -d db
|
||||
|
||||
echo "Setup complete. Services should be running."
|
||||
echo ""
|
||||
echo "Run tests with: pnpm test"
|
||||
echo ""
|
||||
23
integration-tests/scripts/teardown.sh
Normal file
23
integration-tests/scripts/teardown.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Teardown script for integration tests
|
||||
# Run this after tests to clean up services
|
||||
#
|
||||
# Edit this file to match your project's needs.
|
||||
#
|
||||
|
||||
echo "=========================================="
|
||||
echo "Integration Tests Teardown"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
# TODO: Add commands to stop services
|
||||
# Example:
|
||||
# echo "Stopping backend server..."
|
||||
# pkill -f "node.*backend"
|
||||
#
|
||||
# echo "Stopping database..."
|
||||
# docker compose down
|
||||
|
||||
echo "Teardown complete."
|
||||
echo ""
|
||||
Reference in New Issue
Block a user