Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,13 @@ jobs:
- name: Install
# Every extra: a runnable guide block that exports to OpenTelemetry or opens the
# gateway's client needs the extra installed, and a block that skipped would be a
# sample nobody ran.
# sample nobody ran. `postgres` too, and for a different reason: the readiness block
# records what `pytest --collect-only` finds, and 76 of the tests exist only when
# psycopg is importable. The same extras as `check`, so this job counts the suite
# that job runs; `test_the_docs_job_installs_the_extras_the_check_job_runs` holds it.
run: |
python -m pip install --upgrade pip
pip install -e "./ctrlrun[dev,gateway,otel,identity]"
pip install -e "./ctrlrun[dev,gateway,otel,identity,postgres]"
pip install griffe pyyaml

# `_core.py` raises when it cannot find the library, so this prints a path or the job
Expand Down
17 changes: 17 additions & 0 deletions tests/test_repository_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,23 @@ def test_codeql_does_not_gate_a_merge():
assert "Nothing here gates a merge" in workflow


def test_the_docs_job_installs_the_extras_the_check_job_runs():
"""The readiness block records what `pytest --collect-only` finds, and the Postgres tests
are collected only when psycopg is importable. A `docs` job installed with fewer extras
than `check` counts a smaller suite than the one that ran, and fails the audit against a
number that was right."""
workflow = _workflow("ci.yml")

def extras(job: str) -> set[str]:
for step in workflow["jobs"][job]["steps"]:
match = re.search(r'pip install -e "\.?/?(?:ctrlrun)?\[([^]]+)\]"', step.get("run", ""))
if match:
return set(match.group(1).split(","))
raise AssertionError(f"no editable install in the {job} job")

assert extras("docs") == extras("check")


# --- community files -----------------------------------------------------------------------


Expand Down
Loading