-
Notifications
You must be signed in to change notification settings - Fork 95
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
test(gateway): migrate Go tests from Kubo #156
Conversation
Codecov Report
@@ Coverage Diff @@
## main #156 +/- ##
==========================================
+ Coverage 19.62% 25.98% +6.36%
==========================================
Files 100 100
Lines 11053 11053
==========================================
+ Hits 2169 2872 +703
+ Misses 8597 7839 -758
- Partials 287 342 +55
|
989a077
to
c48010d
Compare
c48010d
to
0d5f0a9
Compare
0d5f0a9
to
222bbd9
Compare
222bbd9
to
888fe00
Compare
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.
Thank you for cleaning this up ❤️
return &mockApi{ | ||
ns: mockNamesys{}, | ||
func newMockAPI(t *testing.T) (*mockAPI, cid.Cid) { | ||
r, err := os.Open("./testdata/fixtures.car") |
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.
@hacdias fysa I've moved fixtures to testdata/
subdir, it seems to be a good convention to follow in future:
The go tool will ignore a directory named "testdata", making it available to hold ancillary data needed by the tests.
–go help test
Part of #146. Migrates remaining gateway Go tests from Kubo (see removal in Kubo: ipfs/kubo#9627). Since we don't have a UnixFS API here, I created a
fixtures.car
file. This file has a single root. Under that root, there is a directory for each test (that requires data) with the name of the test.