diff --git a/.gitignore b/.gitignore index b76d55ad7..0e2e96045 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ /merge-fixtures /entrypoint /gateway-conformance +/dnslinks.json +/*.ipns-record # Logs logs diff --git a/Makefile b/Makefile index 2f98ec76d..00ca0efa1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,11 @@ -all: test-kubo +all: gateway-conformance + +clean: clean-docker + rm -f ./gateway-conformance + rm -f *.ipns-record + rm -f fixtures.car + rm -f dnslinks.json + rm -f ./reports/* test-cargateway: provision-cargateway fixtures.car gateway-conformance ./gateway-conformance test --json reports/output.json --gateway-url http://127.0.0.1:8040 --specs -subdomain-gateway @@ -15,8 +22,8 @@ provision-cargateway: ./fixtures.car car -c ./fixtures.car & provision-kubo: - find ./fixtures -name '*.car' -exec ipfs dag import {} \; - find ./fixtures -name '*.ipns-record' -exec sh -c 'ipfs routing put --allow-offline /ipns/$$(basename -s .ipns-record "{}") "{}"' \; + find ./fixtures -name '*.car' -exec ipfs dag import --stats --pin-roots=false {} \; + find ./fixtures -name '*.ipns-record' -exec sh -c 'ipfs routing put --offline --allow-offline /ipns/$$(basename -s .ipns-record "{}") "{}"' \; # tools fixtures.car: gateway-conformance @@ -31,7 +38,7 @@ test-docker: docker fixtures.car gateway-conformance ./reports/output.xml: ./reports/output.json jq -ns 'inputs' ./reports/output.json > ./reports/output.json.alt docker run --rm -v "${PWD}:/workspace" -w "/workspace" ghcr.io/pl-strflt/saxon:v1 -json:"./reports/output.json.alt" -xsl:/etc/gotest.xsl -o:"./reports/output.xml" - + ./reports/output.html: ./reports/output.xml docker run --rm -v "${PWD}:/workspace" -w "/workspace" ghcr.io/pl-strflt/saxon:v1 -s:./reports/output.xml -xsl:/etc/junit-noframes-saxon.xsl -o:./reports/output.html open ./reports/output.html @@ -39,4 +46,9 @@ test-docker: docker fixtures.car gateway-conformance docker: docker build -t gateway-conformance . +clean-docker: + @if command -v docker >/dev/null 2>&1 && docker image inspect gateway-conformance >/dev/null 2>&1; then \ + docker image rm gateway-conformance; \ + fi + .PHONY: gateway-conformance diff --git a/gc b/gc index fab4492a0..786afe3af 100755 --- a/gc +++ b/gc @@ -1,3 +1,8 @@ #!/usr/bin/env bash -docker run --rm -v "${PWD}:/workspace" -w "/workspace" --network=host gateway-conformance "$@" +if docker image inspect gateway-conformance >/dev/null 2>&1; then + docker run --rm -v "${PWD}:/workspace" -w "/workspace" --network=host gateway-conformance "$@" +else + echo "Docker image 'gateway-conformance' does not exist. Run 'make docker' first." >&2 + exit 1 +fi