-
Notifications
You must be signed in to change notification settings - Fork 324
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
test: add unit test for module blockdao #4182
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4182 +/- ##
==========================================
+ Coverage 75.38% 76.55% +1.17%
==========================================
Files 303 340 +37
Lines 25923 29165 +3242
==========================================
+ Hits 19541 22327 +2786
- Misses 5360 5734 +374
- Partials 1022 1104 +82 ☔ View full report in Codecov by Sentry. |
blockchain/blockdao/blockdao_test.go
Outdated
// p := gomonkey.NewPatches() | ||
// defer p.Reset() | ||
|
||
// p.ApplyMethodReturn(&BlockIndexerChecker{}, "CheckIndexer", nil) |
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.
remove
blockchain/blockdao/blockdao_test.go
Outdated
p.ApplyPrivateMethod(&blockDAO{}, "checkIndexers", func(*blockDAO, context.Context) error { return nil }) | ||
|
||
err := blockdao.Start(context.Background()) | ||
r.Nil(err) |
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.
let's use r.NoError()
for consistency
blockchain/blockdao/blockdao_test.go
Outdated
mockblockdao.EXPECT().GetBlockByHeight(gomock.Any()).Return(&block.Block{}, nil).Times(1) | ||
|
||
err := blockdao.checkIndexers(ctx) | ||
r.Nil(err) |
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.
let's use r.NoError()
for consistency
Quality Gate passedIssues Measures |
Description
add unit test for module blockchain/blockdao
Fixes #4121
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: