Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make clean and docker cleanup #110

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-kubo-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
cars=$(find ./fixtures -name '*.car')
for car in $cars
do
ipfs dag import "$car" --pin-roots=false
ipfs dag import --pin-roots=false --stats "$car"
done

# Import ipns records
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
/merge-fixtures
/entrypoint
/gateway-conformance
/dnslinks.json
/*.ipns-record

# Logs
logs
Expand Down
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,12 +38,17 @@ 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

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
7 changes: 6 additions & 1 deletion gc
Original file line number Diff line number Diff line change
@@ -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
Loading