Repository navigation
Description
Problem or Motivation
Item 2 of the Fit note of #1333. Three config test files rebind devops_cli.config.settings.CONFIG_PATH with monkeypatch.setattr: tests/telemetry/test_config_env_overrides.py (5 sites), tests/core/test_config_settings_cache.py (2 sites) and tests/config/test_ai_task_settings_paths.py (1 site). The hermetic floor already gives each test its own config.yaml through DEVOPS_CLI_CONFIG, and the config fixture (tests/support/config.py) writes overrides into that file and resets the settings cache. So the rebinding is a private patch that the floor makes needless.
The tree has moved since #1333 was written. The 6 _keyring patches are already gone: tests/config/test_headless_auth.py and the telemetry tests use the keyring_store fake (#1318). No test patches a _keyring name or imports _keyring_get or _keyring_set.
A later item (item 7 of #1333) removes CONFIG_PATH from the settings cache key. It cannot do so while these tests rebind it.
Proposed Solution & Architectural Design
- Each test writes its config through the
configfixture, or through the floor's config file when it needs raw text that is not a mapping. No test rebindsCONFIG_PATH. tests/core/test_config_settings_cache.pytests the stamp cache through the floor's config file. It checks the cache through behavior (whatload_settingsreturns), not through the private_CONFIG_CACHE, where the behavior shows it.tests/config/test_ai_task_settings_paths.pyuses the floor's config and drops its ownown_configrebinding.- Prove the migration keeps coverage: mutate the product code in a scratch copy and confirm the migrated tests fail.
- Out of scope: the cache key in
config/settings.py(item 7), otherCONFIG_PATHrebinding sites in other files, and the other items of test(cli): Use edge fakes and real git; drop test rebind hooks #1333.
Target Subsystem
Tests (tests/config, tests/core, tests/telemetry).
Existing Tool Considered
pytest monkeypatch and the project's config fixture. The fixture exists, so no new tool is built. No cost to build.
Acceptance criteria
- No test in the three files names
CONFIG_PATHorsettings.CONFIG_PATH. - No test in the three files patches a
_keyringname. - Each migrated test fails when the product behavior it covers is mutated.
-
uv run devops cipasses.
Related
Related: #1333 (parent), #1307, #1310 (config fixture), #1318 (keyring fake).
Activity
dan-petty commentedon Nov 6, 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.(config)scope of the title gives the scope.It blocks item 7 of #1333 but is a test migration, not a user-facing defect.It removes needless monkeypatching and unblocks the cache-key change, improving test maintainability.Eight monkeypatch sites across three files must migrate to the existing config fixture, with a mutation check and CI pass.Both concern dropping test rebind hooks, but #1333 is the umbrella for 36 test files while the candidate covers only the three config files named in its item 2.test(config): config tests use the config fixture and edge fakes (#3867)