-
Notifications
You must be signed in to change notification settings - Fork 204
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
unit tests for state/syncer #5239
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## feat/trie-sync-optimizations #5239 +/- ##
===============================================================
Coverage ? 79.08%
===============================================================
Files ? 683
Lines ? 88367
Branches ? 0
===============================================================
Hits ? 69887
Misses ? 13273
Partials ? 5207 ☔ View full report in Codecov by Sentry. |
return tr | ||
} | ||
|
||
func TestUserAccountsSyncer_SyncerAccountDataTries(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.
func TestUserAccountsSyncer_SyncerAccountDataTries(t *testing.T) { | |
func TestUserAccountsSyncer_SyncAccountDataTries(t *testing.T) { |
require.Equal(t, expectedErr, err) | ||
}) | ||
|
||
t.Run("should work", func(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.
few notes here in order to increase the coverage:
- missing
IsInterfaceNil
test - coverage can be increased with a test similar with
should work
, but throttler.CanProcess returns false andSyncAccountDataTries
gets as param a closed context(this would lead to time is out error) - a new test with
ReadFromChanNonBlocking
returning error - perhaps a test with largeTries, to cover more of printDataTrieStatistics(not sure if doable)
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.
added more tests, might add for more scenarios in a later task
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestNewValidatorAccountsSyncer(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.
missing IsInterfaceNil test
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.
added
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.
Nothing from me, just the tests that Sorin suggested.
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?