GitHub Setup
Deploy your tests to our cloud infrastructure and run them as part of your CI/CD
Installing the GitHub action
TestDriver Cloud Testing is performed via our GitHub action. You can learn more by visiting the marketplace page.
Get your API Key
You'll need a Pro account or higher to use the TestDriver GitHub action
In order to execute your TestDriver actions on our VMs you'll need to add your API key as a GitHub secret. If you don't see an API key, you'll need ot upgrade your account.
Log in the team page in and copy your API key from there.
Paste the API key as a new GitHub secret named
TESTDRIVER_API_KEY
Create your workflow
Now it's time to create your first TestDriver workflow.
In .github/workflows/testdriver.yml
add the following code.
If you used testdriverai init
to create your TestDriver project, these files will already be in your repository.
Notice that on line 21-22
we're interacting with TestDriver just like on our local machine. In this case we're using the /run
command to execute our file from our local directory.
You can also use commands like /explore
, use variables, or supply your prompts dynamically from earlier steps. A common workflow is wait for staging to deploy before executing the test.
How it works
The GitHub action is triggered via the conditions supplied via
on
The
key
value is used to authenticate youAn ephemeral virtual machine is spawn on our infrastructure
The code from the current branch will be cloned on to the VM
Dashcam begins recording
If supplied, the
prerun
shell script runsprompt
is parsed as a markdown list.Each list item from
promp
is fed into TestDriver one by oneTestDriver summarizes the test and sets it's exit code depending on it's pass or failed state
Dashcam ends recording
The VM is destroyed and all data is wiped
Deploy the test
Save the file, make a new branch, push to your repository, and create a new pull request.
This will trigger a new TestDriver execution.
Last updated