Skip to content

test(import[prune]) Add edge-case tests for prune scoping#533

Open
tony wants to merge 1 commit into
masterfrom
test/prune-edge-cases
Open

test(import[prune]) Add edge-case tests for prune scoping#533
tony wants to merge 1 commit into
masterfrom
test/prune-edge-cases

Conversation

@tony

@tony tony commented Mar 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Add 3 new prune edge-case tests covering previously untested scenarios
  • Test --prune without import_source does nothing (Finding 13)
  • Test --sync --prune together is idempotent with --sync alone (Finding 14)
  • Test same-name same-source repos across workspaces prune correctly (Finding 1)

Test plan

  • uv run py.test -vvv — all tests pass
  • uv run mypy — clean
  • uv run ruff check . — clean

@tony

tony commented Mar 1, 2026

Copy link
Copy Markdown
Member Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Base automatically changed from import-overwrite-merge-behavior to master March 2, 2026 02:24
why: Three prune edge cases had no test coverage.
what:
- Test --prune without import_source does nothing (Finding 13)
- Test --sync --prune together is idempotent with --sync alone (Finding 14)
- Test same-name same-source repos across workspaces prune correctly (Finding 1)
@tony

tony commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current master and corrected. During review, test_import_prune_same_source_across_workspaces (Case 1) asserted the opposite of master's intentional, tested behavior: it expected a same-named repo in a non-target workspace to survive as long as the name is still on the remote, whereas master scopes prune to the import target and prunes the stale non-target copy (documented by test_import_prune_cross_workspace_same_source_same_name).

Confirmed with the maintainer that master's scoping is correct, so I fixed Case 1's expectation instead of changing behavior: the target workspace keeps myrepo, the non-target stale copy is pruned; Case 2 (remote returns nothing → both pruned) is unchanged. The other two tests (_without_import_source_does_nothing, _sync_prune_together_idempotent_with_sync_alone) were already correct. No source changes — tests only. Full gate green.

@tony tony force-pushed the test/prune-edge-cases branch from 67c5175 to 510c23e Compare July 5, 2026 15:20
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.30%. Comparing base (e6a62d9) to head (510c23e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #533   +/-   ##
=======================================
  Coverage   83.30%   83.30%           
=======================================
  Files          32       32           
  Lines        4492     4492           
  Branches      903      903           
=======================================
  Hits         3742     3742           
  Misses        499      499           
  Partials      251      251           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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