Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/test_github_workflows.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import ast
import inspect
import os
import re
import subprocess
Expand Down Expand Up @@ -182,9 +184,24 @@ def run_project_intake_script(tmp_path: Path, **env_overrides: str) -> subproces
capture_output=True,
env=env,
text=True,
timeout=30,
)


def test_project_intake_script_runner_uses_subprocess_timeout() -> None:
tree = ast.parse(inspect.getsource(run_project_intake_script))
subprocess_run_calls = [
node
for node in ast.walk(tree)
if isinstance(node, ast.Call)
and isinstance(node.func, ast.Attribute)
and node.func.attr == "run"
]

assert len(subprocess_run_calls) == 1
assert any(keyword.arg == "timeout" for keyword in subprocess_run_calls[0].keywords)


def test_all_workflows_cancel_superseded_runs() -> None:
missing = [path.name for path in workflow_files() if "concurrency" not in load_workflow(path)]

Expand Down
Loading