Apache Traffic ServerのCMakeビルドで、プリセット選択、コンパイル、テスト、コード整形、AuTest実行、インストールまでの基本手順を案内します。
- ATSの開発用ビルドを構成したいとき
- 特定の実行ファイルやライブラリをビルドしたいとき
- 単体テストやAuTestを実行したいとき
Apache Traffic ServerのAuTestをpytestベースのUraniumテストへ移行し、検証範囲やアサーション、プロセスの起動・終了条件を保つための手順を示します。
Convert Apache Traffic Server AuTests to pytest Uranium tests while preserving coverage, assertions, and process lifecycle. Use for explicit test migrations and for newly added or updated AuTests encountered during a requested Uranium-branch rebase.
実行スコア 未検証
インストール方法を見るApache Traffic ServerのAuTestを、pytestを使うUraniumテストへ移す際の調査と変換を支援します。元テストのケース、条件分岐、通信内容、アサーション、必要なファイルやプロセスの起動・終了を洗い出し、移行後のテストにも対応づけます。単一のシナリオで表せる場合は.test.yaml、特殊な通信やTLS操作などが必要な場合はtest_*.pyを選ぶ考え方も示します。移行時には期待値を弱めず、正しい動作を確認する対照ケースやログ診断も維持します。
既存のAuTestをUraniumへ移行するときや、依頼されたブランチのリベースで追加・変更されたテストを確認するときに使えます。見た目上テストが通るだけでなく、元の検証内容や実行順序が保たれているかを点検したい場合に向いています。
.test.yamlとPythonのどちらで移行すべきか整理してください」Uraniumの現行ドキュメントや関連実装を参照してAPIを確認する手順です。テストの実行にはリポジトリのビルド環境が必要です。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Produce equivalent, maintainable tests—not merely a passing replacement. This skill does not authorize rebases, commits, pushes, or production fixes beyond the user's request.
Read the repository's applicable instructions and these current sources:
doc/developer-guide/testing/uranium-tests.en.rst: replay schema and execution.doc/developer-guide/testing/uranium-api.en.rst: fixtures and service APIs.tests/tools/uranium/README.md: framework responsibilities and code flow.tests/tools/uranium/services/ and a nearby
converted test with similar behavior.Treat those sources as authoritative if API details below have changed. Do not restore an AuTest compatibility backend or follow older AuTest authoring advice where it conflicts with the migration. Obtain the original test from Git when its working-tree copy has already been deleted or moved.
For each original test, account for:
Map each original assertion to its replacement. Inspect what the old assertion actually checked; a historical green result can be a false positive. Do not weaken expectations, add an xfail, or replace executable coverage with a skip to make a conversion pass. Report a demonstrated production bug separately if its fix is outside the requested scope.
Prefer a self-contained <scenario>.test.yaml: put Proxy Verifier traffic and
the urtest: orchestration in the same file. Basic curl and microserver tests
often fit this form. Remove an old replay wrapper only after its configuration,
assertions, and lifecycle have all been represented. Avoid introducing a separate
replay file unless it genuinely needs to be shared.
Use a native test_*.py when special client/server behavior is necessary, such
as raw malformed messages, controlled disconnects, TLS session save/resume,
live reconfiguration, or functionality Proxy Verifier cannot express. Use plain
test_* functions taking fixtures, small helper functions, and parametrization
for independent variations. Classes are appropriate for stateful services, not
mandatory scenario wrappers with a run() entry point.
Preserve intentional state across cache priming/hit checks, session resumption, and reload sequences. Splitting these into independent fixture instances changes the test. Follow the surrounding directory layout and update asset paths.
urtest.server.stop_after_client: true stops the origin before metrics/file
checks. Do not enable it indiscriminately. Preserve crash detection before an
intentional stop and validate process output afterward.tests/serial_tests.txt when paths change.PR. must not become a
literal substring check. Keep exact counts and exclusions where meaningful.tools.uranium.assertions or stream
matches_gold(); do not introduce another comparison implementation.@pytest.mark.manual or urtest.manual, runnable with --run-manual.
Keep capability-based skips distinct from manual selection.stdout/stderr methods: contains(expression, explanation),
excludes(expression, explanation), and matches_gold(path). Do not use +=
or replace the stream object. Use reset() only for intentional replacement.curl.run_for(ats, arguments_string, timeout=seconds) or curl.get(ats, ...).
Curl accepts a shell-style argument string; do not assume every command API
has that signature. Check ATS.run versus ATS.run_shell explicitly.sys.executable, not a hardcoded python3, to keep
them in the test interpreter's environment.replay_*
resolves relative assets like the conventional replay/ or replays/ folder.:param name: and timeout units in seconds.Compare upstream test changes between the previous base and the new base,
including modified existing tests—not only newly added files. Rename/delete
conflicts from gold_tests to uranium_tests require a semantic comparison;
blindly selecting either side can silently discard coverage.
Retain new helpers and assets, migrate new assertions/configuration into existing Uranium tests, and update test-plugin CMake registrations and serial-test paths. Search the entire test tree for leftover wrappers:
rg --files tests -g '*.test.py'
Review matches individually. Do not search only the migrated directory: a newly
added upstream directory can remain under gold_tests. Do not replace this with
a broad ban on all Python filenames ending in test.py.
Use the repository's build and test documentation when building or running ATS. If using an available build/test skill, prefer the current Uranium wrapper and its help over older AuTest flags. Respect the user's chosen environment; discover container mount and build paths rather than assuming a previous task's paths apply.
Run from the configured build's tests directory. For an already-running test
container, an example is:
./urtest.sh --no-run-in-container --collect-only -k '<expression>'
./urtest.sh --no-run-in-container -v -n 8 -k '<expression>'
Use pytest -k for filtering and -n for parallelism, not legacy -f/-j.
Confirm collection includes the intended cases and execution did not merely skip
them. Test changed cases plus controls affected by shared helpers. Repeat timing-
sensitive cases when warranted; report failures rather than rerunning until a
single green run conceals them. Run a full suite when requested or proportionate
to a broad change.
For framework changes, add focused harness tests for both existing/default and
new behavior. Run applicable replay validation, self-contained replay, native
inventory, and no-wrapper checks in tests/tools/uranium/tests/; do not hardcode
inventory counts. Format changed code and build docs when documentation changes.
Summarize converted cases, semantic differences or newly exposed bugs, exact verification results, and any untested capabilities. Preserve requested failure artifacts or inspection sandboxes; clean only task-owned scratch artifacts when appropriate. Follow separate commit/push instructions only when authorized.
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
Apache Traffic ServerのCMakeビルドで、プリセット選択、コンパイル、テスト、コード整形、AuTest実行、インストールまでの基本手順を案内します。