-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HTTP integegration tests #227
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## feat/http #227 +/- ##
=============================================
+ Coverage 70.66% 71.29% +0.62%
=============================================
Files 64 67 +3
Lines 5543 6072 +529
=============================================
+ Hits 3917 4329 +412
- Misses 1413 1500 +87
- Partials 213 243 +30
|
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.
After fixing @rvagg 's notes about UnixFS setup (sorry, IPLD is weird), we should test pathing over HTTP too
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.
After fixing @rvagg 's notes about UnixFS setup (sorry, IPLD is weird), we should test pathing over HTTP too
but pathed tests can be in a seperate PR, lower priority. |
@@ -259,3 +335,107 @@ func StartAndWaitForReady(ctx context.Context, manager datatransfer.Manager) err | |||
return err | |||
} | |||
} | |||
|
|||
func MockIpfsHandler(ctx context.Context, lsys linking.LinkSystem) func(http.ResponseWriter, *http.Request) { |
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.
seems like this can be moved in to peerhttpserver.go now?
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.
lgtm, I would like to see path tests in there though, they look like they're supported on the server side so it should just mean copying the graphsync ones
5331ef7
to
68fd2be
Compare
* First pass at adapting graphsync to http * fix(http): gracefully handle selector vs path requests * feat(http): extend graphsyncretriever so it can also do http * feat(http): refactor http & graphsync specific pieces to "TransportProtocol" iface * feat(prioritywaitqueue): add InitialPauseDone inspector * feat(http): single peer http retrieval unit test * fix(http): enable http everywhere gs & bs are * chore(http): framework for suite of http unit tests based on bitswap unit test framework * feat(http): remove parallel-request flow, make all serial for now * too-detailed http testing, will remove this in favour of graphsync style testing. * fix(http): better testing framework * fix(http): more test coverage, minor fixes * fix(http): clean up time handling in tests * HTTP CAR validation (#222) * feat(verifiedcar): initial verifiedcar package * feat(verifiedcar): verify http retrievals * chore(verifiedcar): tests for basic error cases * fix(verifiedcar): coverage of more cases, handle known edges properly * fix(verifiedcar): remove extraneous go-routine (#226) Co-authored-by: Rod Vagg <[email protected]> * fix(verifiedcar): address feedback * fix(verifiedcar): fix flaky tests --------- Co-authored-by: Hannah Howard <[email protected]> * fix(http): refactor MockRoundTripper (#229) * Add HTTP integegration tests (#227) * test: add itests for http * test: add peer http server, minor refactors and fixes * fix(itest): fix compile errors on rebase --------- Co-authored-by: Rod Vagg <[email protected]> Co-authored-by: Hannah Howard <[email protected]> Co-authored-by: Kyle Huntsman <[email protected]>
Adds HTTP integration tests that test that Lassie can fetch a valid car over the HTTP protocol. Remote HTTP peers are generated with an http multiaddress and run an HTTP server on that address for serving valid cars.
Notable Changes
itest/testpeer/generator.go
can now generate HTTP peers with an HTTP server that returns valid carsitest/testpeer/mocknet.go
has been updated to add HTTP peersitest/testpeer/peerhttpserver.go
to create separate http server instances for each peer, as well as manage start and teardown appropriately.