-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add test case for internal/errors/ngt.go #936
Conversation
[CHATOPS:HELP] ChatOps commands.
|
Codecov Report
@@ Coverage Diff @@
## master #936 +/- ##
==========================================
+ Coverage 15.18% 15.34% +0.16%
==========================================
Files 493 493
Lines 25683 25683
==========================================
+ Hits 3900 3942 +42
+ Misses 21533 21491 -42
Partials 250 250
Continue to review full report at Codecov.
|
} | ||
|
||
func TestErrInvalidDimensionSize(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.
🚫 [golangci] reported by reviewdog 🐶
File is not gofumpt
-ed (gofumpt)
ErrDimensionLimitExceed = func(current, limit int) error { | ||
return Errorf("supported dimension limit exceed:\trequired = %d,\tlimit = %d", current, limit) | ||
} | ||
|
||
// ErrIncompatibleDimensionSize represents a function to generate an error that the incompatible dimension size detected. |
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.
🚫 [golangci] reported by reviewdog 🐶
line is 122 characters (lll)
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.
please check these suggestion
ErrObjectNotFound = func(err error, uuid string) error { | ||
return Wrapf(err, "ngt uuid %s's object not found", uuid) | ||
} | ||
|
||
// ErrRemoveRequestedBeforeIndexing represents a function to generate an error that the object is not indexed so can not remove it. |
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.
🚫 [golangci] reported by reviewdog 🐶
line is 132 characters (lll)
limit: int(math.MinInt64), | ||
}, | ||
want: want{ | ||
want: Errorf("dimension size %d is invalid, the supporting dimension size must be between 2 ~ %d", int(math.MinInt64), int(math.MinInt64)), |
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.
🚫 [golangci] reported by reviewdog 🐶
line is 143 characters (lll)
limit: int(math.MaxInt64), | ||
}, | ||
want: want{ | ||
want: Errorf("dimension size %d is invalid, the supporting dimension size must be between 2 ~ %d", int(math.MaxInt64), int(math.MaxInt64)), |
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.
🚫 [golangci] reported by reviewdog 🐶
line is 143 characters (lll)
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.
LGTM
/format |
[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-newtest-for-errors-ngt |
6e53298
to
db2366f
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
/rebase |
[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-newtest-for-errors-ngt |
7dd4e37
to
b332e24
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
/rebase |
limit: int(math.MinInt64), | ||
}, | ||
want: want{ | ||
want: Errorf("supported dimension limit exceed:\trequired = %d,\tlimit = %d", int(math.MinInt64), int(math.MinInt64)), |
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.
🚫 [golangci] reported by reviewdog 🐶
line is 122 characters (lll)
[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-newtest-for-errors-ngt |
b332e24
to
570383b
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
/rebase |
[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-newtest-for-errors-ngt |
8a58944
to
76d596b
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
/rebase |
[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-newtest-for-errors-ngt |
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Co-authored-by: Kiichiro YUKAWA <[email protected]>
Signed-off-by: vdaas-ci <[email protected]>
76d596b
to
4c15234
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
Signed-off-by: hlts2 [email protected]
Description:
I added the test cases for internal/errors/ngt.go and comments and refactored implementation code.
refactor
WHY
The output of following code is
ngt object uuid not found%!(EXTRA uint32=0)
.https://github.com/vdaas/vald/blob/master/internal/errors/ngt.go#L85
WHAT
I changed from
Errorf
toNew
And I searched for code that uses this implementation.
According to the results of the investigation, this fix had no effect.
https://github.com/vdaas/vald/search?q=ErrUUIDNotFound
The following is a handler that uses
insert
anddelete
in the above result, but it is not affected by the wording correction.handler of
Insert
vald/pkg/agent/core/ngt/handler/grpc/handler.go
Line 282 in 5c914a2
handler of
Delete
vald/pkg/agent/core/ngt/handler/grpc/handler.go
Line 526 in 5c914a2
grammar check passed
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: