litellm/tests/e2e/claude_code/cron_vm/build_matrix.py
mateo-berri 3fa633370d chore(e2e): port the compat-matrix cron publisher to tests/e2e/claude_code
Ports the daily cron VM publisher from the unmerged tests/claude_code
checkout so the automation runs the e2e suite from litellm_internal_staging.
Adds find_regressions to matrix_builder for the green to red auto-merge
gate, pins the cron venv to Python 3.12, and ships the systemd units, env
template, and runbook alongside
2026-08-10 21:46:56 +00:00

52 lines
1.7 KiB
Python

"""Tiny CLI wrapper around `claude_code.matrix_builder.build_from_paths`.
Exists only so `run_daily.sh` can hand the version metadata + paths into
the matrix builder without re-implementing it in bash. All real logic
lives in `matrix_builder.py`.
The suite imports its own modules with `tests/e2e/` on sys.path (that is
how pytest resolves them: `tests/e2e/` has no `__init__.py`, while
`claude_code/` does), so this script bootstraps the same root — two
levels up from this file — before importing.
"""
from __future__ import annotations
import argparse
import datetime
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
from claude_code.matrix_builder import (
build_from_paths,
) # noqa: E402 # needs the sys.path bootstrap above
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--manifest", type=Path, required=True)
parser.add_argument("--results", type=Path, required=True)
parser.add_argument("--output", type=Path, required=True)
parser.add_argument("--litellm-version", required=True)
parser.add_argument("--claude-code-version", required=True)
args = parser.parse_args()
generated_at = datetime.datetime.now(datetime.timezone.utc).strftime(
"%Y-%m-%dT%H:%M:%SZ"
)
build_from_paths(
manifest_path=args.manifest,
results_path=args.results,
litellm_version=args.litellm_version,
claude_code_version=args.claude_code_version,
generated_at=generated_at,
output_path=args.output,
)
print(f"wrote {args.output}") # noqa: T201 # CLI output read by run_daily.sh
return 0
if __name__ == "__main__":
sys.exit(main())