Thanks to visit codestin.com
Credit goes to github.com

Skip to content

testing-farm/cli

Repository files navigation

Testing Farm CLI

Testing Farm CLI tool.

Use cases

Currently the CLI supports:

  • submitting a test request

  • watch a request for completion

  • get a request completion report

Installation

Copr

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/stable

To preview the latest changes merged to main branch, enable the latest copr repository.

dnf copr enable @testing-farm/latest

Only 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

Container

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

Pip

You can local install the tool directly from PyPi.

pip install --user tft-cli

Onboarding to Testing Farm

Note

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.

Usage

Printing tool version

testing-farm version

Request new testing

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
Tip

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.

Watch an existing request

To watch an existing request for completion or get its completion status, use the watch command.

testing-farm watch --id <REQUEST_ID>

Disable colors

The colors can be disabled by setting the NO_COLOR environment variable. See https://no-color.org/ for details.

NO_COLOR=1 testing-farm version

Separate stdout and stderr

By default stderr and stdout streams are squashed as the container uses --tty option. To have separate streams you can set the NO_TTY variable. Please note that in this case the usual nice coloured formatting will be gone.

NO_TTY=1 testing-farm version

Development

Install via Poetry

If you want to develop testing-farm cli tool, install it via Poetry.

poetry install

Tests

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 test

To run pre-commit/tmt/tox tests only:

make pre-commit
make tmt
make tox
Important

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.