protocol / beyond-bitswap

Other
34 stars 9 forks source link

Refactor 1: Remove near duplicate tests, use common setup code #22

Closed hannahhoward closed 3 years ago

hannahhoward commented 3 years ago

Goals

Address issue #17 and remove duplicate code. This is part one, which takes a major step toward removing duplicate code

Implementation

This PR does two main things:

  1. It uses the InitializeTest function currently only used in the "graphsync-transfer" testcase in the IPFS transfer test case as well.
  2. It removes the "sparse" and "waves" testcases, which were near identical to the IPFS testcase and prone to getting out of date.

To remove "waves", we simply copy the waves fetching function into the "ipfs-transfer" case, with the insight that num_waves=1 essentially reduces this code to the existing fetch function in "ipfs-transfer"

To remove "sparse", we add a dialer param that configures how nodes dial each other -- the default dials all nodes, while the sparse dialer dials in the pattern used in the sparse test.

I also updated the RFCs as needed.

adlrocha commented 3 years ago

Nice refactor, @hannahhoward. Thanks! Merging.