test: add test tooling and documentation
- Add Makefile with convenient test targets (test, test-integration, test-env-up, test-env-down) - Add .env.test with test-specific configuration - Update .env.example with test configuration options and warnings - Update README.md with comprehensive testing documentation - Document all environment variables with safety warnings This makes it easy to run tests without rate limiting issues while keeping production security intact.
This commit is contained in:
@@ -434,9 +434,25 @@ Comprehensive integration test suite in `cmd/server/tests/`:
|
||||
|
||||
Run integration tests:
|
||||
```bash
|
||||
# Standard test run (may hit rate limits)
|
||||
go test ./cmd/server/tests -v
|
||||
|
||||
# Recommended: Run with test mode enabled to avoid rate limiting
|
||||
TEST_MODE=true RATE_LIMIT_ENABLED=false go test ./cmd/server/tests -run TestIntegrationAPI -v
|
||||
|
||||
# Or with increased rate limits
|
||||
TEST_MODE=true REQUESTS_PER_MINUTE=1000 go test ./cmd/server/tests -run TestIntegrationAPI -v
|
||||
```
|
||||
|
||||
### Test Configuration Options
|
||||
The following environment variables can be used to configure test behavior:
|
||||
|
||||
- **TEST_MODE**: Set to `true` to enable test mode (logs additional info)
|
||||
- **RATE_LIMIT_ENABLED**: Set to `false` to disable rate limiting for tests
|
||||
- **REQUESTS_PER_MINUTE**: Increase rate limit (e.g., `1000`) to avoid throttling
|
||||
|
||||
**⚠️ WARNING**: Never disable rate limiting or enable test mode in production environments. These settings are only for integration testing.
|
||||
|
||||
### API Testing
|
||||
```bash
|
||||
# Install Bruno
|
||||
|
||||
Reference in New Issue
Block a user