48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from engine.devops_agent.cli import main
|
|
|
|
|
|
REQUIRED_ENV_VARS = (
|
|
"GITEA_BASE_URL",
|
|
"GITEA_REPO",
|
|
"GITEA_TOKEN",
|
|
"GITEA_ISSUE_NUMBER",
|
|
)
|
|
|
|
|
|
def test_gitea_acceptance_comment_flow() -> None:
|
|
missing = [name for name in REQUIRED_ENV_VARS if not os.getenv(name)]
|
|
if missing:
|
|
pytest.skip(f"missing required env vars: {', '.join(missing)}")
|
|
|
|
output_dir = Path(".tmp/acceptance/gitea")
|
|
output_dir.mkdir(parents=True, exist_ok=True)
|
|
|
|
exit_code = main(
|
|
[
|
|
"acceptance",
|
|
"workflows/gitea-issue-delivery.md",
|
|
"--base-url",
|
|
os.environ["GITEA_BASE_URL"],
|
|
"--repo",
|
|
os.environ["GITEA_REPO"],
|
|
"--token",
|
|
os.environ["GITEA_TOKEN"],
|
|
"--issue-number",
|
|
os.environ["GITEA_ISSUE_NUMBER"],
|
|
"--output-dir",
|
|
str(output_dir),
|
|
]
|
|
)
|
|
|
|
artifact_path = output_dir / "run-artifact.json"
|
|
|
|
assert exit_code == 0
|
|
assert artifact_path.exists()
|