Skip to content

test(cli): cover rm purge dry-run#110

Draft
overtrue wants to merge 2 commits intomainfrom
codex/rm-purge-dry-run-gap
Draft

test(cli): cover rm purge dry-run#110
overtrue wants to merge 2 commits intomainfrom
codex/rm-purge-dry-run-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This PR adds coverage for a recent rm --purge path that was still untested: running the command with --dry-run against a versioned object. Without this test, the purge feature only had assertions for real deletes, not for the safety path that should avoid both permanent deletion and delete-marker creation.

The branch also adds a minimal root Makefile with a pre-commit target because this repository did not expose make pre-commit, while the documented local validation steps already existed as standalone cargo commands. The new target simply wraps the existing required checks.

Root Cause

The recent purge work added permanent-delete behavior, but the dry-run interaction lived on a separate execution path and did not have focused regression coverage. That left a gap where a future change could accidentally route dry-run purge requests into the destructive path without a targeted test failing.

Fix

The new integration test enables versioning, uploads a single object, runs rc rm --purge --dry-run --json, and then verifies that the object still has exactly one non-delete-marker version. This keeps the scope on the changed rm purge area and exercises the user-visible behavior directly.

Validation

  • cargo test --features integration --test integration option_behavior_operations::test_rm_purge_dry_run_does_not_delete_versioned_object -- --exact --nocapture
  • make pre-commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant