Skip to content

fix(test): tests never write to the project config, data or tracked files #749

Closed

Description

@dan-petty

Context & Rationale

Tests sometimes change the maintainer's config.yaml values and write into the real .data directory. Isolation exists, but it's partial. isolate_data_dir (tests/conftest.py) points DEVOPS_CLI_DATA_DIR at a temporary directory for each test. save_settings (config/settings.py:936-946) refuses to overwrite the workspace config.yaml while PYTEST_CURRENT_TEST is set, and hardcodes /workspaces/devops-cli/config.yaml to do it. Writes that bypass save_settings, and settings cached before the per-test fixture runs, still reach the real files. During the gate runs on 2026-09-30, CHANGELOG.md briefly disappeared, and .git/index.lock was left behind twice.

Scope & Deliverables

  • Deliverable: a tripwire for the test session. It snapshots config.yaml, the git-tracked files and the real .data tree when the run starts, and fails the run, naming each changed path, when anything differs at the end.
    • Every test gets its own temporary config through DEVOPS_CLI_CONFIG, as it already does for the data directory.
    • Fix each leak the tripwire reports.
    • Once the tripwire covers it, remove the test-only branch and the hardcoded path from save_settings.
  • Constraint: the tripwire runs once, in the xdist controller, so workers don't race it.

Strategic Alignment

Activity

  1. added this to the v0.2.24 milestone on Sep 30, 2026
  2. added
    type/bug
    priority/p0-critical
    scope/ci
    on Sep 30, 2026
  3. dan-petty commented on Oct 1, 2026

    @dan-petty
    OwnerAuthor

    Closed by #758, merged into release/v0.2.24.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

  4. added a commit that references this issue on Oct 1, 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

    priority/p0-criticalscope/citype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions