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

Go test fix #6293

Merged
merged 2 commits into from
May 3, 2019
Merged

Go test fix #6293

merged 2 commits into from
May 3, 2019

Conversation

cbuesser
Copy link
Contributor

@cbuesser cbuesser commented May 2, 2019

Problem

go test ./... was panicking.

Issue

  1. core.NewNode was called with a nil pointer to a core.BuildCfg object -- Fixed in: 9380660
  2. Error() was called on nil error object -- Fixed in: 5ce2deb

Result

go test ./... passes all tests.

This commit fixes the errors resulting from passing a nil pointer to the
core.NewNode function in TestExternalUnmmount and setupIpnsTest.

In the previous nil's place a &core.BuildCfg{} is now passed.

Both changes follow the same pattern:

```diff
-  node, err = core.NewNode(context.Background(), nil)
+  node, err = core.NewNode(context.Background(), &core.BuildCfg{})
```

 On branch go-test-fix
 Changes to be committed:
	modified:   fuse/ipns/ipns_test.go
	modified:   fuse/node/mount_test.go
License: MIT
Signed-off-by: Chris Buesser <christopher.buesser@gmail.com>
In TestExternalUnmount, the Mount function is called which returns an
error which can be nil. The error type is then used in a comparison
where Error() is called on it. If the error is nil, this results in a
panic.

Added a if err != nil {} guard to make sure that Error() is not called
if the value is nil
 On branch go-test-fix
 Changes to be committed:
	modified:   fuse/node/mount_test.go
License: MIT
Signed-off-by: Chris Buesser <christopher.buesser@gmail.com>
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Thanks!

(and we still haven't fixed fuse in CI: #2023)

@Stebalien Stebalien merged commit 7e9eb72 into ipfs:master May 3, 2019
@cbuesser cbuesser deleted the go-test-fix branch May 3, 2019 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants