Parameters and test cases
Adding an additional test case
Parameters and test cases are defined in the manifest.toml
file of every test plan. Let's have a look once again at the quickstart/manifest.toml
file and add two test cases to the bottom of the file:
$TESTGROUND_HOME/plans/quickstart/manifest.toml
?> Feel free to add your own galaxybrain
test case as well!
You can confirm that the testground client is able to parse the manifest, and enumerate the cases it declares:
We would like to take these two cases out for a spin. First, let's prepare our code. Open our quickstart
plan program and deal with these parameters!
!> This snippet is routing both test cases to the same function. In practice, you will want to run different logic for each test case!
As you can see, a test plan a simple executable that conforms to the simple Testground contract, which the SDK facilitates. This makes it super easy to debug and develop. There's beauty in simplicity!
$TESTGROUND_HOME/plans/quickstart/main.go
The time has come now to run these test cases. Let's run it!
?> Try using different runners. This command executes the plan with the local:exec
runner and exec:go
builder, but it works just as well with the local:docker
runner or the Kubernetes cluster:k8s
runner (for which you will need to use the docker:go
builder!
Last updated