SAND-WP-0004: delegate make e2e to validate run
Replace e2e_framework monolith with wise-validator + sand-boxer shim. Makefile invokes validate run; legacy python -m e2e_framework delegates via shim.py with deprecation notice. Add verify-e2e-shim.sh.
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
"""
|
||||
Entry point: python -m e2e_framework <repo-path> [options]
|
||||
|
||||
Usage:
|
||||
python -m e2e_framework ~/activity-core
|
||||
python -m e2e_framework ~/activity-core --host 92.205.130.254
|
||||
python -m e2e_framework ~/activity-core --host railiance01 --keep
|
||||
make e2e REPO=activity-core (from the-custodian/)
|
||||
DEPRECATED — delegates to `validate run` (wise-validator + sand-boxer).
|
||||
Prefer: make e2e REPO=<slug> (from the-custodian/)
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -14,64 +11,59 @@ import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from .runner import run_e2e
|
||||
from .reporter import report
|
||||
from .shim import run_via_validate
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description="Run e2e tests in a remote sandbox")
|
||||
parser = argparse.ArgumentParser(
|
||||
description="[DEPRECATED] Run e2e tests — delegates to validate run"
|
||||
)
|
||||
parser.add_argument("repo_path", help="Path to the repo containing e2e/e2e.yml")
|
||||
parser.add_argument(
|
||||
"--host",
|
||||
default=os.environ.get("RAILIANCE01_HOST", ""),
|
||||
help="Sandbox host (SSH alias or IP). Env: RAILIANCE01_HOST",
|
||||
help="Sandbox host. Env: RAILIANCE01_HOST or SANDBOXER_HOST",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--user",
|
||||
default=os.environ.get("RAILIANCE01_USER", "root"),
|
||||
help="SSH user (default: root). Env: RAILIANCE01_USER",
|
||||
help="SSH user. Env: RAILIANCE01_USER → SANDBOXER_SSH_USER",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--key",
|
||||
default=os.environ.get("RAILIANCE01_KEY"),
|
||||
help="Path to SSH private key. Env: RAILIANCE01_KEY",
|
||||
help="SSH private key. Env: RAILIANCE01_KEY → SANDBOXER_SSH_KEY",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--keep",
|
||||
action="store_true",
|
||||
help="Keep sandbox after run (skip compose down + dir removal)",
|
||||
help="Keep sandbox after run",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--workstream-id",
|
||||
default=None,
|
||||
help="State-hub workstream ID to attach the progress event to",
|
||||
help="State Hub workstream ID for progress event",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-report",
|
||||
action="store_true",
|
||||
help="Skip posting results to state-hub",
|
||||
help="Skip posting results to State Hub",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.host:
|
||||
print("ERROR: sandbox host required. Set RAILIANCE01_HOST or pass --host.")
|
||||
sys.exit(1)
|
||||
|
||||
repo_path = Path(args.repo_path).expanduser().resolve()
|
||||
if not repo_path.exists():
|
||||
print(f"ERROR: repo path does not exist: {repo_path}")
|
||||
print(f"ERROR: repo path does not exist: {repo_path}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
result = run_e2e(
|
||||
repo_path=repo_path,
|
||||
host=args.host,
|
||||
ssh_user=args.user,
|
||||
ssh_key=args.key,
|
||||
exit_code = run_via_validate(
|
||||
repo_path,
|
||||
host=args.host or None,
|
||||
keep=args.keep,
|
||||
workstream_id=args.workstream_id,
|
||||
no_report=args.no_report,
|
||||
ssh_user=args.user if args.user != "root" else os.environ.get("RAILIANCE01_USER"),
|
||||
ssh_key=args.key,
|
||||
)
|
||||
|
||||
if not args.no_report:
|
||||
report(result, workstream_id=args.workstream_id)
|
||||
|
||||
sys.exit(0 if result.passed else 1)
|
||||
sys.exit(exit_code)
|
||||
Reference in New Issue
Block a user