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.

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

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.

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-1.56.0.tar.gz (29.5 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-1.56.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tft_request_watch-1.56.0.tar.gz
  • Upload date:
  • Size: 29.5 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-1.56.0.tar.gz
Algorithm Hash digest
SHA256 8c125cab19c5c144de2be9cc70e2824fdc811b76c25bd03678c006245cf78d8a
MD5 9d554175976f0cb113b1d39dcd5904ea
BLAKE2b-256 4f64414c54504715101b7b108ac63ceee578768e8ae4b4c008e3193700f3eab3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tft_request_watch-1.56.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0d5f4462e94b1df0d3e5d768cbd69d0cb3741eae99458cd46d2b55daebb92a1
MD5 bf03d4044bd0f031d4f65b013b29b95a
BLAKE2b-256 65330d1c49ba8b72b82d113f74134b7d3acf83606a60c0fcb2a746d8a86690b2

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