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

set identity on core mock to fix ipns tests #1524

Merged
merged 2 commits into from
Jul 29, 2015
Merged

set identity on core mock to fix ipns tests #1524

merged 2 commits into from
Jul 29, 2015

Conversation

whyrusleeping
Copy link
Member

The fuse tests were failing because the mock node didnt have the identity set.

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

@whyrusleeping
Copy link
Member Author

@jbenet could you run the ipns tests on your laptop?

@jbenet
Copy link
Member

jbenet commented Jul 28, 2015

@whyrusleeping we should setup FUSE on CI, i believe people found a way to get it on travis ci -- travis-ci/travis-ci#1100 ?

@@ -54,6 +54,7 @@ func NewMockNode() (*core.IpfsNode, error) {
nd.Peerstore = peer.NewPeerstore()
nd.Peerstore.AddPrivKey(p, ident.PrivateKey())
nd.Peerstore.AddPubKey(p, ident.PublicKey())
nd.Identity = p
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm ic, L40 doesn't make it?

Copy link
Member

Choose a reason for hiding this comment

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

@rht you're right, that's a bug. core.Offline(...) should initialize from the config.Identity -- though maybe the problem is a lack of a private key? not sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

well, no. we should be using the nodebuilder here. core.Offline doesnt load identity because it doesnt load the private key, thats an expensive operation that we dont want to happen every time you run a command offline

Copy link
Contributor

Choose a reason for hiding this comment

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

So this means any tests using coremock.NewMockNode() loads private key, while the tests that use core.NewIPFSNode (e.g. https://github.com/ipfs/go-ipfs/blob/master/core/coreunix/add_test.go#L28) don't.

whyrusleeping and others added 2 commits July 28, 2015 23:35
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
@jbenet
Copy link
Member

jbenet commented Jul 29, 2015

@whyrusleeping

  • ipns passed.
  • readonly failed. i fixed them in 5513aab

@jbenet
Copy link
Member

jbenet commented Jul 29, 2015

=== RUN TestIpnsLocalLink
Publishing!
--- PASS: TestIpnsLocalLink (0.26s)
=== RUN TestIpnsBasicIO
Publishing!
--- PASS: TestIpnsBasicIO (0.08s)
=== RUN TestFilePersistence
Publishing!
Publishing!
--- PASS: TestFilePersistence (0.14s)
    ipns_test.go:182: Closed, opening new fs
=== RUN TestMultipleDirs
Publishing!
Publishing!
--- PASS: TestMultipleDirs (0.13s)
    ipns_test.go:199: make a top level dir
    ipns_test.go:205: write a file in it
    ipns_test.go:210: sub directory
    ipns_test.go:215: file in that subdirectory
    ipns_test.go:221: closing mount, then restarting
=== RUN TestFileSizeReporting
Publishing!
Publishing!
--- PASS: TestFileSizeReporting (0.10s)
=== RUN TestDoubleEntryFailure
Publishing!
Publishing!
--- PASS: TestDoubleEntryFailure (0.09s)
=== RUN TestAppendFile
Publishing!
Publishing!
--- PASS: TestAppendFile (0.09s)
=== RUN TestConcurrentWrites
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
--- PASS: TestConcurrentWrites (148.20s)
=== RUN TestFSThrash
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
Publishing!
--- PASS: TestFSThrash (15.73s)
=== RUN TestMultiWrite
Publishing!
Publishing!
--- PASS: TestMultiWrite (0.72s)
PASS
ok      github.com/ipfs/go-ipfs/fuse/ipns   165.736s
?       github.com/ipfs/go-ipfs/fuse/mount  [no test files]
=== RUN TestIpfsBasicRead
--- PASS: TestIpfsBasicRead (0.08s)
=== RUN TestIpfsStressRead
--- PASS: TestIpfsStressRead (11.18s)
=== RUN TestIpfsBasicDirRead
--- PASS: TestIpfsBasicDirRead (0.14s)
=== RUN TestFileSizeReporting
--- PASS: TestFileSizeReporting (0.13s)
PASS
ok      github.com/ipfs/go-ipfs/fuse/readonly   11.679s

jbenet added a commit that referenced this pull request Jul 29, 2015
set identity on core mock to fix ipns tests
@jbenet jbenet merged commit 4ff5923 into master Jul 29, 2015
@jbenet jbenet removed the status/in-progress In progress label Jul 29, 2015
@jbenet jbenet added this to the IPFS 0.3.6 milestone Jul 29, 2015
@rht rht deleted the fix/coremock branch July 29, 2015 07:20
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.

None yet

3 participants