Skip to main content

Wait on Testing Farm requests; restart on retriable infrastructure errors

Project description

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 and EPEL 10.

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.

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.

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

Versioning

This project uses semver. The major version is maintained in tft_request_watch/__init__.py. Minor versions are automatically generated on each push to main using the GitLab pipeline ID, producing versions like 0.42.0, 0.43.0, etc.

Bump the major version for breaking changes.

License

GPLv2+ — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tft_request_watch-0.36.0.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tft_request_watch-0.36.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file tft_request_watch-0.36.0.tar.gz.

File metadata

  • Download URL: tft_request_watch-0.36.0.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for tft_request_watch-0.36.0.tar.gz
Algorithm Hash digest
SHA256 2dbd60d0fdac5e4c308bac85fb9a5a46d395553529795a7357227258a15cc767
MD5 b83ad7a4012cce7afe541c634713ba17
BLAKE2b-256 fb863ca6d6edf407f1bd3c3bf888dfbe3bc762f7a31c32270d5c2f77776d382e

See more details on using hashes here.

File details

Details for the file tft_request_watch-0.36.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tft_request_watch-0.36.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32820b94fc777449b2ef6e6609684e08fa50a4fe60c4dbf68bc4cc01c6c46497
MD5 7d2fc5931cf51e3ece5baf3002db0e77
BLAKE2b-256 c73ae3117432447c6a2b50612fc42bd07f5e50937efcae0603aa62a15cb3644d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page