Repository navigation
test: update cleanup test doubles for deployment evidence - #4250
Conversation
#4049 (req-lk-024) requires deployment evidence for every lockfile-driven deletion. Eight integration tests still drove cleanup with stale doubles: - skipped-integration ctx gains apm_dir (evidence reads the lock root); - the hermetic skill-sync fake target gains a string prefix; - wave6 hook and skill syncs supply receipts, and the skill lockfile claim lists its member as real installs record it; - the uninstall hook-cleanup fixture seeds the local deployment receipt the installing machine holds, with no render of the unfetchable locked package. Part of #3701 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the cleanup integration-test fixture updates.
No open issues 🎉
What changed in this PR
Updates cleanup integration-test doubles to match the deployment-evidence requirement introduced by #4049 for #3701. Production behavior and deletion safeguards remain unchanged.
Changes:
- Supplies deployment receipts and tracked skill members so cleanup tests can exercise authorized deletion.
- Seeds uninstall receipts and disables unavailable render fallback so tests reach their intended failure paths.
- Adds missing context and target attributes required by cleanup validation.
| File | Description |
|---|---|
tests/integration/test_wave6_integrators_coverage.py |
Adds receipt evidence for hook and skill cleanup, plus the tracked skill member. |
tests/integration/test_uninstall_hook_cleanup_failure.py |
Seeds local receipts and stubs render fallback for uninstall failure tests. |
tests/integration/test_skipped_integration_preserves_deployments.py |
Adds apm_dir to the fake install context. |
tests/integration/test_skill_integrator_hermetic.py |
Adds prefix and managed-root attributes to the fake target. |
Review effort: Balanced
Five sync tests still expected deletion on a lockfile hash alone. They now supply local deployment receipts (hook syncs, the skill sync with its member claim) and call the evidence-taking sync_for_target instead of the legacy agent and prompt shims, which carry no evidence and so keep files (req-lk-024). Part of #3701 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
… cowork oracles More test doubles for the deletion-evidence API (req-lk-024): - seed_receipts() records the receipt the installing machine holds, for fixtures that forge a lockfile and its deployed files (uninstall of agent-skills and grok-bot, the uninstall hook fixture); - Gemini command and skill syncs supply receipts; skill claims list their members as real installs record them; - the cross-package collision ctx gains apm_dir; - the local-bundle cleanup oracle supplies evidence (same change as #4222); - the cowork lifecycle case declares its dependency instead of a positional github.com package, which validation probes via REST. Part of #3701 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…d's filter message 9e93d20 added root apm_modules to EXCLUDED_ROOTS (18 entries). The orphan guard (#4011) now reports a lock-row filter mutation as 'Removal sites must not filter installed or locked sets'; it still catches renamed-evidence-predicate. Part of #3701 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
Landing under the infra-only plus known-red exemption (0.37 PM, 12:41). Full-integration run 44724951473: the only non-infra red is Integration Tests Shard 2. All its failures are tests/integration/test_gitlab_sparse_transport_mutations.py and tests/unit/deps/test_gitlab_sparse_transport_contract.py (family N), fixed on main by #4269; this run's merge ref predates that fix. The other reds are infra: CodeQL rate limit, NOTICE Drift Check, eligibility evidence. |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Description
Since #4049 (req-lk-024), every lockfile-driven deletion needs deployment evidence. Eight integration tests on
main(72ccb23e, Shard 4) still drove cleanup with stale test doubles. Each one is a stale double, not a production regression, and the production paths are unchanged:test_skipped_integration_preserves_deploymentsSimpleNamespacehas noapm_dir(phases/cleanup.py:57reads the lock root)apm_dir. The evidence render is lazy, and nothing is dropped, so the assertions are unchanged.test_skill_integrator_hermetic::TestSyncIntegration::test_managed_files_removes_tracked_skill_dirstartswithgiven aMagicMock(get_integration_prefixesreadstarget.prefix)prefix=".github/"andmanaged_deploy_root=None. An empty recorded skill directory holds no bytes, so the deferred skill-directory pass removes it without evidence.test_wave6_integrators_coverage::TestSyncIntegrationHooks::test_removes_tracked_hook_files0 == 1: no evidence, so the file is keptreceipted_evidencefor the hook, modelling APM's own write.test_wave6_integrators_coverage::TestSkillIntegratorSyncIntegration::test_removes_tracked_skill_directories0 >= 1:SKILL.mduntracked, so the directory is kepttest_uninstall_hook_cleanup_failurex4github.com/owner/installed_prepare_hook_installseeds the real local deployment receipt (throughDeploymentMaterializationSession) that the installing machine holds, and stubs_render_lockedtoNone(the package is not fetchable), so the tests reach the hook-cleanup failure paths they cover.The uninstall behavior seen in the failing output is correct under req-lk-024: with no receipt and no render, the hook is kept and uninstall stops. So these are not production regressions, and the deletion-evidence rule is unchanged.
Issue and approved scope
Issue: Refs #3701 (Part of #3701)
Human scope-approval comment: #3701 (comment). The 0.37 Stream H lead requested this fix (main regression traced by lane bcb09e24).
Does this PR complete the issue, or what remains? Nothing remains. This PR repairs test doubles only.
Type of change
Testing
full-integrationlabel.Changelog
Spec conformance (OpenAPM v0.1)