Quick Setup
Running TestDriver in CI requires just three things:1
Install Dependencies
2
Set API Key
3
Run Tests
Platform-Specific Setup
- GitHub Actions
- GitLab CI
- CircleCI
- Jenkins
.github/workflows/test.yml
Storing API Keys
Store your TestDriver API key securely in CI secrets:GitHub Actions
- Go to repository Settings → Secrets
- Click “New repository secret”
- Name:
TD_API_KEY - Value: Your API key
GitLab CI
- Go to Settings → CI/CD → Variables
- Click “Add variable”
- Key:
TD_API_KEY - Value: Your API key
- Check “Mask variable”
CircleCI
- Project Settings → Environment Variables
- Click “Add Environment Variable”
- Name:
TD_API_KEY - Value: Your API key
Jenkins
- Manage Jenkins → Credentials
- Add Credentials → Secret text
- ID:
testdriver-api-key - Secret: Your API key
Parallel Execution
Run tests in parallel for faster CI builds:- GitHub Actions Matrix
- GitLab CI Parallel
- CircleCI Parallelism
Generating Reports
Create test reports for CI dashboards:- JUnit XML
- HTML Report
- JSON Report
Handling Test Failures
Capture debug information when tests fail:.github/workflows/test.yml
Caching for Faster Builds
Cache node_modules for faster CI runs:- GitHub Actions
- GitLab CI
- CircleCI
Notifications
Send notifications on test failures:- Slack
- Email
- Teams
Branch Protection
Require tests to pass before merging:1
GitHub
- Go to Settings → Branches
- Add rule for main branch
- Check “Require status checks to pass”
- Select “test” job
2
GitLab
- Settings → Repository → Protected branches
- Select main branch
- Set “Allowed to merge” to “Developers + Maintainers”
- Enable “Pipelines must succeed”
Cost Optimization
Reduce CI costs with TestDriver:1. Leverage Test Caching
1. Leverage Test Caching
First CI run: Slow (builds cache)
Subsequent runs: 1.7x faster (uses cache)No configuration needed - automatic!
2. Run Only Changed Tests
2. Run Only Changed Tests
3. Use Parallel Execution
3. Use Parallel Execution
4. Skip Tests on Documentation Changes
4. Skip Tests on Documentation Changes
Monitoring CI Performance
Track test performance over time:Troubleshooting CI
Tests Pass Locally, Fail in CI
Tests Pass Locally, Fail in CI
Common causes:
- Environment differences - Check Node version matches
- Missing environment variables - Verify
TD_API_KEYis set - Timeout too short - Increase test timeout
- Network restrictions - Check firewall allows TestDriver API
Intermittent Failures
Intermittent Failures
Solutions:
-
Increase timeout:
vitest.config.mjs
-
Add retries:
vitest.config.mjs
- Check Dashcam replays for both passing and failing runs
Rate Limiting
Rate Limiting
If running many tests concurrently:Contact sales for higher rate limits.
vitest.config.mjs

