Skip to content

urtest: Convert AuTest tests to pytest - #13545

Draft
bneradt wants to merge 7 commits into
apache:masterfrom
bneradt:pytest-replay-tests
Draft

urtest: Convert AuTest tests to pytest#13545
bneradt wants to merge 7 commits into
apache:masterfrom
bneradt:pytest-replay-tests

Conversation

@bneradt

@bneradt bneradt commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This is a draft for the all-in end-to-end test migration discussed on the
original pytest replay PR. It supersedes #13035 without depending on changes to
the AuTest project.

Summary

  • make pytest own the complete ATS end-to-end inventory
  • collect all 96 tracked Proxy Verifier replays directly from .test.yaml
  • collect each of the 505 bespoke .test.py definitions as one pytest item,
    using the pinned AuTest package only as a compatibility backend
  • replace the separate parallel runner with pytest-xdist scheduling, stable CI
    sharding, isolated sandboxes/ports, and shared/exclusive serial-test locking
  • rename the public interface to e2etest: e2etest.sh, CMake options and
    targets, presets, documentation, environment variables, and the replay
    e2etest: metadata key

Each replay file remains an independent item. A feature with several scenarios
should therefore keep separate scenario.test.yaml files unless the sessions
intentionally share ATS state.

Developer workflow

Run one test from the source tree:

./tests/e2etest.sh -f cache-control-basic
./tests/e2etest.sh -f cache-auth

The same -f workflow selects native YAML or compatibility Python items and
supports globs and multiple names. -k, -m, -j, --list, and other pytest
selection options remain available. A configured tree generates
<build>/tests/e2etest.sh for the fastest warmed-up single-test path.

Container behavior

The source entry point defaults to
ci.trafficserver.apache.org/ats/fedora:44, performs an incremental dedicated
build/install, and runs the selected tests there. It launches Docker with the
CI-relevant --init, host networking, and SYS_PTRACE capability, but does not
use --privileged or mount the Docker socket.

Automatic direct execution requires both a container marker and exact Fedora
44 identification, so the existing Jenkins container does not attempt Docker
in Docker. --run-in-docker and --no-run-in-docker override the decision.
Container-local short /tmp sandboxes avoid Unix-socket path and bind-mount
problems while regular diagnostics are copied back to the build tree.

CI compatibility

Temporary deprecated aliases retain ci-fedora-autest, autest.sh, the old
CMake options/targets, and the Jenkins parallel_mode feature probe. This lets
the current external pipeline execute the unified pytest inventory immediately;
the pipeline can rename its stage, preset, and command in a follow-up. Existing
SHARD/SHARDCNT values now shard all pytest items rather than only .test.py
files.

Validation

  • Fedora 44 Docker build, install, and 627-item local collection (the worktree
    contains one unrelated untracked replay in addition to this PR's 626 items)
  • all replay items passed or reached their expected capability skips
  • mixed native/compatibility selections passed under xdist
  • representative DNS, config-reload, next-hop, and plugin compatibility tests
    passed concurrently
  • current Jenkins-style 3/12 compatibility shard collected 52 items
  • 25 framework tests and Python static checks passed
  • new and deprecated Fedora CMake presets configured successfully
  • repository formatting and whitespace hooks passed

AuTest's stalled file-format support leaves replay tests tied to thin
Python registration wrappers. Collect replay YAML directly so every
scenario has an independent pytest result and sandbox.

Add ATS-specific DNS, Proxy Verifier, Traffic Server, log, and metric
lifecycle support, then convert all 96 ATSReplayTest registrations to
.test.yaml files. Keep bespoke AuTests in place and run both suites from
the existing autest targets.
@bneradt bneradt added this to the 11.0.0 milestone Aug 13, 2026
Copilot AI lite review requested due to automatic review settings August 13, 2026 18:34
@bneradt bneradt self-assigned this Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bneradt
bneradt marked this pull request as draft August 13, 2026 18:37
@bneradt bneradt changed the title Add pytest replay test framework Unify end-to-end tests under pytest Aug 13, 2026
@bneradt bneradt changed the title Unify end-to-end tests under pytest urtest: Convert AuTest tests to pytest Aug 14, 2026
ATS end-to-end coverage depends on the stagnant AuTest framework and
splits replay and bespoke tests across different runner abstractions.
This makes the suite harder to maintain, schedule, and debug.

This patch replaces AuTest with pytest-owned Uranium tests. Replay YAML
is collected directly, while a native scenario layer preserves existing
bespoke test behavior with isolated processes, readiness checks, cleanup,
filtering, sharding, and Fedora container execution.

It also adds procedural ATS and curl fixtures, converts the first basic
tests to ordinary pytest, and updates the build, CI, documentation, and
test layout around the urtest interface.
@bneradt
bneradt force-pushed the pytest-replay-tests branch from 1b8339e to 678cb46 Compare August 14, 2026 17:29
bneradt added 2 commits August 14, 2026 14:41
Procedural Uranium tests need reusable process ownership and curl
targeting that works for multiple ATS instances and Unix sockets.
The test tooling layout and command line also made framework code
difficult to distinguish from the ATS test inventory.

This patch adds fixture-owned ATS factories and ATS-aware curl
requests, including UDS support, and converts representative basic
coverage to the procedural API. It moves the harness and its unit
tests under tests/tools/uranium, updates imports, and lets pytest own
selection, parallelism, and collection options while the wrapper
handles Docker execution.
The remaining compatibility tests still depended on AuTest process
orchestration, which prevented the Uranium suite from being fully native
and made parallel execution unreliable.

This removes the compatibility backend and converts each test to direct
Proxy Verifier replay metadata or a native pytest scenario. It also
hardens process startup, logging, reload timestamps, DNS, and timeout
handling so the complete suite runs reliably with eight workers.

The test guide and runner documentation now describe the replay-first
workflow and pytest-native selection and parallelism.
@brbzull0
brbzull0 requested a lite review from Copilot August 17, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

bneradt added 3 commits August 17, 2026 10:42
The initial pytest migration left explicitly disabled scenarios as
permanent skips and made native curl commands cumbersome to read and
write. Repository guidance also retained obsolete AuTest conventions.

This patch restores the opt-in scenarios behind a pytest manual marker
and adds --run-manual for deliberate execution. It also changes Curl to
parse one shell-style argument string, updates every call site, and
documents parameter and timeout expectations.

This adds collection and service regression coverage and refreshes the
Uranium documentation to match the native pytest workflow.
Procedural Uranium support had accumulated unrelated process,
client, and assertion behavior in one large module, making changes
difficult to isolate while scenarios depended on its public import path.
The converted log filename scenario could also read asynchronously
written logs before every destination had flushed.

This patch addresses this by moving focused implementations into a
services package behind the existing tools.uranium.services facade and
updating internal imports, documentation, and facade coverage. It also
waits for each expected log record before asserting so parallel runs do
not race ATS logging.
Replay processing crosses pytest collection, YAML validation, and
runtime execution, but the framework directory did not explain those
boundaries. Closely related modules were therefore difficult to
distinguish.

This patch addresses this by documenting the direct replay and
procedural call flows, each module and supporting directory, and
guidance for placing new framework code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants