Repository navigation
Description
What happened
tests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_run fails on a workstation where the devcontainer CLI is installed in ~/.local/bin. The test expects the text not installed in the output of devops tools status. The real host answers 0.89.0 and a path.
It passes on a clean GitHub runner. This is the same class as #2165: a test reads the tools of the host instead of a fake.
What should happen
The test sets the tool probe to a fake, so the result does not depend on the tools of the host.
Acceptance criteria
- The test passes on a host that has the
devcontainerCLI installed. - The test passes on a host that has no
devcontainerCLI.
Alternatives check of 2026-11-04: covers.
Tool: pytest-dev/pytest (https://github.com/pytest-dev/pytest), MIT, last activity 2026-11-04, maintained.
Proposed design
Problem statement
Two tests read the tools of the host and not a fake. They fail on a host that has tools in its home directory, and they make a full devops ci fail there. The first is test_mark_only_commands_under_global_dry_run, which expects not installed from install-tools status. The code at the refined commit already holds its fix (#3871). The second is test_the_direct_executor_refuses_a_network_profile_before_it_starts_the_tool[direct] in tests/ai/test_tool_executor_contract.py. It reaches the host path ~/.local/share/devops-cli/tools/popeye and then the network edge without a fake.
Acceptance criteria
Requirement: Status test ignores host tools
The install-tools status dry-run test SHALL run with an empty target directory and an empty PATH, so the result does not depend on the tools of the host.
Scenario: Host has the devcontainer CLI installed
- WHEN the test runs on a host that has the
devcontainerCLI in~/.local/bin - THEN the exit code is 0 and the output holds
not installed
Requirement: Status test passes on a clean host
The install-tools status dry-run test MUST pass on a host that has no devcontainer CLI.
Scenario: Host has no devcontainer CLI
- WHEN the test runs on a clean runner
- THEN the exit code is 0 and the output holds
not installed
Requirement: At pin row is checked with a link
A test SHALL link the devcontainers-cli tool at its pin under a temporary directory and SHALL check the row of the tool before and after the link.
Scenario: Tool linked at its pin
- WHEN the test reads the status row before and after
link_at_pinruns - THEN the row shows
not installedbefore the link andat pinafter it
Requirement: Executor test uses a fake tool path
The test that the direct executor refuses a network profile SHALL replace the host tool path and the network edge with fakes, so it never reads the home directory of the host.
Scenario: Tools installed in the home directory
- WHEN the test runs on a host that has
popeyeunder~/.local/share/devops-cli/tools - THEN the executor refuses the network profile before it starts the tool, and no host path or network edge is reached
Existing Tool Considered
pytest (https://github.com/pytest-dev/pytest, MIT, maintained) covers the need. Its monkeypatch and tmp_path fixtures isolate PATH, the target directory and the tool probe, and pytest restores each value after the test. It has no built-in fake of the tool probe, so each test sets its own fake. The project already uses pytest, so no new code or dependency is built. The change edits two test modules only.
Key questions
- Adopt pytest, which the alternatives check found to cover this item, or keep the item and give a reason?: Adopt pytest. It is the test framework of the project. The fix uses its monkeypatch.setenv and tmp_path fixtures, with no new dependency and no change to production code. (best practice) [sources: tests/commands/test_devcontainer_install_tools_dry_run.py]
- Chosen: Adopt pytest monkeypatch and tmp_path. The project already uses pytest. It isolates the host without new code.
- Rejected: Add a new library to fake the tool probe. It adds a dependency and gives no gain over monkeypatch.
- Rejected: Change production code to inject the probe. The issue limits the change to tests, and monkeypatch is enough.
- Why does the status test show host tools?:
install-tools statussearches its target directory, which defaults to~/.local/bin, before PATH. A host with the devcontainer CLI there shows a version and a path, notnot installed. [sources: tests/commands/test_devcontainer_install_tools_dry_run.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 1, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(tests)scope of the title gives the scope.The test passes on CI runners and only fails on workstations where the devcontainer CLI is installed.It breaks the test suite for developers whose workstation has the devcontainer CLI.The fix is to set one tool probe to a fake in a single test function.Both address tests that read host state instead of fakes, but #2165 is the umbrella floor and the candidate fixes one specific devcontainer dry-run test.feat(k8s): serve deepseek-v4.1-flash-1017 via OpenRouter (#3145)
devops-cli-service commentedon Nov 2, 2026
Status set to Ready at ac16675 (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
devops-cli-service commentedon Nov 4, 2026
Alternatives check: covers
Tool: pytest-dev/pytest (https://github.com/pytest-dev/pytest)
Covers:
Lacks:
Searches run:
Sources:
Checked on 2026-11-04. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 4, 2026
Refine cannot set this item to Ready at 46cf288 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
https://github.com/pytest-dev/pytestcovers this item. Adopt the tool, or keep the item and give the reason. (a person decides)dan-petty commentedon Nov 4, 2026
A second test has the same cause. On
origin/mainat 46cf288, in the devcontainer, these two tests fail when the tools are installed in the home directory of the host:tests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_run:'not installed'is not in the output.tests/ai/test_tool_executor_contract.py::test_the_direct_executor_refuses_a_network_profile_before_it_starts_the_tool[direct]:host path reached without a fake: ~/.local/share/devops-cli/tools/popeye, and thennetwork edge reached without a fake.They make a full
devops cifail in that environment for each branch.dan-petty commentedon Nov 7, 2026
Pull request #3871 covers both criteria of this issue. The
install-tools statustest now runs with an empty target directory and an empty PATH, becausestatussearches its target directory (default~/.local/bin) before PATH. It passes on this host, which has the devcontainer CLI installed. A second test links the tool at its pin under a temporary directory and showsat pin, and showsnot installedbefore the link. The pull request does not close this issue: a person closes it after the merge.devops-cli-service commentedon Nov 9, 2026
Status set to Ready at 681529b (see proposed design in issue body).
dan-petty commentedon Nov 10, 2026
#3871 delivered both criteria of this issue, and
f600ed49is onmain.Verified on a host that has both tools that the issue names:
~/.local/bin/devcontaineris version0.89.0.~/.local/share/devops-cli/tools/popeyeexists.uv run pytest tests/commands/test_devcontainer_install_tools_dry_run.py tests/ai/test_tool_executor_contract.pypasses 101 tests.The status test uses an empty target directory and an empty PATH. The at-pin test reads the row before and after
link_at_pin. The direct-executor case puts a Popeye stand-in first on PATH, so no tool of the host is resolved.