LinuxCommandLibrary

tmt-run

Execute tests within the Test Management Tool

TLDR

Run all test steps for each plan

$ tmt run
copy

Run only the discover step to show what tests would be run
$ tmt run discover -v
copy

Run all steps and adjust the provision step options
$ tmt run --all provision --how [container] --image [fedora:rawhide]
copy

Run only selected plans and tests
$ tmt run plan --name [/plan/name] test --name [/test/name]
copy

Show results from the last run in a web browser
$ tmt run --last report --how [html] --open
copy

Run tests with the provided context
$ tmt run --context [key=value] -c [distro=fedora]
copy

Run tests interactively (debug test code in the middle of a test)
$ tmt run --all execute --how [tmt] --interactive
copy

Use dry mode to see what actions would happen and use the highest verbosity
$ tmt run --dry -vvv
copy

SYNOPSIS

tmt run [options]

PARAMETERS

--help
    Show help message and exit.

--version
    Show program's version number and exit.

-v, --verbose
    Increase verbosity level. May be specified multiple times.

-q, --quiet
    Decrease verbosity level. May be specified multiple times.

--debug
    Enable debug mode.

--plan PLAN
    Plan(s) to use. Default is all plans.

--test TEST
    Test(s) to use. Default is all tests.

--case CASE
    Specific test case(s) to use. Default is all test cases.

--fmf-id FMF_ID
    Limit tests to ones matching the fmf id.

--what [prepare|execute|report]
    Choose what stages to run. Defaults to all.

--how METHOD
    Choose method for all stages

--all
    Run all available stages, including skipped.

--continue
    Continue even if a test fails.

--fresh
    Start with a fresh working directory.

--distro DISTRO
    The guest distro to use for testing. Defaults to the environment the test is run in.

DESCRIPTION

The `tmt-run` command is the primary tool for executing tests managed by the Test Management Tool (tmt). It reads test definitions, configures the test environment, and runs the tests. It is a powerful wrapper around actual test execution. The test results are collected, reported, and optionally archived. The command orchestrates the process defined in the `tmt` metadata, allowing for consistent and reproducible test runs across different environments. It leverages various plugins to support diverse testing frameworks and execution methods. The user can control the execution via command line options or through `tmt` configuration files and project structure. `tmt-run` also handles test environment setup and tear down. The output and logging facilities are designed to ease debugging and test reporting. The command handles all the phases like prepare, execute and report. The run command is intended to execute tests based on the plan details.

CAVEATS

Some features might be dependent on specific plugins being installed and configured.

EXIT STATUS

The exit status of `tmt-run` reflects the overall success of the test execution. A zero exit status indicates that all tests passed, while a non-zero exit status indicates that at least one test failed or an error occurred during the test run. The exact exit code provides further information about the nature of the failure.

TEST DISCOVERY

The `tmt-run` command automatically discovers tests based on the plan and test definitions. It searches for tests within the project directory and its subdirectories, using metadata files to identify and configure each test. The framework also enables tests to be filtered by name, ID, or other criteria.

HISTORY

The `tmt-run` command is a core component of the Test Management Tool (tmt), which was developed to streamline test management workflows.
It is actively maintained and improved to support diverse testing needs.

SEE ALSO

tmt(1), tmt-init(1), tmt-report(1)

Copied to clipboard