Skip to content

Commit

Permalink
test: add gateway conformance tests (#314)
Browse files Browse the repository at this point in the history
Skips practically all of them to just get the framework in place.

I'm not sure all the tests are valid, the spec is missing large
chunks of functionality asserted in the tests, but the assertions
don't necessarily assert IETF/W3c spec compliant behaviour, for
example: ipfs/gateway-conformance#217
  • Loading branch information
achingbrain authored Jul 10, 2024
1 parent 5976f65 commit 8268872
Show file tree
Hide file tree
Showing 11 changed files with 2,452 additions and 129 deletions.
29 changes: 21 additions & 8 deletions .env-gwc
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
# ENV vars recommended for running gateway-conformance tests
USE_LIBP2P=false
USE_BITSWAP=true
PORT=8090 # helia-http-gateway should be running here
TRUSTLESS_GATEWAYS=http://127.0.0.1:8080 # Kubo should be running here
DELEGATED_ROUTING_V1_HOST=http://127.0.0.1:8080 # Kubo should be running here
DEBUG='helia-http-gateway*,*helia-fetch*,*helia:trustless-gateway-block-broker*'
USE_TRUSTLESS_GATEWAYS=true
USE_DELEGATED_ROUTING=true
export USE_LIBP2P=true
export USE_BITSWAP=true
export USE_SUBDOMAINS=false
export PORT="8080" # helia-http-gateway should be running here
export KUBO_PORT="8081" # Kubo should be running here
export TRUSTLESS_GATEWAYS="http://127.0.0.1:8081" # Kubo should be running here
export DELEGATED_ROUTING_V1_HOST="http://127.0.0.1:8081" # Kubo should be running here
# DEBUG='helia-http-gateway*,*helia-fetch*,*helia:trustless-gateway-block-broker*'
export DEBUG='helia*,helia*:trace'
export USE_TRUSTLESS_GATEWAYS=true
export USE_DELEGATED_ROUTING=true

# Uncomment the two below to save blockstore and datastore to disk
# FILE_DATASTORE_PATH=./data/datastore
# FILE_BLOCKSTORE_PATH=./data/blockstore

# Uncomment the below to see request & response headers in the logs
# ECHO_HEADERS=true

export GWC_DOCKER_IMAGE=ghcr.io/ipfs/gateway-conformance:v0.5.0

# skip most of the tests
export GWC_SKIP="^.*(TestNativeDag|TestPathing|TestPlainCodec|TestDagPbConversion|TestGatewayJsonCbor|TestCors|TestGatewayJSONCborAndIPNS|TestGatewayIPNSPath|TestRedirectCanonicalIPNS|TestGatewayCache|TestGatewaySubdomains|TestUnixFSDirectoryListingOnSubdomainGateway|TestRedirectsFileWithIfNoneMatchHeader|TestTar|TestRedirects|TestPathGatewayMiscellaneous|TestGatewayUnixFSFileRanges|TestGatewaySymlink|TestUnixFSDirectoryListing|TestGatewayBlock|IPNS|TestTrustless|TestSubdomainGatewayDNSLinkInlining).*$"
export GWC_GATEWAY_URL="http://helia-http-gateway.localhost"
# GWC_SUBDOMAIN_URL="http://helia-http-gateway.localhost"
# GWC_GATEWAY_URL="http://127.0.0.1:8080"
export GWC_GATEWAY_URL="http://host.docker.internal:8080"
export GWC_SUBDOMAIN_URL="http://host.docker.internal:8080"
5 changes: 3 additions & 2 deletions .github/workflows/gateway-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ jobs:
# use below to skip specific test if needed
# args: -skip 'TestFooBr/GET_response_for_something'
#
# only-if-cached: helia-ht does not guarantee local cache, we will adjust upstream test (which was Kubo-specific)
# only-if-cached: helia-ht does not guarantee local cache, we will
# adjust upstream test (which was Kubo-specific)
# for now disabling these test cases
args: -skip '^.*(DirectoryListing|TestGatewayCache|TestSubdomainGatewayDNSLinkInlining|proxy|TestGatewaySubdomainAndIPNS|TestGatewaySubdomains|Trustless|TestGatewayIPNSRecord|RedirectsFile|TestGatewayUnixFSFileRanges|TestGatewayJSONCborAndIPNS|TestTar|Symlink|TestPathGatewayMiscellaneous|TestGatewayBlock|TestRedirectCanonicalIPNS|TestGatewayIPNSPath|TestNativeDag|TestPathing|TestPlainCodec|TestDagPbConversion|TestGatewayJsonCbor|TestCors).*$'
args: -skip '^.*(TestDNSLinkGatewayUnixFSDirectoryListing|TestNativeDag|TestPathing|TestPlainCodec|TestDagPbConversion|TestGatewayJsonCbor|TestCors|TestGatewayJSONCborAndIPNS|TestGatewayIPNSPath|TestRedirectCanonicalIPNS|TestGatewayCache|TestGatewaySubdomains|TestUnixFSDirectoryListingOnSubdomainGateway|TestRedirectsFileWithIfNoneMatchHeader|TestTar|TestRedirects|TestPathGatewayMiscellaneous|TestGatewayUnixFSFileRanges|TestGatewaySymlink|TestUnixFSDirectoryListing|TestGatewayBlock|IPNS|TestTrustless|TestSubdomainGatewayDNSLinkInlining).*$'

# 7. Upload the results
- name: Upload MD summary
Expand Down
35 changes: 5 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,10 @@ node_modules
package-lock.json
yarn.lock
.vscode

# env config files
.env*
*.nix
.tool-versions
.direnv

# helia-http-gateway specific files
/test-results/
/playwright-report/
/playwright/.cache/
screenshots
.envrc
scripts/tmp/fixtures
scripts/tmp/kubo-path.txt
test/fixtures/e2e

# helia-http-gateway debugging files
debugging/test-gateways.log
permutation-logs
*.csv
*.log
blockstore
datastore
*.heapsnapshot

# grafana/prometheus files
config/grafana/alerting
config/grafana/grafana.db
.DS_Store
debugging/*.log
scripts/tmp
test
test-results
*-report.json
*.log
.env*
Loading

0 comments on commit 8268872

Please sign in to comment.