Skip to content
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

fix(store): Fix the TestFileStreamingService unit test. #14305

Merged
merged 8 commits into from
Dec 14, 2022
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf
* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in golang 1.19.
* (server) [#13778](https://github.com/cosmos/cosmos-sdk/pull/13778) Set Cosmos SDK default endpoints to localhost to avoid unknown exposure of endpoints.
* (x/auth) [#13877](https://github.com/cosmos/cosmos-sdk/pull/13877) Handle missing account numbers during `InitGenesis`.
* (store) [#14305](https://github.com/cosmos/cosmos-sdk/pull/14305) Fix `TestFileStreamingService` unit test.
SpicyLemon marked this conversation as resolved.
Show resolved Hide resolved

### Deprecated

Expand Down
3 changes: 2 additions & 1 deletion store/streaming/file/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ func TestFileStreamingService(t *testing.T) {
defer os.RemoveAll(testDir)

testKeys := []types.StoreKey{mockStoreKey1, mockStoreKey2}
testStreamingService, err := NewStreamingService(testDir, testPrefix, testKeys, testMarshaller, log.NewNopLogger(), true, false, false)
var err error
testStreamingService, err = NewStreamingService(testDir, testPrefix, testKeys, testMarshaller, log.NewNopLogger(), true, false, false)
require.Nil(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
require.Nil(t, err)
require.NoError(t, err)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it should be NoError, but there are a whole lot of other things about this test that should also be fixed, and I didn't want to get lost in all of it. E.g. require.Nil is used against errors in many places.

require.IsType(t, &StreamingService{}, testStreamingService)
require.Equal(t, testPrefix, testStreamingService.filePrefix)
Expand Down