Skip to content

Add reserved_object remove/add-guard/upsert test coverage - #561

Open
zaidshabbir25 wants to merge 1 commit into
mainfrom
add-reserved-object-test-coverage
Open

Add reserved_object remove/add-guard/upsert test coverage#561
zaidshabbir25 wants to merge 1 commit into
mainfrom
add-reserved-object-test-coverage

Conversation

@zaidshabbir25

Copy link
Copy Markdown
Contributor

Extend 027_reserved_object.pl with coverage for:

  • spock.reserved_object_remove(): removes operator-added rows, and is rejected by the guard for built-in rows.
  • spock.reserved_object_add() against a built-in: rejected via the guard on its leading UPDATE, leaving the built-in row unchanged.
  • reserved_object_add() upsert: a second call for the same (name, kind) updates the existing row in place instead of duplicating or erroring.

The added rows are removed within the test, and a baseline operator-row count assertion keeps the later pg_dump/restore round-trip counts valid.

Extend 027_reserved_object.pl with coverage for:
- spock.reserved_object_remove(): removes operator-added rows, and is
  rejected by the guard for built-in rows.
- spock.reserved_object_add() against a built-in: rejected via the guard
  on its leading UPDATE, leaving the built-in row unchanged.
- reserved_object_add() upsert: a second call for the same (name, kind)
  updates the existing row in place instead of duplicating or erroring.

The added rows are removed within the test, and a baseline operator-row
count assertion keeps the later pg_dump/restore round-trip counts valid.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b498d01-b24e-4b7e-abe5-0385f45c1371

📥 Commits

Reviewing files that changed from the base of the PR and between 4084ac3 and 2426dd3.

📒 Files selected for processing (1)
  • tests/tap/t/027_reserved_object.pl

📝 Walkthrough

Walkthrough

Changes

Reserved object mutation tests

Layer / File(s) Summary
Mutation guards
tests/tap/t/027_reserved_object.pl
Tests remove operator-added rows and reject removal or updates of built-in rows.
Upsert and cleanup
tests/tap/t/027_reserved_object.pl
Tests repeated additions without duplicate rows and restores the expected operator-row count during cleanup.

Poem

I’m a rabbit guarding rows,
Built-ins stay where each one goes.
New rows hop and update neat,
No duplicate carrot feet.
Cleanup leaves the count just right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the added test coverage for reserved object removal, guards, and upsert behavior.
Description check ✅ Passed The description directly explains the reserved object test coverage, guard behavior, upsert verification, and cleanup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-reserved-object-test-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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