Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

chore: convert tests to async/await #2495

Merged
merged 4 commits into from
Oct 2, 2019
Merged

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Sep 26, 2019

Builds on the work in #2390

  • cli
  • core @hugomrdias is doing these
  • gateway These were already async await
  • http - most of these were deleted as they are duplicates of tests in interface-js-ipfs-core - if not duplicates they were moved to the interface tests

@achingbrain
Copy link
Member Author

I think most of the core tests should be moved to either ipfs/interface-js-ipfs-core (for the ones that assert things about function inputs and outputs) or ipfs/interop (for ones that assert things about network operations).

That'd leave us with just cli, gateway and http tests in this repo, and the http tests should all be converted to inject style tests as they are much faster to run.

What do you think @hugomrdias @alanshaw @jacobheun @vasco-santos

@achingbrain achingbrain changed the title chore: converted cli tests to async chore: converted tests to async/await Sep 26, 2019
@achingbrain achingbrain changed the title chore: converted tests to async/await chore: convert tests to async/await Sep 26, 2019
@hugomrdias
Copy link
Member

I think most of the core tests should be moved to either ipfs/interface-js-ipfs-core (for the ones that assert things about function inputs and outputs) or ipfs/interop (for ones that assert things about network operations).

That'd leave us with just cli, gateway and http tests in this repo, and the http tests should all be converted to inject style tests as they are much faster to run.

What do you think @hugomrdias @alanshaw @jacobheun @vasco-santos

yes im working on that and moving interface-core to async also

@achingbrain
Copy link
Member Author

yes im working on that and moving interface-core to async also

Well I'll just sit right back then...

...and convert the gateway & http tests to async/await. Will leave the core ones alone.

@achingbrain
Copy link
Member Author

@hugomrdias please de-dupe with extreme prejudice!

@jacobheun
Copy link
Contributor

Ideally the cli tests should only need to verify that the interface is called correctly and that interface outputs are printed properly. We shouldn't need to run ipfs at all for the cli tests and it would make them take seconds instead of minutes.

@hugomrdias
Copy link
Member

Ideally the cli tests should only need to verify that the interface is called correctly and that interface outputs are printed properly. We shouldn't need to run ipfs at all for the cli tests and it would make them take seconds instead of minutes.

yes i already changed a couple of sub systems to work like that, and doing the rest is on my todo list

@achingbrain achingbrain changed the base branch from async-await-repo to master September 26, 2019 18:42
achingbrain added a commit to ipfs-inactive/interface-js-ipfs-core that referenced this pull request Sep 26, 2019
Our http tests in `js-IPFS` duplicate a whole bunch of tests from this
suite, but they also test some unhappy paths that this suite does not.

I've pulled them out of `js-IPFS` as part of ipfs/js-ipfs#2495 and am
adding them to the interface tests here.
@achingbrain
Copy link
Member Author

I've pulled out all the http tests that start a daemon in the background. Most were duplicates of tests in the interface-js-ipfs-core suite but a few tested unhappy paths not otherwise covered.

I've added them to the interface tests here: ipfs-inactive/interface-js-ipfs-core#534

achingbrain added a commit to ipfs-inactive/interface-js-ipfs-core that referenced this pull request Sep 27, 2019
Our http tests in `js-IPFS` duplicate a whole bunch of tests from this
suite, but they also test some unhappy paths that this suite does not.

I've pulled them out of `js-IPFS` as part of ipfs/js-ipfs#2495 and am
adding them to the interface tests here.
achingbrain added a commit to ipfs-inactive/interface-js-ipfs-core that referenced this pull request Sep 30, 2019
Our http tests in `js-IPFS` duplicate a whole bunch of tests from this
suite, but they also test some unhappy paths that this suite does not.

I've pulled them out of `js-IPFS` as part of ipfs/js-ipfs#2495 and am
adding them to the interface tests here.
achingbrain added a commit to ipfs-inactive/interface-js-ipfs-core that referenced this pull request Sep 30, 2019
Our http tests in `js-IPFS` duplicate a whole bunch of tests from this
suite, but they also test some unhappy paths that this suite does not.

I've pulled them out of `js-IPFS` as part of ipfs/js-ipfs#2495 and am
adding them to the interface tests here.
@achingbrain achingbrain marked this pull request as ready for review September 30, 2019 12:35
@achingbrain achingbrain merged commit 60064b6 into master Oct 2, 2019
@achingbrain achingbrain deleted the convert-tests-to-async branch October 2, 2019 09:05
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