Skip to main content

tft-request-watch

Wraps Testing Farm CLI with unattended request supervision.

This package can be found

The Copr packages are provided for all active Fedora releases.

The code is tested on the supported Python versions 3.11, 3.12 and 3.13.

Benefits compared to running testing-farm watch directly:

  • Keep polling through temporary API outages.
  • Enforce a hard timeout with automatic cancellation.
  • Automatically retry the whole request when known retriable infrastructure failures appear in result.summary.
  • Restart only the affected plan(s) when a required test task is aborted due to an infrastructure issue.
  • When result.overall is error and a plan has no testcases, inspect tmt-run.log for the same retriable infrastructure failures and restart those plans.

Install

# from Copr
sudo dnf copr enable @cki/tft-request-watch
sudo dnf install tft-request-watch

# from PyPI
pip install tft-request-watch

# from source
pip install git+https://gitlab.com/redhat/centos-stream/tests/kernel/tft-request-watch

Usage

tft-request-watch provides two subcommands: watch and merge.

watch

Wait for a Testing Farm request to finish, restarting on retriable failures.

tft-request-watch watch --request-id YOUR-REQUEST-UUID

The default API base is https://api.dev.testing-farm.io/v0.1; use --api-url to point elsewhere.

Key options:

Option Description
--request-id UUID Request UUID to watch.
--dry-run Skip write operations; log what would have been done.
--result-file PATH Write per-run results JSON to PATH (needed for merge).
--required-task TASK Restart if task is aborted; see below. Repeatable.
--max-restarts N Maximum restart iterations (default: 3).
--hard-timeout-hours H Cancel request after H hours (default: 24).

--required-task TASK restarts affected plans when a task result is error or pending in the XUnit output. Use the test path without the discover alias prefix (e.g. /distribution/install). Can be specified multiple times.

See tft-request-watch watch --help for all options including HTTP retry and timeout tuning.

Result file format

When --result-file is given, a JSON list is written with one entry per run (original + any restarts):

[
  {"id": "uuid-of-original-run", "xunit_url": "https://...", "...": "..."},
  {
    "id": "uuid-of-retry",
    "retry_of": "uuid-of-original-run",
    "restarted_plans": {"x86_64": ["/plans/tier1"]},
    "xunit_url": "https://...",
    "...": "..."
  }
]

restarted_plans identifies which (arch, plan) testsuites in the original XUnit were replaced by the retry, useful for tft-request-watch merge.

When the API omits xunit_url (common after cancel), watch and merge use {artifacts}/results.xml from the watch JSON artifacts field.

merge

Produce a single merged XUnit XML from a --result-file JSON, replacing testsuites that were restarted with the retry results.

tft-request-watch merge result.json merged.xml

Fetches the XUnit XML for every run recorded in result.json. Testsuites annotated via restarted_plans are taken from the retry; all other testsuites are kept from the original run.

tft-request-watch merge --help

Global options

Option Description
--debug Enable DEBUG logging on stderr.
--version Print version and exit.

Development

Installing development dependencies:

pip install -e . --group dev

Running linting/tests:

tox

Releasing

Every push to main automatically:

  • publishes to PyPI via OIDC trusted publishing,
  • creates a GitLab release (tagged v0.42.0, …),
  • builds in Copr @cki/tft-request-watch via Packit.

The version is semver: the major component lives in tft_request_watch/__init__.py and tft-request-watch.spec (keep in sync), the minor is the GitLab pipeline ID, and patch is always 0 (e.g. 1.42.0, 1.43.0). Bump the major version in both files for breaking changes.

The Copr project depends on @testing-farm/stable (for tft-cli) as an external repository, so users only need dnf copr enable @cki/tft-request-watch.

License

GPLv2+ — see LICENSE.

Metadata

Release files for tft-request-watch 1.88.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tft-request-watch 1.88.0
File Size Uploaded Provenance Actions
tft_request_watch-1.88.0.tar.gz 32.1 kB Without provenance Details for tft_request_watch-1.88.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tft-request-watch 1.88.0
File Interpreter ABI Platform Actions
tft_request_watch-1.88.0-py3-none-any.whl Python 3 none any Details for tft_request_watch-1.88.0-py3-none-any.whl

Total release size: 56.6 kB

Release files / tft_request_watch-1.88.0.tar.gz

Download URL tft_request_watch-1.88.0.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
808cd096e8c22a9965ba548f44e9abcd7ff0fdec9a3dc50090b3bc9fe2c0399a
BLAKE2b-256 checksum
How to use checksums
5152e2f56cdc7cadd5801c92c286216131e249f6a8de5e6fb15f82505298df2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / tft_request_watch-1.88.0-py3-none-any.whl

Download URL tft_request_watch-1.88.0-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
418b044b071532dc776cc55c08d6c804bcbbe5193d4660e40b38f24aabd08775
BLAKE2b-256 checksum
How to use checksums
8d6d09c69d486de5b89d1a421af5665fe38b29639a5886894b1679b52460b3c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.10

Security for tft-request-watch 1.88.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page