Skip to content

Commit 8268872

Browse files
authored
test: add gateway conformance tests (#314)
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
1 parent 5976f65 commit 8268872

File tree

11 files changed

+2452
-129
lines changed

11 files changed

+2452
-129
lines changed

.env-gwc

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
# ENV vars recommended for running gateway-conformance tests
2-
USE_LIBP2P=false
3-
USE_BITSWAP=true
4-
PORT=8090 # helia-http-gateway should be running here
5-
TRUSTLESS_GATEWAYS=http://127.0.0.1:8080 # Kubo should be running here
6-
DELEGATED_ROUTING_V1_HOST=http://127.0.0.1:8080 # Kubo should be running here
7-
DEBUG='helia-http-gateway*,*helia-fetch*,*helia:trustless-gateway-block-broker*'
8-
USE_TRUSTLESS_GATEWAYS=true
9-
USE_DELEGATED_ROUTING=true
2+
export USE_LIBP2P=true
3+
export USE_BITSWAP=true
4+
export USE_SUBDOMAINS=false
5+
export PORT="8080" # helia-http-gateway should be running here
6+
export KUBO_PORT="8081" # Kubo should be running here
7+
export TRUSTLESS_GATEWAYS="http://127.0.0.1:8081" # Kubo should be running here
8+
export DELEGATED_ROUTING_V1_HOST="http://127.0.0.1:8081" # Kubo should be running here
9+
# DEBUG='helia-http-gateway*,*helia-fetch*,*helia:trustless-gateway-block-broker*'
10+
export DEBUG='helia*,helia*:trace'
11+
export USE_TRUSTLESS_GATEWAYS=true
12+
export USE_DELEGATED_ROUTING=true
1013

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

1518
# Uncomment the below to see request & response headers in the logs
1619
# ECHO_HEADERS=true
20+
21+
export GWC_DOCKER_IMAGE=ghcr.io/ipfs/gateway-conformance:v0.5.0
22+
23+
# skip most of the tests
24+
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).*$"
25+
export GWC_GATEWAY_URL="http://helia-http-gateway.localhost"
26+
# GWC_SUBDOMAIN_URL="http://helia-http-gateway.localhost"
27+
# GWC_GATEWAY_URL="http://127.0.0.1:8080"
28+
export GWC_GATEWAY_URL="http://host.docker.internal:8080"
29+
export GWC_SUBDOMAIN_URL="http://host.docker.internal:8080"

.github/workflows/gateway-conformance.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ jobs:
9999
# use below to skip specific test if needed
100100
# args: -skip 'TestFooBr/GET_response_for_something'
101101
#
102-
# only-if-cached: helia-ht does not guarantee local cache, we will adjust upstream test (which was Kubo-specific)
102+
# only-if-cached: helia-ht does not guarantee local cache, we will
103+
# adjust upstream test (which was Kubo-specific)
103104
# for now disabling these test cases
104-
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).*$'
105+
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).*$'
105106

106107
# 7. Upload the results
107108
- name: Upload MD summary

.gitignore

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,10 @@ node_modules
77
package-lock.json
88
yarn.lock
99
.vscode
10-
11-
# env config files
12-
.env*
13-
*.nix
14-
.tool-versions
15-
.direnv
16-
17-
# helia-http-gateway specific files
18-
/test-results/
19-
/playwright-report/
20-
/playwright/.cache/
21-
screenshots
22-
.envrc
23-
scripts/tmp/fixtures
24-
scripts/tmp/kubo-path.txt
25-
test/fixtures/e2e
26-
27-
# helia-http-gateway debugging files
28-
debugging/test-gateways.log
29-
permutation-logs
30-
*.csv
31-
*.log
32-
blockstore
3310
datastore
34-
*.heapsnapshot
35-
36-
# grafana/prometheus files
37-
config/grafana/alerting
38-
config/grafana/grafana.db
39-
.DS_Store
11+
debugging/*.log
12+
scripts/tmp
13+
test
14+
test-results
15+
*-report.json
4016
*.log
41-
.env*

0 commit comments

Comments
 (0)