Skip to content

refactor(clustertest): call init in add#367

Merged
jason-lynch merged 1 commit intomainfrom
refactor/clustertest-call-init-in-add
Apr 27, 2026
Merged

refactor(clustertest): call init in add#367
jason-lynch merged 1 commit intomainfrom
refactor/clustertest-call-init-in-add

Conversation

@jason-lynch
Copy link
Copy Markdown
Member

Summary

Refactors these tests so that Add also calls Init after creating the new host. These are always called together, and it was confusing that Add didn't modify the cluster membership, given that Remove does modify it.

Refactors these tests so that `Add` also calls `Init` after creating the
new host. These are always called together, and it was confusing that
`Add` didn't modify the cluster membership given that `Remove` does
modify it.
@jason-lynch jason-lynch requested a review from tsivaprasad April 27, 2026 16:17
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bf40c598-fb76-41e6-9108-6182c2b0d4d8

📥 Commits

Reviewing files that changed from the base of the PR and between 7810b77 and 6fce744.

📒 Files selected for processing (2)
  • clustertest/add_remove_host_test.go
  • clustertest/cluster_test.go
💤 Files with no reviewable changes (1)
  • clustertest/add_remove_host_test.go

📝 Walkthrough

Walkthrough

The (*Cluster).Add method now automatically performs cluster initialization and health checks after adding a new host. Correspondingly, test functions remove redundant manual re-initialization calls that are now handled by the Add method internally.

Changes

Cohort / File(s) Summary
Test cleanup
clustertest/add_remove_host_test.go
Removed redundant cluster.Init(t) calls after each cluster.Add(...) in TestJoin and TestRollingAddRemove, streamlining test flow now that initialization is automatic.
Add method enhancement
clustertest/cluster_test.go
The (*Cluster).Add method now invokes InitCluster and AssertHealthy immediately after adding a host and rebuilding the client, consolidating initialization logic.

Poem

🐰 A rabbit's delight in cleaner code so neat,
Add now initializes, making tasks complete,
No more duplicate calls in tests that run,
The cluster hops forward with initialization done!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a summary explaining the refactoring rationale, but is missing several required template sections: Changes, Testing, Checklist, and Notes for Reviewers. Add the missing template sections: provide a bulleted list of changes, document testing steps, complete the checklist, and add any notes for reviewers about risky areas or follow-ups.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: refactoring cluster tests to call init within the add operation.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/clustertest-call-init-in-add

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 and usage tips.

@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.

@jason-lynch jason-lynch merged commit 46cacdc into main Apr 27, 2026
3 checks passed
@jason-lynch jason-lynch deleted the refactor/clustertest-call-init-in-add branch April 27, 2026 18:19
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.

2 participants