Skip to content

Hard-fail CI on test skips (no skips allowed) #55

Closed

Description

@f3rdy

Description

Backstop for the "no skips in CI" policy established in #53/#54. Right now CI installs both `ansible-vault` and `cue` so the existing `requires_*` skip markers don't fire — but if a future test gains a new skip marker without its tool being added to CI, that test silently doesn't run. CI passes, the test never executed.

Make this impossible: install a pytest hook that converts any skipped test into a session-level failure, but only when running under GitHub Actions (env `GITHUB_ACTIONS=true`). Local development is untouched — skip markers stay useful there.

Implementation Sketch

In `tests/conftest.py`:

```python
import os
_skipped_in_ci: list[tuple[str, str]] = []

@pytest.hookimpl(trylast=True)
def pytest_runtest_logreport(report):
if os.environ.get("GITHUB_ACTIONS") == "true" \
and report.skipped and report.when == "setup":
_skipped_in_ci.append((report.nodeid, str(report.longrepr)))

def pytest_sessionfinish(session, exitstatus):
if not _skipped_in_ci:
return
print(...) # listing
session.exitstatus = 1
```

Scope

  • Triggered by `GITHUB_ACTIONS=true` (specific to our actual CI; doesn't fire on every CI=true env).
  • No exemptions. If a future test legitimately needs a skip, that's a design conversation, not a default escape hatch.
  • xfail/xpass untouched — different concept, separate policy.

Priority

P3 — defense in depth, not blocking anything.

Activity

  1. added
    enhancement
    on Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions