Skip to content

fix(ci): Tests read no state of the host - #3871

Merged
dan-petty merged 3 commits into
mainfrom
fix/3585-host-state-tests
Nov 7, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/3585-host-state-tests

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A config.yaml in a shared directory, such as /tmp, counted as a project config, and tests read the tools of the host. The project config search and the SSH key prefix search now take an ancestor config file only at a project root (.git or .devcontainer), through one shared walk. The install-tools status test and the direct-executor network-profile case use a target directory, a PATH and a stand-in of their own, so they pass with or without the tools on the host.

Closes #3585

Change: openspec/changes/archive/2026-11-06-3585-host-state-tests/
Elapsed: 4.92s

The project config search and the SSH key prefix search take an ancestor config.yaml only at a project root. The install-tools status test, and the direct-executor network-profile case, use a target directory, a PATH and a stand-in of their own.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 7, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results and evidence for #3585.

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main, with a stray /tmp/config.yaml that sets ssh.key_prefix): the new tests test_a_config_file_in_a_directory_without_a_project_marker_names_no_prefix and test_project_config_search_takes_an_ancestor_file_only_at_a_project_root[no-marker-ignored] fail on the base source and pass with the fix. The two other cases that this host failed (install-tools status, Popeye) are test-side fixes; their new tests pass on both trees by design.

Full uv run devops ci on this host: pytest and coverage, mypy, bandit and the other rows passed. The rows ruff format, ruff check and docs validation failed in that run because I rebased the branch while the run was in progress; I ran ruff format --check, ruff check and devops ci docs again on the final tree and all passed. The four modules give 197 passed on the final tree. The pytest step took 10m 28s on a loaded host; that time belongs to #3593.

Premise differences from the refine design (recorded in the proposal under Feasibility):

  • The SSH test failure does not come from the process working directory. _resolve_prefix_from_project_config had its own copy of the ancestor walk, and it reached /tmp/config.yaml. A chdir in the test would not fix it. The change replaces the copy with one shared walk (project_config_directories).
  • install-tools status searches its target directory first (default ~/.local/bin), and PATH second. An empty PATH alone still shows the host tool, as an earlier reviewer saw. The test gives --target-dir too.

#3025: its two criteria are covered. test_mark_only_commands_under_global_dry_run passes on a host that has the devcontainer CLI (this host), and the new test_install_tools_status_shows_a_tool_at_its_pin_under_global_dry_run shows not installed without the tool and at pin with it. #3025 stays open for a person; the body does not close it.

Duplicates named in the comments of #3585: #3590, #3594 and #3597 are closed. #3593 is open; its pytest-time part is not in this pull request.

@dan-petty
dan-petty marked this pull request as ready for review November 7, 2026 00:20
@dan-petty
dan-petty merged commit f600ed4 into main Nov 7, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/3585-host-state-tests branch November 7, 2026 00:23
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.76.1](v0.76.0...v0.76.1)
(2026-11-07)


### Bug Fixes

* **ci:** Tests read no state of the host
([#3871](#3871))
([f600ed4](f600ed4)),
closes [#3585](#3585)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): host state fails four tests and one case

1 participant