@helia/verified-fetch-gateway-conformance
v2.0.1
Published
Gateway conformance tests for @helia/verified-fetch
Keywords
Readme
@helia/verified-fetch-gateway-conformance
Gateway conformance tests for @helia/verified-fetch
About
Runs Gateway Conformance tests against @helia/verified-fetch using Kubo as a backing trustless-gateway.
Example - Testing a new @helia/verified-fetch release
$ npm i @helia/verified-fetch-gateway-conformance
$ VERIFIED_FETCH=@helia/[email protected] verified-fetch-gateway-conformanceExample - Testing with a different Kubo version
$ npm i @helia/verified-fetch-gateway-conformance
$ KUBO_BINARY=/path/to/kubo verified-fetch-gateway-conformanceExample - using a different gateway-conformance image
$ GWC_IMAGE=ghcr.io/ipfs/gateway-conformance:v0.5.1 verified-fetch-gateway-conformanceExample - Debugging a test run
$ DEBUG="-mocha*,*,*:trace" npm run test # very verbose output
$ DEBUG="conformance-tests*,conformance-tests*:trace" npm run test # only gateway-conformance test outputExample - Querying the gateway-conformance server directly
$ npm run build
$ node dist/src/demo-server.js # in terminal 1
$ curl -v GET http://localhost:3442/ipfs/bafkqabtimvwgy3yk/ # in terminal 2Example - Generating conformance results standalone
You can generate conformance results independently of the test suite for analysis or reuse:
# Generate results and keep binary for reuse
$ npm run gen:gwc-report
# Generate results with custom name and cleanup binary
$ npm run gen:gwc-report -- my-test --cleanup
# Use the results in your own code
$ node -e "
import { generateConformanceResults } from './dist/src/generate-conformance-report.js'
import { getReportDetails } from './dist/src/get-report-details.js'
const result = await generateConformanceResults('custom', { cleanupBinary: true })
console.log('Report saved to:', result.reportPath)
const details = await getReportDetails(result.reportPath)
console.log('Success rate:', details.successRate)
"Troubleshooting
Missing file in gateway-conformance-fixtures folder
If you see the following error:
ENOENT: no such file or directory, open '[...]/helia-verified-fetch/packages/gateway-conformance/dist/src/...
This likely means the docker container is not executing properly for some
reason. You can try running the following command to see if there are any
errors: DEBUG="-mocha*,*,*:trace" npm run test
Install
$ npm i @helia/verified-fetch-gateway-conformanceLicense
Licensed under either of
- Apache 2.0, (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)
- MIT (LICENSE-MIT / http://opensource.org/licenses/MIT)
Contribute
Contributions welcome! Please check out the issues.
Also see our contributing document for more information on how we work, and about contributing in general.
Please be aware that all interactions related to this repo are subject to the IPFS Code of Conduct.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

