-
Notifications
You must be signed in to change notification settings - Fork 77
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 for internal/errors/runtime #984
Conversation
/format |
[CHATOPS:HELP] ChatOps commands.
|
[FORMAT] Updating license headers and formatting go codes triggered by vankichi. |
} | ||
}(), | ||
func() test { | ||
tString := "10h" |
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 🐶
string 10h
has 3 occurrences, make it a constant (goconst)
} | ||
}(), | ||
} | ||
for _, tc := range tests { |
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 🐶
only one cuddle assignment allowed before range statement (wsl)
} | ||
}(), | ||
} | ||
for _, tc := range tests { |
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 🐶
only one cuddle assignment allowed before range statement (wsl)
Codecov Report
@@ Coverage Diff @@
## master #984 +/- ##
==========================================
+ Coverage 14.43% 14.45% +0.02%
==========================================
Files 492 492
Lines 27906 27906
==========================================
+ Hits 4028 4035 +7
+ Misses 23640 23633 -7
Partials 238 238
Continue to review full report at Codecov.
|
rec: r, | ||
}, | ||
want: want{ | ||
want: Wrap(defaultErr, Errorf("panic recovered: %v", r).Error()), |
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.
Should we use New function insted of Wrap function. 🤔
because this want is equal to the test target function like this. 🤔
vald/internal/errors/runtime.go
Line 25 in 1b6993b
return Wrap(err, Errorf("panic recovered: %v", rec).Error()) |
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.
if we'd like to test the Wrap
function, I agree with you.
IMO, about this case, it is not needed.
How do you think?
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.
I got it 👍 I agree with you!
internal/errors/runtime_test.go
Outdated
} | ||
defaultErr := New("runtime panic string error") | ||
defaultRuntimeErr := &runtimeErr{ | ||
err: New("runtime error is occured"), |
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 🐶occured
is a misspelling of occurred
(misspell)
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
/rebase |
[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-newtest-for-errors-runtime |
e06e383
to
49bbfaa
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
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.
[APPROVED] This PR is approved by kevindiu.
/rebase |
[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-newtest-for-errors-runtime |
Signed-off-by: vankichi <[email protected]>
Signed-off-by: vdaas-ci <[email protected]>
Co-authored-by: Hiroto Funakoshi <[email protected]>
Co-authored-by: Hiroto Funakoshi <[email protected]>
Co-authored-by: Hiroto Funakoshi <[email protected]>
Signed-off-by: vankichi <[email protected]>
Co-authored-by: Kevin Diu <[email protected]>
49bbfaa
to
5927318
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
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.
[APPROVED] This PR is approved by kevindiu.
Signed-off-by: vankichi [email protected]
Description:
I added the test for
internal/errors/runtime.go
and add comment for each function.Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: