Repository navigation
Description
Problem Description
The floor of the test suite refuses a real security scanner only when the host has that scanner on PATH. A test that starts a scan command with no scanner_fake therefore gives two results:
- In the devcontainer,
trivy,gitleaksandsemgrepare on PATH (links in~/.local/bin). The scanner starts, and the floor fails the test with "host path reached without a fake" or "process edge reached without a fake". - On the GitHub runner, no scanner is on PATH.
shutil.whichfinds nothing, the scan reportsunavailable, and the test passes.
So the required GitHub checks pass such a test, it merges, and every full local devops ci run then fails. This occurred with tests/commands/test_scan.py (#4321, #4288). The pull request of #4321 fixes those tests, but nothing stops the next test of this type.
Reproduction Steps
- On
origin/mainbefore the fix of fix(ci): scan tests reach the host scanner tools #4321, runenv PATH=/usr/local/bin:/usr/bin:/bin uv run pytest tests/commands/test_scan.py -n 0. Result: 25 passed. - Run
uv run pytest tests/commands/test_scan.py -n 0in the devcontainer, with the scanners on PATH. Result: 4 failed and 4 errors.
Expected vs Actual Behavior
Expected: a test that reaches a scanner with no fake fails on every host, also on the GitHub runner, so the required checks stop it before the merge.
Actual: the test fails only on a host where the scanner is installed.
A possible fix: for each name of tests/support/refused_programs.py, the floor puts a stand-in first on PATH, so shutil.which finds the scanner on every host and the refusal at subprocess.Popen fails the test. scanner_fake and a test that sets its own PATH (docs/TESTING.md: "a test that needs a scanner missing gives it a PATH without the program") replace PATH, so they keep their behavior. Confirm the premise against the full suite on the runner first.
Environment Diagnostics
Devcontainer on origin/main 1ca0133 (2026-11-11). GitHub runner: the Tests & Coverage check, which installs no scanner.
Logs, Traces, or Terminal Output
FAILED tests/commands/test_scan.py::test_scan_individual_tools - Failed: host path reached without a fake: ~/.local/share/devops-cli/tools/trivy/0.75.0/trivy
4 failed, 21 passed, 4 errors in 4.21s
Proposed design
Problem statement
The test floor refuses a real scanner only when the host has the scanner on PATH. A test without scanner_fake passes on the GitHub runner where no scanner is present. The same test fails in the devcontainer where the scanner is present. The change puts a stand-in for each refused program first on PATH. The refusal at subprocess.Popen then fails the test on every host.
Acceptance criteria
Requirement: Floor PATH holds refused programs
The test floor SHALL put an executable stand-in first on PATH for each program that refused_programs() returns.
Scenario: Host without a refused program
- WHEN the floor builds PATH for a test on a host that has no refused program
- THEN
shutil.whichfinds each refused program in the floor's stand-in directory.
Requirement: Scan without fake fails
A test that starts a refused scanner without its fake MUST fail at the floor's subprocess.Popen refusal.
Scenario: Scan command without scanner fake
- WHEN a test invokes a scan command that starts a refused scanner and gives no
scanner_fake - THEN the test fails with the floor's refusal message and not with an
unavailablescan result.
Requirement: Scanner fake keeps priority
The scanner_fake MUST keep its stand-in ahead of the floor stand-in on PATH.
Scenario: Scripted scanner run
- WHEN a test scripts a scanner run through
scanner_fake - THEN the scan uses the scripted answer and the floor stand-in does not run.
Requirement: Explicit PATH hides a program
A test that sets its own PATH without a refused program SHALL see that program as unavailable.
Scenario: Test removes a scanner from PATH
- WHEN a test sets PATH to a directory that holds no refused program and asks
shutil.whichfor that program - THEN
shutil.whichreturnsNone.
Requirement: Stand-in directory is temporary
The floor MUST create the stand-ins under the run's temporary directory.
Scenario: Stand-in location
- WHEN the floor creates the stand-ins for a test run
- THEN the stand-in directory is under the run's temporary directory and no stand-in file is in the repository.
Existing Tool Considered
No alternatives check has run. No open, maintained tool covers a project-specific pytest floor that makes refused programs visible on every host. The change builds a small helper and a conftest hook. Build cost: about 2,000 tokens to write, 1,000 tokens to keep and fix, and about 1 hour elapsed.
Key questions
- Which programs must get a stand-in?: Every name that
refused_programs()returns:ghand each scanner binary in the scanner registry. [sources: tests/support/refused_programs.py, docs/TESTING.md:76] - How should the floor make a refused program visible on every host?: Prepend a directory of executable stand-ins to PATH in the floor fixture. Do not patch
shutil.which. (best practice) [sources: docs/TESTING.md:76, docs/TESTING.md:244, tests/support/refused_programs.py]- Chosen: PATH stand-ins in the floor fixture. This matches the existing scanner fake and keeps a test's own PATH override authoritative.
- Rejected: Patch
shutil.which. The project avoids patches, and the refusal must stay atsubprocess.Popen. - Rejected: Skip scan tests on a host without a scanner. A skip hides the defect and breaks the rule that a test must not skip on host state.
- Where should the stand-ins live?: In a directory under the run's temporary directory. The floor prepends that directory to PATH for each test and restores PATH after. (best practice) [sources: docs/TESTING.md:242]
- Chosen: Run temporary directory. The host path guard allows it, and the run removes it.
- Rejected: System temporary directory outside the run. The host path guard can fail a test that opens it.
- Rejected: Committed directory under
tests/fixtures. Committed executables add files to the repository and can start by mistake.
- How do
scanner_fakeand a test's own PATH keep their behavior?:scanner_fakeputs its stand-in first on PATH after the floor. A test that sets PATH replaces the floor entry, so a missing scanner stays missing. [sources: docs/TESTING.md:244] - Should the change add a regression test?: Yes. Extend
tests/invariants/test_suite_refuses_real_programs.pyto check the floor PATH and the refusal of a scan withoutscanner_fake. (best practice) [sources: docs/TESTING.md, tests/invariants/test_suite_refuses_real_programs.py]- Chosen: Extend the existing invariant test. The file already owns the refusal of real programs.
- Rejected: Add a new invariant file. The test documents keep one invariant file for each subject.
- Rejected: Add no test. The defect passed CI because no test checked the floor on a host without scanners.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-11: not-applicable.
Class: test, no search.
Tool: none found.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(tests)scope of the title gives the scope.A gap in the test floor lets bad tests merge on the runner, but the immediate failing tests are already being fixed by #4321.Prevents a whole class of future scan tests from passing on the runner while failing locally.Requires modifying the floor to inject PATH stand-ins and confirming the premise against the full suite on the runner.Both address the floor leaving host state visible so tests differ across hosts, but #2165 was a broad audit of tokenizer cache, mounts, and PATH, while the candidate adds a specific mechanism: the floor injects stand-in executables on PATHdevops-cli-service commentedon Nov 11, 2026
Status set to Ready at 3180bf1 (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Alternatives check: not-applicable
Class: test. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-11. A person decides what this means for the item. The check changes no label and closes no issue.
24 remaining items
devops-cli-service commentedon Nov 24, 2026
Stopped at group 1.
Failed check:
uv run devops ci test.Failure class:
limit_reached.Action taken:
repair, 1 fix round(s).Action left:
raise_limit: raise the limit that the run went over.uv run devops ci testReason:
Last message of the agent (a claim that no check verified): The suite needs ~3300 s at 1 worker here, but the
testrow ofdevops cistops at 1800 s. Let me check whether more workers help on this pod:The job discarded this work. Read it before you retry:
The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.