Skip to content

Add test for admin cluster commands #6397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 23, 2024
Merged

Conversation

bowenxia
Copy link
Member

What changed?
Add test for admin cluster commands

Why?
Code coverage

How did you test it?
unit test

Potential risks

Release notes

Documentation Changes

@bowenxia bowenxia enabled auto-merge (squash) October 23, 2024 20:03
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.26%. Comparing base (2d93799) to head (533c074).
Report is 2 commits behind head on master.

Additional details and impacted files

see 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d93799...533c074. Read the comment docs.

@bowenxia bowenxia merged commit d834d5f into master Oct 23, 2024
19 checks passed
@bowenxia bowenxia deleted the xbowen/test_admin_cluster_cmds branch October 23, 2024 21:12
Comment on lines +147 to +148
serverFrontendClient := frontend.NewMockClient(mockCtrl)
serverAdminClient := admin.NewMockClient(mockCtrl)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's avoid defining mocks at top level like this. If one test case's expectation fails it will fail the rest. better to define these inside inner t.Run for isolation purposes

func TestAdminDescribeCluster(t *testing.T) {
// Initialize mock controller
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

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.

4 participants