Skip to content

Fix #252: Add exact-output assertion for schedule create example normalization - #253

Open
kaovilai wants to merge 1 commit into
migtools:oadp-devfrom
redhat-chai-bot:fix-252-exact-output-assertion
Open

Fix #252: Add exact-output assertion for schedule create example normalization#253
kaovilai wants to merge 1 commit into
migtools:oadp-devfrom
redhat-chai-bot:fix-252-exact-output-assertion

Conversation

@kaovilai

@kaovilai kaovilai commented Jul 31, 2026

Copy link
Copy Markdown
Member

Adds exact-output assertion to TestReplaceVeleroWithOADP_ScheduleCreateVerbFirst in cmd/root_test.go.

Fixes #252

Note

Proposed by chai-bot (redhat-chai-bot), opened as draft via Claude Code.

Summary by CodeRabbit

  • Tests
    • Added coverage to verify that schedule creation produces the exact expected normalized output, including whitespace and command lines.

…igtools#252)

Add a full string comparison to TestReplaceVeleroWithOADP_ScheduleCreateVerbFirst
that verifies cmd.Example matches the complete expected normalized text after
the verb-first "velero create schedule" is rewritten to "oc oadp schedule create".

The existing checks for removal of "velero create schedule" and the occurrence
count of "oc oadp schedule create NAME" are kept as complementary guards. The
new assertion catches any drift in whitespace, ordering, or replacement logic
and shows both expected and actual strings on failure.

Fixes migtools#252

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaovilai

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5385ff11-58b0-451f-b42f-2b02fe5bd2dd

📥 Commits

Reviewing files that changed from the base of the PR and between 6be8c20 and 31f947e.

📒 Files selected for processing (1)
  • cmd/root_test.go

📝 Walkthrough

Walkthrough

The schedule-create normalization test now checks the complete expected output, including both normalized command lines, ordering, and whitespace.

Changes

Schedule normalization test

Layer / File(s) Summary
Exact normalized output validation
cmd/root_test.go
The test compares the normalized example with the complete expected string while retaining the existing replacement and occurrence-count checks.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • migtools/oadp-cli#243: Introduced the schedule-create normalization behavior that this test now validates.

Suggested reviewers: nicholasyancey

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the exact-output assertion added for schedule-create normalization.
Description check ✅ Passed The description identifies the test change and issue #252, but it omits explicit testing steps from the template.
Linked Issues check ✅ Passed The change adds the complete expected output assertion for the targeted test while retaining the required normalization checks.
Out of Scope Changes check ✅ Passed The change is limited to the targeted test and directly supports issue #252 without unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@kaovilai
kaovilai marked this pull request as ready for review July 31, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add exact-output assertion for schedule create example normalization

2 participants