Core

I want to have common core attributes used consistently across all metadata levels.

adjust

Adjust metadata based on the given context

As a user I want to adjust test, plan or story metadata based on the given context such as product, distribution, architecture or trigger.

The adjust attribute allows to modify arbitrary object metadata based on the context in which they are to be used. For example, tests may be relevant only for given environment, the set of required packages may differ across distributions or there might be a different set of plans executed for pull requests versus for the full compose integration testing.

Note

The context currently has to be specified explicitly, see the Context documentation for details. In the future, tmt will detect (at least some of) the needed information from the environment.

The value can be a dictionary or a list of dictionaries which represent individual rules to be applied. Each rule contains metadata to be merged into the original object. The following three keys are reserved for rule evaluation:

when
The condition to be evaluated in order to decide if the metadata should be merged. In the expression, you can use any defined context dimension. See the full condition syntax for details about supported operators. This is a required key.
continue
By default, all provided rules are evaluated. When set to false, the first successful rule finishes the evaluation and the rest is ignored.
because
An optional comment with justification of the adjustment. Should be a plain string.

Note

This covers and extends the original concept of Test Case Relevancy which is now obsoleted.

Examples:

# Disable a test for older distros
enabled: true
adjust:
    enabled: false
    when: distro < fedora-33
    because: the feature was added in Fedora 33

# Adjust the required package name
require: procps-ng
adjust:
  - require: procps
    when: distro == centos-6

# Extend the environment variables, use multiple rules
adjust:
  - environment+:
        SH: bash
    when: component == bash
    continue: true
  - when: distro < centos-6
    enabled: false

# Install the fresh pytest from pip on older distros
adjust:
    prepare+:
     - how: shell
       name: fresh-pytest
       order: 90
       script: 'python3 -m pip install -U pytest'
    when: distro < rhel-8

Status: implemented and verified

description

Detailed description of the object

Multiline string describing all important aspects of the object. Usually spans across several paragraphs. For detailed examples using a dedicated attributes ‘examples’ should be considered.

Status: implemented

enabled

Allow disabling individual tests, plans or stories

As a developer or tester I want selected tests or plans to be skipped during test execution.

When a test or a plan is broken or it is not relevant for given Context it can be disabled so that it’s skipped during the execution. For stories, this attribute might be used to mark stories which should be skipped when generating the documentation.

Should be a boolean. The default value is true.

Examples:

# Mark as disabled
enabled: false

# Disable for older distros
enabled: true
adjust:
    enabled: false
    when: distro < fedora-33
    because: the feature was added in Fedora 33

# List only enabled tests
tmt tests ls --filter enabled:true

Status: implemented and verified

order

Order in which the object should be handled

Note

This is a draft, the story is not implemented yet.

Sometimes it is important in which order objects are processed. For example when running tests we need to execute some tests first or when exporting stories we need to arrange content in the right sequence to create a meaningful documentation. Should be and integer.

Status: idea

summary

Concise summary describing purpose of the object

Should be a one-line string with up to 50 characters. It is challenging to be both concise and descriptive, but that is what a well-written summary should do.

Status: implemented