Skip to content

test(config): config tests run on the keyring fake and a config fixture #3858

Closed

Description

@dan-petty

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 config fixture, or through the floor's config file when it needs raw text that is not a mapping. No test rebinds CONFIG_PATH.
  • tests/core/test_config_settings_cache.py tests the stamp cache through the floor's config file. It checks the cache through behavior (what load_settings returns), not through the private _CONFIG_CACHE, where the behavior shows it.
  • tests/config/test_ai_task_settings_paths.py uses the floor's config and drops its own own_config rebinding.
  • 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), other CONFIG_PATH rebinding 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_PATH or settings.CONFIG_PATH.
  • No test in the three files patches a _keyring name.
  • Each migrated test fails when the product behavior it covers is mutated.
  • uv run devops ci passes.

Related

Related: #1333 (parent), #1307, #1310 (config fixture), #1318 (keyring fake).

Activity

  1. added
    source/agent
    type/test
    scope/config
    status/new
    value/medium
    effort/medium
    on Nov 6, 2026
  2. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/config. The (config) scope of the title gives the scope.
    • Priority: P2-Medium. It blocks item 7 of #1333 but is a test migration, not a user-facing defect.
    • Value: Medium. It removes needless monkeypatching and unblocks the cache-key change, improving test maintainability.
    • Effort: Medium. Eight monkeypatch sites across three files must migrate to the existing config fixture, with a mutation check and CI pass.
    • Related: test(cli): Use edge fakes and real git; drop test rebind hooks #1333, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. added
    status/in-progress
    and removed
    status/new
    on Nov 6, 2026
  5. added a commit that references this issue on Nov 6, 2026
    0550497
  6. removed
    status/in-progress
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/configsource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions