fix(tests): restore pytest 9-compatible docker_mock fixture registration #808

Closed
opened 2026-06-19 01:27:18 +02:00 by codex · 1 comment
Collaborator

Spec sources (whitelist)

  • control-plane/platformctl/tests/conftest.py
  • control-plane/platformctl/tests/fixtures/docker_mock.py
  • control-plane/platformctl/tests/test_plan_integration.py
  • docs/forgejo-agent-operations.md §Issue Rules

Extracted context

From control-plane/platformctl/tests/fixtures/docker_mock.py:

@pytest.fixture
def docker_mock() -> DockerMockProvider:
    return DockerMockProvider()

From control-plane/platformctl/tests/test_plan_integration.py:

def _plan(module_id: str, docker_mock: DockerMockProvider, tmp_path: Path) -> tuple[dict, int]:
    return plan_module(module_id, out_path=tmp_path / f"{module_id}.plan.json", transport=docker_mock)

From Antigravity/Gemini audit, 2026-06-19: nested pytest_plugins was reported as incompatible with pytest 9.x, but later ruff cleanup tried to remove the direct fixture import as unused.

Do NOT read (unless escape hatch fires)

  • control-plane/platformctl/tools/ — runtime implementation is out of scope; this is fixture registration only.
  • modules/ — module manifests do not affect this pytest fixture contract.

Allowed touched paths

  • control-plane/platformctl/tests/conftest.py (modify)
  • control-plane/platformctl/tests/test_plan_integration.py (read only unless a minimal assertion is needed)

Why this exists (product-first)

Agents need the platformctl test suite to collect reliably on current pytest versions. The docker_mock fixture is part of the read-only runtime planning test surface; losing fixture discovery turns a simple linter cleanup into a broken test harness.

Why this matters now

The Antigravity audit found the pytest 9 compatibility issue, but the follow-up ruff cleanup appears to remove the import pytest needs for fixture registration. This should be made explicit and pinned with a focused test command before any branch cleanup is merged.

What "done" looks like

  • control-plane/platformctl/tests/conftest.py registers docker_mock without using nested pytest_plugins.
  • Ruff does not flag the intentional fixture import, e.g. via explicit alias/re-export or scoped noqa.
  • PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_plan_integration.py passes.
  • PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests collects without pytest-plugin deprecation errors.

Scope

In scope:

  • Pytest fixture registration for docker_mock.
  • Minimal lint suppression if needed.

Out of scope:

  • Broad ruff cleanup.
  • Runtime Docker behavior changes.
  • platformctl planning semantics.

Suggested approach

  1. Replace nested pytest_plugins with an explicit import that pytest can discover and ruff will not remove.
  2. Run the focused test_plan_integration.py test.
  3. Run the broader platformctl collection/test command if cheap enough.

Escape hatch

If pytest no longer needs this fixture import, comment with the exact pytest discovery evidence before deleting it. Do not silently accept an empty conftest.py just because ruff reports an unused import.

Unknowns / owner questions

  • None expected.

Risk class

  • risk/runtime — test harness validates read-only runtime planning behavior.
  • risk/process — bad lint cleanup can break agent-visible verification.

Class of service

  • class/security-sensitive

Trace

  • Original source: Antigravity/Gemini audit reviewed in Codex side conversation, 2026-06-19.
  • Migrated by: codex, 2026-06-19.
  • Related local branch: antigravity/orders/audit-reconcile.
## Spec sources (whitelist) - `control-plane/platformctl/tests/conftest.py` - `control-plane/platformctl/tests/fixtures/docker_mock.py` - `control-plane/platformctl/tests/test_plan_integration.py` - `docs/forgejo-agent-operations.md` §Issue Rules ## Extracted context > From `control-plane/platformctl/tests/fixtures/docker_mock.py`: > ```python > @pytest.fixture > def docker_mock() -> DockerMockProvider: > return DockerMockProvider() > ``` > > From `control-plane/platformctl/tests/test_plan_integration.py`: > ```python > def _plan(module_id: str, docker_mock: DockerMockProvider, tmp_path: Path) -> tuple[dict, int]: > return plan_module(module_id, out_path=tmp_path / f"{module_id}.plan.json", transport=docker_mock) > ``` > > From Antigravity/Gemini audit, 2026-06-19: nested `pytest_plugins` was reported as incompatible with pytest 9.x, but later ruff cleanup tried to remove the direct fixture import as unused. ## Do NOT read (unless escape hatch fires) - `control-plane/platformctl/tools/` — runtime implementation is out of scope; this is fixture registration only. - `modules/` — module manifests do not affect this pytest fixture contract. ## Allowed touched paths - `control-plane/platformctl/tests/conftest.py` (modify) - `control-plane/platformctl/tests/test_plan_integration.py` (read only unless a minimal assertion is needed) ## Why this exists (product-first) Agents need the platformctl test suite to collect reliably on current pytest versions. The `docker_mock` fixture is part of the read-only runtime planning test surface; losing fixture discovery turns a simple linter cleanup into a broken test harness. ## Why this matters now The Antigravity audit found the pytest 9 compatibility issue, but the follow-up ruff cleanup appears to remove the import pytest needs for fixture registration. This should be made explicit and pinned with a focused test command before any branch cleanup is merged. ## What "done" looks like - [ ] `control-plane/platformctl/tests/conftest.py` registers `docker_mock` without using nested `pytest_plugins`. - [ ] Ruff does not flag the intentional fixture import, e.g. via explicit alias/re-export or scoped noqa. - [ ] `PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_plan_integration.py` passes. - [ ] `PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests` collects without pytest-plugin deprecation errors. ## Scope **In scope:** - Pytest fixture registration for `docker_mock`. - Minimal lint suppression if needed. **Out of scope:** - Broad ruff cleanup. - Runtime Docker behavior changes. - platformctl planning semantics. ## Suggested approach 1. Replace nested `pytest_plugins` with an explicit import that pytest can discover and ruff will not remove. 2. Run the focused `test_plan_integration.py` test. 3. Run the broader platformctl collection/test command if cheap enough. ## Escape hatch If pytest no longer needs this fixture import, comment with the exact pytest discovery evidence before deleting it. Do not silently accept an empty `conftest.py` just because ruff reports an unused import. ## Unknowns / owner questions - None expected. ## Risk class - [x] `risk/runtime` — test harness validates read-only runtime planning behavior. - [x] `risk/process` — bad lint cleanup can break agent-visible verification. ## Class of service - [ ] `class/security-sensitive` ## Trace - Original source: Antigravity/Gemini audit reviewed in Codex side conversation, 2026-06-19. - Migrated by: codex, 2026-06-19. - Related local branch: `antigravity/orders/audit-reconcile`.
Collaborator

Iskra judgment

Field Value
Target pdurlej/platform#issue#808
Priority p2
Action codex_candidate
Scores reach 3 / impact 3 / confidence 4
Piotr fit medium
Effort tiny
Labels judge/p2, judge/codex-candidate
Judge iskra via openclaw

Rationale: This is a small Codex-suitable CI fix with clear scoped files and low production blast radius, but it protects pytest compatibility for platformctl tests.

Caveat: The judgment relies on the supplied excerpt and does not verify the actual pytest failure locally.

Structured openclaw.judge.v0 payload
<!-- openclaw.judge.v0 -->
{
  "confidence": 4,
  "effort_hint": "tiny",
  "escalation": {
    "kind": "none",
    "reason": ""
  },
  "evidence_refs": [
    {
      "note": "Public repository metadata and dry-run packet only.",
      "type": "snapshot",
      "value": "issue-or-pr-title-body-labels-and-target-snapshot"
    }
  ],
  "impact": 3,
  "judge_actor": {
    "name": "iskra",
    "runtime": "openclaw"
  },
  "judged_at": "2026-06-20T00:00:00Z",
  "labels_to_apply": [
    "judge/p2",
    "judge/codex-candidate"
  ],
  "piotr_fit": "medium",
  "priority": "p2",
  "rationale_summary": "This is a small Codex-suitable CI fix with clear scoped files and low production blast radius, but it protects pytest compatibility for platformctl tests.",
  "reach": 3,
  "recommended_next_action": "codex_candidate",
  "rerun_reason": "no_prior_judgment",
  "schema": "openclaw.judge.v0",
  "target": {
    "kind": "issue",
    "number": 808,
    "repo": "pdurlej/platform"
  },
  "target_snapshot": {
    "body_hash": "sha256:0dd695c16f3750035768d8691917f958808b4b13568f402fb7ad9d05e6faee43",
    "commit_count": null,
    "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "head_sha": null,
    "labels": [
      "agent/codex",
      "domain:ci",
      "proposed",
      "risk/process",
      "risk/runtime",
      "safety:no-prod-mutation",
      "size/tiny",
      "source/agent-generated",
      "type:bug"
    ],
    "labels_hash": "sha256:cf3ffec15e1ec0bdefc9d8ab6428a43827ace6200acd3f006c97545d831988ac",
    "state": "open",
    "title_hash": "sha256:1dab883ee676383b65ebedf3ab79b63f5919de6deeb87f208d71352838901993",
    "updated_at": "2026-06-19T01:27:18+02:00"
  },
  "top_caveat": "The judgment relies on the supplied excerpt and does not verify the actual pytest failure locally."
}
<!-- /openclaw.judge.v0 -->
### Iskra judgment | Field | Value | | --- | --- | | Target | `pdurlej/platform#issue#808` | | Priority | p2 | | Action | codex_candidate | | Scores | reach 3 / impact 3 / confidence 4 | | Piotr fit | medium | | Effort | tiny | | Labels | `judge/p2`, `judge/codex-candidate` | | Judge | `iskra` via `openclaw` | **Rationale:** This is a small Codex-suitable CI fix with clear scoped files and low production blast radius, but it protects pytest compatibility for platformctl tests. **Caveat:** The judgment relies on the supplied excerpt and does not verify the actual pytest failure locally. <details> <summary>Structured openclaw.judge.v0 payload</summary> ```json <!-- openclaw.judge.v0 --> { "confidence": 4, "effort_hint": "tiny", "escalation": { "kind": "none", "reason": "" }, "evidence_refs": [ { "note": "Public repository metadata and dry-run packet only.", "type": "snapshot", "value": "issue-or-pr-title-body-labels-and-target-snapshot" } ], "impact": 3, "judge_actor": { "name": "iskra", "runtime": "openclaw" }, "judged_at": "2026-06-20T00:00:00Z", "labels_to_apply": [ "judge/p2", "judge/codex-candidate" ], "piotr_fit": "medium", "priority": "p2", "rationale_summary": "This is a small Codex-suitable CI fix with clear scoped files and low production blast radius, but it protects pytest compatibility for platformctl tests.", "reach": 3, "recommended_next_action": "codex_candidate", "rerun_reason": "no_prior_judgment", "schema": "openclaw.judge.v0", "target": { "kind": "issue", "number": 808, "repo": "pdurlej/platform" }, "target_snapshot": { "body_hash": "sha256:0dd695c16f3750035768d8691917f958808b4b13568f402fb7ad9d05e6faee43", "commit_count": null, "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "head_sha": null, "labels": [ "agent/codex", "domain:ci", "proposed", "risk/process", "risk/runtime", "safety:no-prod-mutation", "size/tiny", "source/agent-generated", "type:bug" ], "labels_hash": "sha256:cf3ffec15e1ec0bdefc9d8ab6428a43827ace6200acd3f006c97545d831988ac", "state": "open", "title_hash": "sha256:1dab883ee676383b65ebedf3ab79b63f5919de6deeb87f208d71352838901993", "updated_at": "2026-06-19T01:27:18+02:00" }, "top_caveat": "The judgment relies on the supplied excerpt and does not verify the actual pytest failure locally." } <!-- /openclaw.judge.v0 --> ``` </details>
Sign in to join this conversation.
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/platform#808
No description provided.