Skip to content

test(slm): real-ansible tests find ansible-playbook for the skip, then run it under a PATH that lacks it #20792

Open

Description

@mrveiss

Problem

SLM backend tests that run a real local playbook skip when shutil.which("ansible-playbook") is None. Then they run the bare name ansible-playbook with a hand-written PATH (for example /usr/bin:/bin:/usr/local/bin). When ansible is installed in a virtualenv, the skip check finds it but the subprocess doesn't, so the test fails with FileNotFoundError: 'ansible-playbook' instead of running.

Merge trains hit this twice on 2026-11-04:

Both were fixed the same way: run the path which returned and put its directory first on PATH. The class needs one home, so the next test can't reintroduce it.

Acceptance criteria

  • One shared test helper (under autobot-slm-backend/tests/) returns the resolved ansible-playbook path plus a minimal env whose PATH contains its directory. Both tests above use it.
  • A guard fails on any SLM test that passes the bare string "ansible-playbook" as a subprocess argv[0].

Activity

  1. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 4, 2026
  2. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    needs-structure cleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).

  3. removed
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 4, 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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions