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

fix: tests of addFromURL in browsers #514

Merged
merged 4 commits into from
Sep 5, 2019
Merged

Conversation

lidel
Copy link
Contributor

@lidel lidel commented Aug 27, 2019

Required by ipfs/js-ipfs#2304

Old version of addFromURL tests was Node-centric and did not work in web browser contexts.

This PR:

@lidel lidel requested review from alanshaw and hugomrdias August 27, 2019 23:00
lidel added a commit to lidel/js-ipfs that referenced this pull request Aug 27, 2019
Context: ipfs-inactive/interface-js-ipfs-core#514

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
lidel added a commit to lidel/js-ipfs that referenced this pull request Aug 28, 2019
Context: ipfs-inactive/interface-js-ipfs-core#514

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@alanshaw
Copy link
Contributor

@lidel it took me a while to figure out that there's a noop server in the browser. What do you think about requiring the echo server to be started in all environments? 1) It would simplify the setup and teardown code in the tests here, 2) we wouldn't need a noop server (potentially helping with any misunderstandings) and 3) it would only need a couple of changes to .aegir.js (which you're already editing in that PR) to also start it for Node.js.

@lidel
Copy link
Contributor Author

lidel commented Aug 29, 2019

@alanshaw if we are going to simplify this, I'd like to also remove HTTPS echo server and have only HTTP instance, as suggested in ipfs/js-ipfs#2304 (comment). I fail to see what is the value of testing HTTPS.

Y/n?

@alanshaw
Copy link
Contributor

@lidel go for it!

lidel added a commit that referenced this pull request Aug 30, 2019
This simplifies the way we use HTTP Echo Server by moving it to aegir
hooks and removing HTTPS version.

Context:
#514 (comment)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
lidel added a commit to lidel/js-ipfs that referenced this pull request Aug 30, 2019
This simplifies code in interface-js-ipfs-core as both Node an Browser
init it the same way

Context:
ipfs-inactive/interface-js-ipfs-core#514 (comment)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel
Copy link
Contributor Author

lidel commented Aug 30, 2019

@alanshaw check a810adf and ipfs/js-ipfs@32e76cc

lidel added a commit to lidel/js-ipfs that referenced this pull request Sep 4, 2019
Context: ipfs-inactive/interface-js-ipfs-core#514

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
lidel added a commit to lidel/js-ipfs that referenced this pull request Sep 4, 2019
This simplifies code in interface-js-ipfs-core as both Node an Browser
init it the same way

Context:
ipfs-inactive/interface-js-ipfs-core#514 (comment)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
Old version was Node-centric and did not work in web browser contexts.
This change:

- moves the HTTP server to separate file to enable spawning it from
  aegir hook (see .aegir.js/hooks/browser/pre|post in js-ipfs)
- removes  overhead of starting and stopping HTTP servers multiple times
- simplifies test code

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
This simplifies the way we use HTTP Echo Server by moving it to aegir
hooks and removing HTTPS version.

Context:
#514 (comment)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel lidel force-pushed the fix/addFromURL-in-browser branch from a810adf to fd2892b Compare September 4, 2019 11:31
@lidel
Copy link
Contributor Author

lidel commented Sep 4, 2019

Rebased, no conflicts.

@alanshaw alanshaw merged commit 524a110 into master Sep 5, 2019
@alanshaw alanshaw deleted the fix/addFromURL-in-browser branch September 5, 2019 10:40
lidel added a commit to lidel/js-ipfs that referenced this pull request Sep 5, 2019
Context: ipfs-inactive/interface-js-ipfs-core#514

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
lidel added a commit to lidel/js-ipfs that referenced this pull request Sep 5, 2019
This simplifies code in interface-js-ipfs-core as both Node an Browser
init it the same way

Context:
ipfs-inactive/interface-js-ipfs-core#514 (comment)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants