Skip to content

Commit

Permalink
test(gateway-conformance): separate out steps for gateway-over-libp2p…
Browse files Browse the repository at this point in the history
… testing
  • Loading branch information
aschmahmann committed Sep 1, 2023
1 parent 8587eb9 commit ccb1ebf
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/gateway-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,44 @@ jobs:
./ipfs config Addresses.API "/ip4/127.0.0.1/tcp/5002"
working-directory: kubo-gateway/cmd/ipfs

# 9. Start the kubo http-p2p-proxy and setup the forwarder
- name: Start kubo-gateway
# 9. Start the kubo http-p2p-proxy
- name: Start kubo http-p2p-proxy
env:
IPFS_PATH: "~/.kubo-p2p-proxy"
run: |
gatewayNodeId=$(./ipfs id -f="<id>" --api=/ip4/127.0.0.1/tcp/5001)
./ipfs daemon --offline &
./ipfs p2p forward --allow-custom-protocol /http/1.1 /ip4/127.0.0.1/tcp/8082 /p2p/$gatewayNodeId
endpoint="http://127.0.0.1:5002/api/v0/version"
max_retries=5
retry_interval=1
check_endpoint() {
curl -X POST --silent --fail "$endpoint" > /dev/null
return $?
}
retries=0
while ! check_endpoint; do
retries=$((retries+1))
if [ $retries -ge $max_retries ]; then
echo "daemon took too long to start"
exit 1
fi
sleep $retry_interval
done
echo "daemon started and ready to receive API calls"
working-directory: kubo-gateway/cmd/ipfs

# 10. Start forwarding data from the http-p2p-proxy to the node serving the Gateway API over libp2p
- name: Start http-over-libp2p forwarding proxy
run: |
gatewayNodeId=$(./ipfs --api=/ip4/127.0.0.1/tcp/5001 id -f="<id>")
./ipfs --api=/ip4/127.0.0.1/tcp/5002 p2p forward --allow-custom-protocol /http/1.1 /ip4/127.0.0.1/tcp/8082 /p2p/$gatewayNodeId
working-directory: kubo-gateway/cmd/ipfs

# 10. Run the gateway-conformance tests
# 11. Run the gateway-conformance tests over libp2p
- name: Run gateway-conformance tests over libp2p
uses: ipfs/gateway-conformance/.github/actions/test@v0.3
with:
Expand Down

0 comments on commit ccb1ebf

Please sign in to comment.