Testing Farm CLI tool.
Currently the CLI supports:
-
submitting a test request
-
watch a request for completion
-
get a request completion report
The testing-farm cli is available as a RPM package in copr repository.
For released versions, enable the stable copr repository.
dnf copr enable @testing-farm/stableTo preview the latest changes merged to main branch, enable the latest copr repository.
dnf copr enable @testing-farm/latestOnly x86_64 buildroots exist, but the package itself is noarch, so when working on a non-x86_64 platform
please append eg. fedora-42-x86_64 to the dnf copr enable command.
Install testing-farm cli via dnf.
dnf install testing-farm
You can run the tool using the official image via a small wrapper script.
curl -Lo ~/bin/testing-farm "https://gitlab.com/testing-farm/cli/-/raw/main/container/testing-farm" chmod +x ~/bin/testing-farm
In order to get the latest version of the tool, update the container simply using the following command:
testing-farm update
Required only if you will be submitting requests to Testing Farm.
Before using the CLI for submitting requests, you will need to onboard and get an API key.
The CLI requires an API token for most operations. There are two ways to provide it:
Set the TESTING_FARM_API_TOKEN environment variable:
export TESTING_FARM_API_TOKEN=<your-api-token>
Alternatively, you can store the token in your system keyring. The CLI will automatically retrieve it if the environment variable is not set.
System keyring is not available when running the CLI via the container wrapper. Use the environment variable method instead.
To store the token in the keyring:
keyring set https://api.dev.testing-farm.io/v0.1 api-tokenThe URL should match the API endpoint you’re using. For the production Testing Farm, use https://api.dev.testing-farm.io/v0.1 .
The request command makes it easy to request testing on Testing Farm.
Just clone a repository with tmt tests and try it out. Most of the options will be autodetected:
testing-farm request
By default the execution will use container provisioner and the default tmt container - fedora. If you want to test on a VM, define it via --compose option.
List of composes for Public Ranch can be found here.
See the --help for more options.
To watch an existing request for completion or get its completion status, use the watch command.
testing-farm watch --id <REQUEST_ID>
The colors can be disabled by setting the NO_COLOR environment variable.
See https://no-color.org/ for details.
NO_COLOR=1 testing-farm versionIf you want to develop testing-farm cli tool, install it via Poetry.
poetry install
Testing of the project is currently done via:
-
pre-commit- for static analysis -
tmt- for functional and integration testing -
tox- for typing and (later) unit tests
To run all tests:
make testTo run pre-commit/tmt/tox tests only:
make pre-commit make tmt make tox
tmt testing is running against a container image built from the repository checkout. When rerunning tmt tests only, make sure to make build if you have also cli code changes or updated the code, as they will not be picked up automatically.