testdriver-agent
How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
Run TestDriver tests in CI/CD with parallel execution and cross-platform support
$ npx -y skills add testdriverai/testdriverai --skill testdriver-ci-cd --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testdriver-ci-cdContext preview
The summary Claude sees to decide when to auto-load this skill.
Run TestDriver tests in CI/CD with parallel execution and cross-platform support
name: testdriver:ci-cd description: Run TestDriver tests in CI/CD with parallel execution and cross-platform support
<!-- Generated from ci-cd.mdx. DO NOT EDIT. -->
TestDriver integrates seamlessly with popular CI providers, enabling automated end-to-end testing on every push and pull request.
On **GitHub Actions, prefer OIDC** via the published `testdriverai/action` — there's no `TD_API_KEY` secret to store, copy, or rotate. The action proves the workflow is running inside your org and TestDriver exchanges that proof for your team's key at run time. See the GitHub Actions tab below.
For other CI providers (or self-hosted runners without OIDC), fall back to a stored API key from [console.testdriver.ai/settings](https://console.testdriver.ai/settings), added as a `TD_API_KEY` secret in your CI provider's settings.
<Note> Never commit your API key directly in code. Always use OIDC or your CI provider's secrets management. </Note>
<Tabs> <Tab title="GitHub Actions">
Use the published [`testdriverai/action`](https://github.com/testdriverai/action) — it mints the OIDC token, exchanges it for your team's API key, and exports `TD_API_KEY` for the steps that follow. **No `TD_API_KEY` secret to store or rotate.**
<Note> One-time setup: authorize the [TestDriver GitHub App](https://console.testdriver.ai) for your org so the org → team binding exists. If your org authorized the App before OIDC support shipped, re-authorize once. If the App isn't authorized, the action fails with a console link (or falls back to the `api-key` secret if you provide one). </Note>
name: TestDriver Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
permissions:
id-token: write # REQUIRED to mint an OIDC token
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Authenticate to TestDriver
uses: testdriverai/action@stable # pin @stable / @canary / @test to your SDK channel
with:
api-key: ${{ secrets.TD_API_KEY }} # optional fallback if OIDC isn't set up
- name: Run TestDriver tests
run: npx vitest runOnly if you can't use OIDC (e.g. self-hosted runners without an OIDC provider). Add the key as a secret and pass it via `env`:
1. Navigate to your GitHub repository 2. Go to **Settings** → **Secrets and variables** → **Actions** 3. Click **New repository secret** 4. Name: `TD_API_KEY`, Value: your API key 5. Click **Add secret**
Create `.github/workflows/testdriver.yml`:
name: TestDriver Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Run TestDriver tests
env:
TD_API_KEY: ${{ secrets.TD_API_KEY }}
run: vitest --runUse matrix strategy to run tests in parallel:
name: TestDriver Tests (Parallel)
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Run tests (shard ${{ matrix.shard }}/4)
env:
TD_API_KEY: ${{ secrets.TD_API_KEY }}
run: vitest --run --shard=${{ matrix.shard }}/4 name: TestDriver Tests (Multi-Platform)
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
td-os: [linux, windows]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Run tests on ${{ matrix.td-os }}
env:
TD_API_KEY: ${{ secrets.TD_API_KEY }}
TD_OS: ${{ matrix.td-os }}
run: vitest --run</Tab>
<Tab title="GitLab CI">
1. Go to your GitLab project 2. Navigate to **Settings** → **CI/CD** → **Variables** 3. Click **Add variable** 4. Key: `TD_API_KEY`, Value: your API key 5. Check **Mask variable** and click **Add variable**
Create `.gitlab-ci.yml`:
stages:
- test
testdriver:
stage: test
image: node:20
cache:
paths:
- node_modules/
script:
- npm ci
- vitest --run
variables:
TD_API_KEY: $TD_API_KEY stages:
- test
.testdriver-base:
stage: test
image: node:20
cache:
paths:
- node_modules/
before_script:
- npm ci
variables:
TD_ARepo: testdriverai/testdriverai
How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
Deploy TestDriver on your AWS infrastructure using CloudFormation
How TestDriver learns your app and caches what it discovers for instant, deterministic replays