-
Notifications
You must be signed in to change notification settings - Fork 167
Fix gocyclo lint error for internal/lvmd #1001
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eb4f9a0
to
58a5c18
Compare
06679bd
to
63080a8
<
8000
a href="/topolvm/topolvm/compare/06679bdd77b1c95fd2824d03c85a943fb6ebb6f1..63080a8a53b50cb4995e0a3febecbe8ed2b17b9e" data-hydro-click="{"event_type":"force_push_timeline_diff.click","payload":{"pull_request_id":2246296505,"repository_id":183557088,"event_id":15916122329,"originating_url":"https://github.com/topolvm/topolvm/pull/1001","user_id":null}}" data-hydro-click-hmac="ae0d96139f10b72fd901b955f013f48e9d174abe1ec0b13723b5c25fc678ff21" data-view-component="true" class="Button--invisible Button--small Button Button--invisible-noVisuals float-right ml-2">
Compare
63080a8
to
4cf3521
Compare
The struct is defined in lvm.go, so tests should be in lvm_test.go. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
These assertions are already tested on the Thin volume test cases. To reduce cyclomatic complexity, delete them. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
034b4b4
to
05ba7cb
Compare
peng225
previously approved these changes
Jan 20, 2025
satoru-takeuchi
requested changes
Jan 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost all changes looks file. Just one minor nit.
internal/lvmd/lvservice_test.go
Outdated
return lvService, &count, vg, pool | ||
} | ||
|
||
func TestLVService_TickLV(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
func TestLVService_TickLV(t *testing.T) { | |
func TestLVService_ThickLV(t *testing.T) { |
To improve readability and conform to the gocyclo lint, split these tests. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
As it tests the Watch method and LV operations using a subtest, it should be dedicated tests. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is because it has been a TODO for a long time. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is not related to VGService, but to VolumeGroup. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
It is not related to VGService. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
This reduces cyclomatic complexity and improves readability. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Using subtest is more readable than comments. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
There are two tests for thick and thin and they are almost same. To improve readability, use table test to dedup them. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
This attemps to improve readability and reduce cyclomatic complexity. Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Signed-off-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
05ba7cb
to
1ed7b32
Compare
peng225
approved these changes
Jan 23, 2025
satoru-takeuchi
approved these changes
Jan 23, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
issue: #853