Skip to content

fix(ci): devops ci test expands or refuses a path argument - #2879

Merged
dan-petty merged 11 commits into
mainfrom
fix/2868-ci-test-directory-verifies
Oct 31, 2026
Merged

dan-petty merged 11 commits into
mainfrom
fix/2868-ci-test-directory-verifies

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops ci test now checks each path before it selects tests.

  • A directory of tests/ runs the test modules inside it, at any depth. A directory of src/ runs the tests that cover the modules inside it.
  • A directory that gives no module, a directory outside src/ and tests/, and a path that does not exist exit with status 1. The error names the path, and no pytest starts. --fallback does not change this.
  • A trigger file that is gone, such as a deleted conftest.py, still forces the full run. A file that exists and maps to no test, such as README.md, still exits 0 with a note.
  • The plan-only step of ci.yml runs uv run devops ci test tests/invariants.

Before this change, devops ci test tests/invariants printed that nothing was to verify and exited 0. A green exit now means that a test ran.

The change is planned and archived as ci-test-selection in openspec/.

Closes #2868

@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 Oct 31, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

Review findings

  • Major, fixed: a path that does not exist gave a green exit (devops ci test tests/invariantz exited 0 with no test run). _expand_directories now refuses it with exit 1 and names the path. Test first, spec requirement A path that does not exist is refused, docs/TESTING.md and the paths help text are updated.
  • Design note: a trigger file that is gone (for example a deleted conftest.py) still forces the full run. Existing tests and the earlier behavior (CHANGELOG) rely on it. The commit hook runs no tests (fix(ci): a commit runs no test suite in pre-commit; the pre-push gate and CI run the tests #2086), and the changed-test job lists files with --diff-filter=AMR, so no caller passes a deleted file to be skipped.
  • One existing test, test_help_after_the_separator_is_a_path_and_the_check_names_its_root, passes --help as a path that does not exist. It now expects exit 1.

…ctory-verifies

# Conflicts:
#	tests/commands/test_ai_cmd.py
Main fails this test: the second read of capsys is empty after the first.
The merge of two pull requests made this. The test reads the output once.
@dan-petty

Copy link
Copy Markdown
Owner Author

Main fails tests/commands/test_ai_cmd.py::test_ai_chat_helpers_print_thought_and_tool (issue #2874): the merge of #2864 and #2873 left a second capsys.readouterr() that reads an empty buffer. This branch carries the one-test fix (commit fix(test): the chat helper test asserts what the helpers print (#2874)), so the required test check can pass. The PR body does not close #2874. If another pull request fixes it first, a merge of main drops this commit.

@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 15:45
…ctory-verifies

# Conflicts:
#	tests/commands/test_ai_cmd.py
@dan-petty

Copy link
Copy Markdown
Owner Author

Main fixed the chat helper test in #2876. This branch took the main version after a merge, so it carries no change to that test now.

@dan-petty
dan-petty merged commit 884a80b into main Oct 31, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2868-ci-test-directory-verifies branch October 31, 2026 15:54
dan-petty pushed a commit that referenced this pull request Oct 31, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.28.0](v0.27.0...v0.28.0)
(2026-10-31)


### Features

* **ai:** preview requests in dry run for rag ingest analyze
([#2873](#2873))
([c53bcec](c53bcec)),
closes [#2244](#2244)
* **ai:** preview requests in dry run for runs cost cache
([#2884](#2884))
([0df9777](0df9777))
* **roadmap:** the Service marks green stage drafts ready
([#2882](#2882))
([63fae06](63fae06)),
closes [#2865](#2865)
* **roadmap:** tool log names the reason of a retried call
([#2875](#2875))
([03d3dc5](03d3dc5)),
closes [#2866](#2866)


### Bug Fixes

* **ci:** devops ci test expands or refuses a path argument
([#2879](#2879))
([884a80b](884a80b)),
closes [#2868](#2868)
* **roadmap:** cap output and deadline of a step model call
([#2881](#2881))
([0c4bd3a](0c4bd3a)),
closes [#2869](#2869)

---
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): devops ci test accepts a directory, verifies nothing and exits 0

1 participant