Skip to content

The Rego runner test raises StopIteration when verified conftest is absent #1538

Open

Description

@doublewhy

Problem

test_default_structural_policy_runner_executes_rego (implementations/python/tests/test_repo_policy_tools.py:1264-1273, marked integration) locates the conftest binary with a bare next(...) over verified_tool_installation.default_installation_root(REPO_ROOT) / "conftest" (:1270). In a checkout where make policy has not installed the verified conftest, the generator is empty and the test ends in StopIteration without saying what is missing.

Reproduced on Linux (Ubuntu 24.04 x86_64), in a fresh worktree at dev a4357f9a:

uv run --project implementations/python --frozen --all-extras python -m pytest \
  "implementations/python/tests/test_repo_policy_tools.py::test_default_structural_policy_runner_executes_rego" \
  -m 'integration or not integration' -q -p no:cacheprovider
>       binary = next(
E       StopIteration
implementations/python/tests/test_repo_policy_tools.py:1270: StopIteration
1 failed

#1474 hit the same failure on macOS and saw the test pass after make policy installed conftest.

Scope

  • Make the missing installation explicit: skip with a reason that names make policy, or fail with that message. Choose the behavior so that CI, which installs conftest, cannot skip silently.

Done when

  • Without the verified conftest installation, the test skips or fails with a message that names the missing installation and the command that installs it, and never raises StopIteration.
  • With the installation present, the test still runs the Rego policy and passes.

Related

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions