From fa2996d842e4d742fa09fd1e9e82daa44045ae24 Mon Sep 17 00:00:00 2001 From: Billy Okal Date: Mon, 30 Nov 2026 13:24:24 -0600 Subject: [PATCH 1/2] ci: keep each benchmark's report in the nightly artifact Set AUTODATA_BENCHMARK_DIR for the nightly and forward it into the test container, so nightly-test-results holds every benchmark's generation result, attempt log and metrics report. --- .github/workflows/nightly.yml | 1 + autodata_tests/utils/test_ci_cache.py | 8 +++++++- docs/pages/advanced/testing_and_ci.rst | 3 ++- scripts/ci/run_tests.sh | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b280205..3447d5f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -31,6 +31,7 @@ jobs: FORCE_REBUILD: "true" PYTEST_MARK: "" AUTODATA_RESULTS_DIR: test-results + AUTODATA_BENCHMARK_DIR: test-results/benchmarks steps: # Self-hosted runners persist the workspace; clear prior results so an early diff --git a/autodata_tests/utils/test_ci_cache.py b/autodata_tests/utils/test_ci_cache.py index 3d59e37..ed48d4c 100644 --- a/autodata_tests/utils/test_ci_cache.py +++ b/autodata_tests/utils/test_ci_cache.py @@ -79,7 +79,8 @@ def run(**variables): assert source.stat().st_uid == os.getuid() (source / "arena-cache-write-check").write_text("writable") command = args[args.index("env") :] - assert command[4:7] == ["python", "-m", "pytest"] + assert command[command.index("python") :][:3] == ["python", "-m", "pytest"] + assert f"AUTODATA_BENCHMARK_DIR={variables.get('AUTODATA_BENCHMARK_DIR', '')}" in command return source return run, runner_temp @@ -96,3 +97,8 @@ def test_ci_cache_respects_explicit_mount(ci_launcher, tmp_path): run, _ = ci_launcher selected = tmp_path / "selected cache" assert run(AUTODATA_DOCKER_CACHE_DIR=str(selected)) == selected + + +def test_benchmark_dir_is_forwarded_into_the_container(ci_launcher): + run, _ = ci_launcher + run(AUTODATA_BENCHMARK_DIR="test-results/benchmarks") diff --git a/docs/pages/advanced/testing_and_ci.rst b/docs/pages/advanced/testing_and_ci.rst index 445e013..6f0a915 100644 --- a/docs/pages/advanced/testing_and_ci.rst +++ b/docs/pages/advanced/testing_and_ci.rst @@ -29,7 +29,8 @@ The suite is organized in tiers of increasing cost: - Success-rate benchmarks (hundreds of attempts per run) asserting generation quality thresholds per task. Each also reports its run's :doc:`metrics <../references/metrics>`; with ``AUTODATA_BENCHMARK_DIR`` set, each writes its generation result, attempt log and report to a - subdirectory named after the benchmark, replacing an earlier run's. Nightly-scale. + subdirectory named after the benchmark, replacing an earlier run's. The nightly sets it to ``test-results/benchmarks``, so the artifact + ``nightly-test-results`` holds them. Nightly-scale. * - ``test_data/`` - Pre-annotated source datasets (Git LFS) used by the tests — and handy as quickstart inputs. diff --git a/scripts/ci/run_tests.sh b/scripts/ci/run_tests.sh index 0020269..fa98ab6 100755 --- a/scripts/ci/run_tests.sh +++ b/scripts/ci/run_tests.sh @@ -62,6 +62,7 @@ fi PYTEST_ARGS=( env "AUTODATA_SUBPROCESS_TIMEOUT=${SUBPROCESS_TIMEOUT}" + "AUTODATA_BENCHMARK_DIR=${AUTODATA_BENCHMARK_DIR-}" "XDG_CACHE_HOME=${CONTAINER_CACHE_DIR}" "WARP_CACHE_PATH=${CONTAINER_CACHE_DIR}/warp" python -m pytest -sv --durations=0 From de5106ce9580d184beb543006e259d0995f7ecc2 Mon Sep 17 00:00:00 2001 From: Billy Okal Date: Mon, 30 Nov 2026 13:58:10 -0600 Subject: [PATCH 2/2] test: ignore a benchmark directory inherited from the environment --- autodata_tests/utils/test_ci_cache.py | 1 + 1 file changed, 1 insertion(+) diff --git a/autodata_tests/utils/test_ci_cache.py b/autodata_tests/utils/test_ci_cache.py index ed48d4c..d3f09e6 100644 --- a/autodata_tests/utils/test_ci_cache.py +++ b/autodata_tests/utils/test_ci_cache.py @@ -58,6 +58,7 @@ def ci_launcher(tmp_path): TEST_DOCKER_LOG=str(log), FORCE_REBUILD="false", AUTODATA_RESULTS_DIR="", + AUTODATA_BENCHMARK_DIR="", ) def run(**variables):