-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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: 81% coverage on blockstore #3074
Conversation
Docker tests failed but it isn't connected. |
44ef280
to
c40926c
Compare
Coverage report available at: https://ipfs.io/ipfs/QmTuMtwGCfHrbYyZdQ1RaGNwS2MGsmAkjA8AaB69N7Ya1g/coverage.html#file0 Part of #3053 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@ipfs.io>
c40926c
to
233a622
Compare
@@ -57,16 +57,21 @@ func TestRuntimeHashing(t *testing.T) { | |||
bs := NewBlockstore(ds_sync.MutexWrap(ds.NewMapDatastore())) | |||
bl := blocks.NewBlock([]byte("some data")) | |||
blBad, err := blocks.NewBlockWithHash([]byte("some other data"), bl.Key().ToMultihash()) | |||
bl2 := blocks.NewBlock([]byte("some other data")) |
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.
why is this here before the error check from the previous statement?
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.
because it should always success and it is checked in other tests, will add check either way.
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.
still, you want to check errors right as they are created, otherwise it just looks sloppy.
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Updated. |
opts.HasARCCacheSize = -1 | ||
|
||
if _, err := CachedBlockstore(nil, nil, opts); err == nil { | ||
t.Error("wrong ARC setting was not 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.
Any reason for Error
over Fatal
?
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.
Those test cases are not dependent on each other, so using Error
all test cases will checked and printed.
Error = Print + Fail
Fatal = Print + FailNow
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 guess thats fair.
just a typo then LGTM |
Also format imports License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Done. |
Coverage report available at: https://ipfs.io/ipfs/QmTuMtwGCfHrbYyZdQ1RaGNwS2MGsmAkjA8AaB69N7Ya1g/coverage.html#file0
Part of #3053
License: MIT
Signed-off-by: Jakub Sztandera kubuxu@protonmail.ch