Repository navigation
Description
Problem
Four tests fail in the pytest gate of devops ci in the devcontainer. The same four tests also fail on the main checkout, which holds no change of issue 3488:
tests/telemetry/test_config_env_overrides.py::test_find_project_config_path_skips_directorytests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_runtests/crypto/test_ssh.py::test_get_ssh_key_prefix_resolutiontests/ai/test_tool_executor_contract.py::test_the_direct_executor_refuses_a_network_profile_before_it_starts_the_tool[direct], which also errors at its setup
Evidence
On the main checkout, uv run pytest -n 0 on these four files gives 4 failed and 1 error. The ssh test expects the repository name my_plain_repo and gets devops_cli. The tool executor test reaches the host path of the popeye tool under the user data directory.
Expected
Each test passes in the devcontainer, or it skips when the host capability that it needs is missing, as the test rules require.
Proposed design
Problem statement
Four tests fail on the devcontainer host. The host has /tmp/config.yaml and an installed popeye tool. The tests read that host state instead of their own temporary state. The change isolates the tests from host state or skips them only when a needed capability is absent.
Acceptance criteria
Requirement: Isolated config path test
The test test_find_project_config_path_skips_directory SHALL ignore any project config file outside its temporary search root.
Scenario: Host config file exists
- WHEN A
/tmp/config.yamlfile exists and the test searches from a temporary directory under/tmp. - THEN The test passes and the function returns
Nonefor a directoryDEVOPS_CLI_CONFIGvalue.
Requirement: Host-independent install-tools status
The mark-only dry-run test SHALL pass when the host has tools installed under the user data directory.
Scenario: Popeye installed
- WHEN
popeyeexists under~/.local/share/devops-cli/tools/and the test runsdevops --dry-run install-tools status. - THEN The command exits 0 and prints the
DevOps Toolheader.
Requirement: Isolated SSH prefix fallback
The SSH prefix fallback test SHALL ignore any project config file outside its temporary directory.
Scenario: Host config sets a prefix
- WHEN
/tmp/config.yamlsetsssh.key_prefixand the test resolves a plain directory with no local config. - THEN
get_ssh_key_prefixreturnsmy_plain_repo.
Requirement: Direct executor network refusal without host tool
The direct executor network-profile test SHALL use a temporary stand-in program and MUST assert the refusal before any process starts.
Scenario: Host popeye installed
- WHEN
popeyeis installed in the host data directory and the test sends aKubeApiNetworkrequest toDirectToolExecutor. - THEN The executor raises
SandboxErrormatchingcannot run the network profile kube-apiand the stand-in writes no marker.
Requirement: Four tests pass with host state
The four tests SHALL pass in one uv run pytest -n 0 run on a host that has /tmp/config.yaml and popeye installed.
Scenario: Host state present
- WHEN The host has
/tmp/config.yamlandpopeyeunder the user data directory. - THEN The command reports no failed test and no error.
Existing Tool Considered
No alternatives check has run. pytest with tmp_path and monkeypatch is the open, maintained tool that covers the test-isolation need. It lacks automatic isolation from host paths and installed tools, so each test must set its own temporary root or drop a host-dependent assertion. No custom code is needed.
Key questions
- Why does
test_find_project_config_path_skips_directoryfail when/tmp/config.yamlexists?: The test searches fromtmp_pathunder/tmp. The search goes up to/tmpand finds/tmp/config.yamlafter it skips the directory inDEVOPS_CLI_CONFIG. [sources: tests/telemetry/test_config_env_overrides.py, tests/crypto/test_ssh.py] - Why does
test_mark_only_commands_under_global_dry_runfail whenpopeyeis installed?: The test asserts thatinstall-tools statusprintsnot installed. The host haspopeyeinstalled, so the output does not contain that text. [sources: tests/commands/test_devcontainer_install_tools_dry_run.py] - Why does
test_get_ssh_key_prefix_resolutionfail when/tmp/config.yamlexists?: The fallback part expectsmy_plain_repo. The config search finds/tmp/config.yaml, which sets a different prefix, so the result isdevops_cli. [sources: tests/crypto/test_ssh.py:142, tests/crypto/test_ssh.py:144] - Why does the direct executor test fail when
popeyeis installed?: The test sendstool="popeye". The executor reaches the host popeye path before it refuses the network profile, so the test gets a different error. [sources: tests/ai/test_tool_executor_contract.py] - How should the config path and SSH fallback tests isolate from
/tmp/config.yaml?: Add an optionalsearch_rootboundary to_find_project_config_pathand passtmp_pathin the config path test. Usemonkeypatchto return no project config in the SSH fallback part. (best practice) [sources: tests/telemetry/test_config_env_overrides.py, tests/crypto/test_ssh.py]- Chosen: Search boundary and monkeypatch. The config path test still exercises discovery and the SSH test keeps its fallback check.
- Rejected: Monkeypatch both discovery calls. The config path test would no longer exercise the function under test.
- Rejected: Accept the host config result. The assertion would stop protecting the directory-skip behavior.
- How should the install-tools status test handle installed host tools?: Remove the
not installedassertion. Keep the exit code and theDevOps Toolheader check. (best practice) [sources: tests/commands/test_devcontainer_install_tools_dry_run.py]- Chosen: Drop host-dependent assertion. The test checks that a mark-only command runs, not the host tool inventory.
- Rejected: Set the tool data directory to
tmp_path. It needs an extra host setting and adds no coverage of the mark-only path. - Rejected: Skip when tools are installed. Installed tools are normal host state, not a missing capability.
- How should the direct executor test avoid host
popeye?: Use a temporary stand-in program that writes a marker. Assert the network-profile refusal and that the marker does not exist. (best practice) [sources: tests/ai/test_tool_executor_contract.py]- Chosen: Temporary stand-in program. The test proves that no process starts and does not resolve host popeye.
- Rejected: Use a missing tool name. The error may name the missing tool instead of the network profile.
- Rejected: Skip when popeye is installed. Installed popeye is normal host state, not a missing capability.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 5, 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 CI gate fails, blocking all merges.It unblocks CI but does not change user-facing behaviour.Four tests each need a host-state isolation fix.the four devcontainer-host tests pass or skip in the pytest gateas the change that both ask for.Both ask for the same four tests to pass or skip in the devcontainer with the same acceptance criteria.A person closes one of the two if that is so.dan-petty commentedon Nov 5, 2026
Issue #3301 reproduces these failures. A full
uv run devops cirun in the worktree of #3301 gives the same four failed tests and the same error.The same tests also fail on
origin/main(d254410c) in the main checkout, so the change of #3301 does not cause them.Host state seems to cause them. The file
/tmp/config.yamlexists from 2026-11-04, and the toolpopeyeis installed under~/.local/share/devops-cli/tools/.devops-cli-service commentedon Nov 5, 2026
Status set to Ready at d254410 (see proposed design in issue body).
dan-petty commentedon Nov 6, 2026
Duplicate of #3585. This item lists the same four failing tests, and the fix design is in #3585. No pull request or branch exists for this item, so no work is lost. This item closes as not planned. If a point of this item is missing in #3585, add it there.