-
Notifications
You must be signed in to change notification settings - Fork 124
test: add tests and docs for ipfs.resolve #332
Conversation
}) | ||
|
||
// Test resolve turns /ipns/domain.com into /ipfs/QmHash | ||
it('should resolve an IPNS DNS link', function (done) { |
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.
This case is a bit worrisome. First we have the reliance on a remote service, secondly we're not actually checking if the output is correct.
My first thought is that in general for the ipns tests, we should have a mini-dns service running together with the tests, that the local daemon can resolve IPNS to. So instead of testing /ipns/ipfs.io
we should test /ipns/local-dns-service.home
which would be resolved only locally and we can then assert correct output.
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 would like that too. I have no idea how to do that or if it's even possible but I'll look into it. Do you have any pointers?
@victorbjelkholm I've added skips to the DNS related tests until we can find a good way to not depend on external DNS records. I had an idea that for these tests the TXT record to lookup would be at the domain I tried using https://www.npmjs.com/package/mdns-server for this but it wasn't able to bind to the MDNS ports. I'm guessing IPFS is already bound to them 😕? Maybe we can setup Jenkins to run a DNS server with some known records? |
License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
Let's run them for now, if they become a problem we can skip them. Not relying on external DNS is a nice-to-have-feature and not required. We also already have bunch of other tests that are having a dependency on external DNS.
I rather not, as the tests would run different locally. Would be nicer to have some in-process dns server we can startup/shutdown together with the tests. Then we can also easier test what happens when records are changed etc etc. Created a issue to track it here: https://github.com/ipfs/testing/issues/58 |
License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
"should resolve IPNS link recursively" takes > 1min on my laptop. I'm open to suggestions on how to speed this up...
refs ipfs-inactive/js-ipfs-http-client#794 and ipfs/js-ipfs#1455