โก EXECUTION INSTRUCTIONS FOR CLAUDE
When this command is invoked, YOU (Claude) must execute these steps immediately:
This is NOT documentation - these are COMMANDS to execute right now.
Use TodoWrite to track progress through multi-phase workflows.
๐จ EXECUTION WORKFLOW
Phase 1: Workflow
Action Steps:
- Run Capture: Execute
/testerc to collect fresh data
- Review Data: Examine captured responses in
./test_data_capture/
- Update Mocks: Use captured data to improve
FakeFirestoreClient and FakeGeminiResponse
- Validate Accuracy: Run
/teste to ensure mocks match real behavior
- Commit Updates: Include updated mock data in version control
Phase 2: Next Steps After Capture
Action Steps:
- Review Captures: Check
./test_data_capture/ contents
- Generate Mocks: Create scripts to update mock classes from captured data
- Run Real Tests: Execute
/tester to get baseline real service behavior
- Validate Mocks: Run
/teste and compare results to /tester output to ensure mocks match real behavior
- Document Changes: Record what service behaviors changed
- Regular Refresh: Schedule periodic recaptures to keep mocks current
๐ REFERENCE DOCUMENTATION
/testerc - End2End Tests (Real Mode + Capture)
Purpose: Run end-to-end tests using real services AND capture data for mock generation
Usage: /testerc
Script: ./claude_command_scripts/testerc.sh
Description
Runs the full end2end test suite using real services with comprehensive data capture:
- Real Firestore database operations (captured)
- Real Gemini API interactions (captured)
- Full persistence validation
- Generates data for updating mock implementations
Prerequisites
Required Environment Variables:
export REAL_FIREBASE_PROJECT=worldarchitect-test
export REAL_GEMINI_API_KEY=your_test_api_key
Capture Directory: ./test_data_capture/
- Created automatically
- Previous captures cleared on each run
- Contains JSON files with service interactions
Environment
TEST_MODE=capture
TESTING=true
FIREBASE_PROJECT_ID=$REAL_FIREBASE_PROJECT
GEMINI_API_KEY=$REAL_GEMINI_API_KEY
CAPTURE_OUTPUT_DIR=./test_data_capture
Data Capture
Captured Data Types:
- ๐ก Gemini Requests: All API calls with parameters
- ๐ก Gemini Responses: Full response objects and metadata
- ๐ก Firestore Operations: Database reads, writes, queries
- ๐ก Firestore Data: Document structures and field types
- โฑ๏ธ Timing Data: Service response times and patterns
- ๐ Error Cases: Failed requests and error responses
Output Structure:
./test_data_capture/
โโโ gemini_requests.json
โโโ gemini_responses.json
โโโ firestore_operations.json
โโโ firestore_documents.json
โโโ timing_data.json
โโโ test_metadata.json
Use Cases
- Mock Generation: Create accurate mock data from real service responses
- Behavior Documentation: Record actual service behavior patterns
- Regression Detection: Compare new captures with previous baselines
- Service Evolution: Track how external services change over time
- Test Data Refresh: Update test fixtures with fresh real data
Benefits
- ๐ฏ Accurate Mocks: Ensures test doubles match real service behavior
- ๐ Bug Prevention: Identifies mock/reality gaps that hide bugs
- ๐ Continuous Improvement: Regular captures keep mocks current
- ๐ Documentation: Captured data serves as service behavior spec
- ๐ Automation Ready: Captured data can drive mock generation scripts
Safety Features
- โ ๏ธ Confirmation prompt (costs money + captures sensitive data)
- ๐งน Automatic test data cleanup
- ๐ Organized capture directory structure
- ๐ Capture data excluded from git (add to .gitignore)
Related Commands
/teste - Mock mode validation
/tester - Real mode without capture