Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Remove reliance on external services for util.addFromURL tests #803

Closed
alanshaw opened this issue Jul 4, 2018 · 0 comments · Fixed by #834
Closed

Remove reliance on external services for util.addFromURL tests #803

alanshaw opened this issue Jul 4, 2018 · 0 comments · Fixed by #834

Comments

@alanshaw
Copy link
Contributor

alanshaw commented Jul 4, 2018

The addFromURL tests call out to URLs on the internet to add content to IPFS. This makes our tests dependent on the availability and response time of these services. Instead we should spin up a mock node server to respond to these requests for each test.

https://github.com/ipfs/js-ipfs-api/blob/a8f9a43064930c816b0e73dbc1674a313cf1baca/test/util.spec.js#L115-L197

alanshaw added a commit that referenced this issue Aug 14, 2018
Relying on external URLs makes our tests dependent on the availability and response time of these services as well as not being able to run without an internet connection. This PR removes those requests to external URLs and instead spins up test HTTP(s) servers as they are needed to serve the content that `ipfs.util.addFromURL` consumes.

resolves #803

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
@ghost ghost assigned alanshaw Aug 14, 2018
@ghost ghost added in progress and removed ready labels Aug 14, 2018
alanshaw added a commit that referenced this issue Aug 15, 2018
Relying on external URLs makes our tests dependent on the availability and response time of these services as well as not being able to run without an internet connection. This PR removes those requests to external URLs and instead spins up test HTTP(s) servers as they are needed to serve the content that `ipfs.util.addFromURL` consumes.

This PR also strengthens some of the tests to make assertions that the result received by `ipfs.util.addFromURL` is the same as the result of adding the data directly using `ipfs.add`.

resolves #803

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
@ghost ghost removed the in progress label Aug 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant