Managing test plans
The unit for testing in Testground is a test plan also referred to as simply a plan. This document explains the layout of test plans directory in the Testground home directory, as well is tooling for managing local plans.
Anatomy of a test plan
A test plan is a directory which contains the code to be executed during the test and a toml-formatted manifest file, which explains the plan to the Testground system.
Writing new test plans from scratch is covered elsewhere in this tutorial, for now, just know that a test plan is a directory with a test plan manifest and that each test plan may have one or more test cases.
Testground provides some basic functionality to assist importing and creating of test plans.
During execution, an archive of the plan is sent to the Testground daemon, where it is built and executed. Any code or files inside the plan's directory will be available when the plan is built.
Location of test plans
Test plans reside inside the Testground home directory in a subdirectory called plans. The location of the Testground home is governed by an environment variable $TESTGROUND_HOME and has some sane defaults if this variable is unset.
By default, on unix-like operating systems, this directory is in the user's home directory. Don't worry about creating the Testground home directory in advance; it will be created for you when Testground runs.
$ tree $TESTGROUND_HOME
testground
├── data
│ ├── outputs
│ └── work
├── plans # <-- This is where plans will go!
└── sdksPlan management tooling
Test plans can be managed using regular filesystem utilities. However, the Testground tool does have utilities for managing plans which can help to import and manage plans in a predictable way. For the following sections, I'll demonstrate a few management commands along with some standard utilities to explain what the command does.
Creating new plans
?> You can modify the behaviour of plan createusing command-line flags to change the module or add a git remote.
Importing existing plans
Importing existing plans requires a --source flag. The source can be either from the local filesystem or downloaded from a git repository. When importing plans from a local filesystem, a symbolic link is created from the source to the plan directory. When git is used, the plan is imported over any protocol supported by git.
...from the local filesystem
...from a git repository
Listing existing test plans
As you can see from the commands above, we have the ability to create new plans which we will write ourselves or import existing plans or collections of plans. Let's show them all with the list command:
Removing test plans
Finally, let's end by removing a plan we are no longer interested in:
Last updated