randomparity / randomparity/kdive
Last build-profile restatement sits in a live_stack-marked suite, so drift is invisible to CI
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 26m
- Merged PRs (30d)
- 311
Description
## Problem
`tests/integration/test_finalization_measurement.py:185` restates the build-profile document inline
instead of calling the shared factory #2511 introduced. It is the last remaining instance of the
restatement #2511 consolidated — six were migrated across ten call sites, and this one was outside
that issue's approved surface.
The reason it is worth an issue rather than a note is not the duplication. It is that this site is
**invisible to ordinary CI**. The module is `@pytest.mark.live_stack` (line 136), so it is
deselected in every run that does not have a provisioned stack. A change to `BuildProfile` updates
the shared factory and the non-gated guard that pins it, both go green, and this site keeps sending
the old shape — surfacing only on a provisioned host, in a suite that already takes minutes to
reach the failure.
The module already imports from the shared spine at line 53, so the factory is one symbol away.
## Evidence
- `tests/integration/test_finalization_measurement.py:185` — the restatement:
```python
"build_profile": {"schema_version": 1, "arch": arch},
```
parametrised over `x86_64` and `ppc64le`, so it restates the document for both arches.
- `tests/integration/test_finalization_measurement.py:136` — `@pytest.mark.live_stack`, which is
what makes the drift invisible to ordinary CI.
- `tests/integration/test_finalization_measurement.py:53` — the module already does
`from tests.integration.live_stack.spine import (...)`, so using the shared factory adds no new
import edge.
- `tests/integration/live_stack/spine.py` — `build_profile(arch=...)`, the shared factory added by
#2511, and `tests/integration/live_stack/test_build.py` — the non-gated guard that pins its
output against the real `BuildProfile` validator. The guard covers the factory's consumers; it
cannot cover a site that does not call the factory.
## Expected
Every integration test that sends a build-profile document gets it from the shared factory, so a
`BuildProfile` change is caught by the non-gated guard rather than by a live run on a provisioned
host. The `live_stack`-marked suites are exactly the ones where a late failure is most expensive,
which is the argument for them depending on the shared factory rather than against it.
## Proposed approach
1. Replace the inline dict at `:185` with the shared `build_profile(arch=arch)` factory.
2. Confirm the document is unchanged for both parametrised arches — this should be a no-op at the
wire, and if it is not, the difference is the finding.
3. Check that no further instance has appeared since #2511 landed. At the time of filing this was
the only one, established by the implementer of #2511 while migrating the other ten call sites.
## Out of scope
- The `_provision_profile` / `_remote_provision_profile` / `_live_script_provision_profile` family.
Those are a **different document type** and are only partly alike: `test_console_parts_live.py`
deliberately omits `crashkernel` and `destructive_ops` because it never crashes the guest,
`_remote_provision_profile` targets a different provider section, and
`_live_script_provision_profile` drops the `force_crash` opt-in per ADR-0315. Consolidating them
means designing a parameterised factory over provider/crashkernel/destructive_ops — a design
question, not a substitution — and there is no established failure mode. Recorded as a lead, not
folded in here.
- `tests/integration/_seed.py`'s `BUILD_PROFILE`, which is a different defect: it persists a
document the model rejects. Filed separately.
## Provenance
Reported by the implementer of #2511 as adjacent to its consolidation and outside its approved
surface. Initially assessed as duplication and declined; re-examined and filed once the
`live_stack` marker at line 136 was confirmed, which is what turns a tidiness issue into a drift
site ordinary CI cannot see. The marker, the import at line 53 and the restatement at line 185 were
each verified before filing. Filed at the repository operator's explicit request.
Contributor guide
Research direction
Start at tests/integration/test_finalization_measurement.py:185 and read build_profile(arch=...) in tests/integration/live_stack/spine.py, along with the parametrization for both arches. Replace the inline build-profile document with the shared factory, then run the relevant integration test and tests/integration/live_stack/test_build.py. Done means both arches retain the same wire document and the non-gated guard covers this consumer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 90/100