Skip to content

Commit

Permalink
docs: gwc info added to DEVELOPER-NOTES.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Dec 4, 2023
1 parent 46c4ad9 commit a57d76c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions DEVELOPER-NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Developer notes

<!-- toc -->

## Gateway Conformance testing

We have some code enabled that makes running gateway-conformance testing against helia-http-gateway easy. Follow the instructions in this section to run gateway-conformance tests locally

### Prerequisites

1. [Install docker](https://docs.docker.com/get-docker/)
2. [Install nodejs](https://nodejs.org/en/download/)

### Run gateway-conformance tests locally

```sh
$ npm run test:gwc
```

### Some callouts

1. The file `./scripts/kubo-init.js` executes kubo using `execa` instead of `ipfsd-ctl` so there may be some gotchas, but it should be as cross-platform and stable as the `execa` library.
1. The IPFS_PATH used is a temporary directory. Your OS should handle removing it when vital, but you can also remove it manually. The path to this directory is printed out when the tests start, and saved in a file at `./scripts/tmp/kubo-path.txt`.
1. The tests save gateway-conformance fixtures to `./scripts/tmp/fixtures`. You can remove this directory manually if you want to re-run the tests with a fresh set of fixtures.
1. The results of the gateway-conformance tests are saved to `./gwc-report.json`. This file is overwritten every time the tests are run.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:e2e-doctor": "concurrently -k -s all -n \"gateway,playwright\" -c \"magenta,blue\" \"npm run start:dev-doctor\" \"wait-on 'tcp:$PORT' && npm run test:e2e\"",
"test:gwc-kubo": "node ./scripts/kubo-init.js",
"test:gwc-helia": "npm run build && USE_LIBP2P=false PORT=8090 TRUSTLESS_GATEWAY='http://127.0.0.1:8080' npm start",
"test:gwc-execute": "docker run --network host -v $PWD:/workspace -w /workspace ghcr.io/ipfs/gateway-conformance:v0.4.2 test --gateway-url http://localhost:8090 --json report.json --specs -path-ipns-gateway,-trustless-block-gateway,-trustless-car-gateway,-trustless-car-gateway-optional,-trustless-ipns-gateway,-trustless-gateway,-subdomain-gateway,-redirects-file -- -timeout 30m",
"test:gwc-execute": "docker run --network host -v $PWD:/workspace -w /workspace ghcr.io/ipfs/gateway-conformance:v0.4.2 test --gateway-url http://localhost:8090 --json gwc-report.json --specs -path-ipns-gateway,-trustless-block-gateway,-trustless-car-gateway,-trustless-car-gateway-optional,-trustless-ipns-gateway,-trustless-gateway,-subdomain-gateway,-redirects-file -- -timeout 30m",
"test:gwc": "concurrently -k -s all -n \"kubo,helia,gateway-conformance\" -c \"magenta,blue,green\" \"npm run test:gwc-kubo\" \"wait-on 'tcp:8080' && npm run test:gwc-helia\" \"wait-on 'tcp:8090' && npm run test:gwc-execute\"",
"test:gateway-conformance": "TRUSTLESS_GATEWAY='http://localhost:8080' echo 'gateway conformance'",
"healthcheck": "node dist/src/healthcheck.js",
Expand Down

0 comments on commit a57d76c

Please sign in to comment.