GRM-44: fix: bridge test suite gaps — lint scripts, include integration tests

This commit is contained in:
2026-06-21 22:21:15 +00:00
parent 7dfc9f6014
commit 402e2dce7e
6 changed files with 17 additions and 45 deletions
+6 -22
View File
@@ -40,9 +40,7 @@ from gitea_runner_manager.i18n import _
POLL_INTERVAL = 10
def get_running_jobs(
gitea_url: str, owner: str, repo: str, token: str, run_id: int
) -> list[dict]:
def get_running_jobs(gitea_url: str, owner: str, repo: str, token: str, run_id: int) -> list[dict]:
"""Return jobs for the given workflow run."""
url = f"{gitea_url}/api/v1/repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
headers = {"Authorization": f"token {token}"}
@@ -52,9 +50,7 @@ def get_running_jobs(
return data.get("jobs", [])
def any_other_runner_failed(
jobs: list[dict], current_job_name: str, current_index: int
) -> bool:
def any_other_runner_failed(jobs: list[dict], current_job_name: str, current_index: int) -> bool:
"""Return True if any other molecule matrix job has failed."""
for job in jobs:
name = job.get("name", "")
@@ -83,11 +79,7 @@ def poll_for_other_failures(
try:
jobs = get_running_jobs(gitea_url, owner, repo, token, run_id)
if any_other_runner_failed(jobs, job_name, current_index):
click.echo(
_(
"Another molecule runner failed. Stopping this runner early."
)
)
click.echo(_("Another molecule runner failed. Stopping this runner early."))
failed_event.set()
return
except requests.RequestException as exc:
@@ -132,11 +124,7 @@ def cli(pairs: tuple[str, ...]) -> None:
owner, repo = "oblachno-oss", "grm"
if not all([gitea_url, token, run_id]):
click.echo(
_(
"GITEA_URL/REPO_TOKEN/RUN_ID not set; running without cross-runner cancellation."
)
)
click.echo(_("GITEA_URL/REPO_TOKEN/RUN_ID not set; running without cross-runner cancellation."))
repo_root = Path(__file__).resolve().parent.parent
role_dir = repo_root / "ansible" / "roles" / "gitea-runner"
@@ -173,9 +161,7 @@ def cli(pairs: tuple[str, ...]) -> None:
scenario = pair.split("|")[0]
platform_name = pair.split("|")[1]
click.echo(
_("Running: {scenario} on {platform}", scenario=scenario, platform=platform_name)
)
click.echo(_("Running: {scenario} on {platform}", scenario=scenario, platform=platform_name))
cmd = build_molecule_cmd(scenario)
env = build_env_for_pair(pair, base_env)
@@ -208,9 +194,7 @@ def cli(pairs: tuple[str, ...]) -> None:
rc = process.returncode
if rc != 0:
click.echo(
_("FAILED: {pair} exited with code {code}", pair=pair, code=rc)
)
click.echo(_("FAILED: {pair} exited with code {code}", pair=pair, code=rc))
sys.exit(rc)
click.echo(_("PASSED: {pair}", pair=pair))