codowave
v1.1.4
Published
AI-powered code analysis and bug detection CLI
Downloads
2,712
Maintainers
Readme
E2E Tests
This directory contains end-to-end tests for the webhook service, configured to run against the Dokploy Redis instance at 10.0.1.9.
Prerequisites
- Node.js 20+
- Access to Redis at
10.0.1.9:6379 - All dependencies installed (
npm install)
Quick Start
# Run all E2E tests
npm run test:e2e
# Run specific test file
npx vitest run e2e/webhook/webhook.test.ts
# Watch mode (re-run on file changes)
npm run test:e2e:watchConfiguration
E2E tests use environment variables for Redis connection:
| Variable | Default | Description |
| ----------------------- | ---------- | ----------------------- |
| REDIS_HOST | 10.0.1.9 | Redis server IP |
| REDIS_PORT | 6379 | Redis server port |
| REDIS_CONNECT_TIMEOUT | 5000 | Connection timeout (ms) |
| REDIS_COMMAND_TIMEOUT | 5000 | Command timeout (ms) |
Local Overrides
To override settings for local development:
# Create local override file
cp .env.test .env.test.local
# Edit .env.test.local with your settings
REDIS_HOST=localhost
REDIS_PORT=6379The .env.test.local file is gitignored and won't be committed.
Test Structure
e2e/
├── config/
│ └── redis.config.ts # Redis configuration with validation
├── helpers/
│ ├── redis-client.ts # Redis client factory
│ └── test-isolation.ts # Test data cleanup utilities
├── setup/
│ └── redis-setup.ts # Vitest setup/teardown
└── webhook/
└── webhook.test.ts # Webhook E2E testsTest Isolation
Tests use prefixed keys to ensure isolation:
e2e:test:{test-id}:{timestamp}:{key-suffix}All test data is automatically cleaned up after each test.
Troubleshooting
Connection refused
# Verify Redis is accessible
redis-cli -h 10.0.1.9 -p 6379 ping
# Should return: PONGTests timing out
Check network latency to Redis and adjust timeouts in .env.test:
REDIS_CONNECT_TIMEOUT=10000
REDIS_COMMAND_TIMEOUT=10000Flaky tests
Enable retry mode:
npx vitest run e2e/ --retry=3CI/CD Integration
Tests are designed to run in CI/CD pipelines with the configured Redis host:
# Example GitHub Actions
- name: Run E2E Tests
env:
REDIS_HOST: 10.0.1.9
REDIS_PORT: 6379
run: npm run test:e2e