mirror of
https://github.com/fluencelabs/examples
synced 2024-12-04 19:20:17 +00:00
CI: fix service deployment test (#201)
This commit is contained in:
parent
6c29107364
commit
e9420bd3ae
@ -23,7 +23,7 @@ jobs:
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- run: docker run -d --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local
|
||||
- run: docker run -d --rm -e RUST_LOG="info" --name fluence -p 5001:5001 -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local
|
||||
|
||||
- name: Download marine
|
||||
run: sudo bash $GITHUB_WORKSPACE/.github/download_marine.sh
|
||||
@ -48,25 +48,41 @@ jobs:
|
||||
|
||||
- run: npm install -g @fluencelabs/aqua@0.6.4-283
|
||||
|
||||
- name: "Wait for aqua-ipfs service to start"
|
||||
run: |
|
||||
set -o errexit -o nounset -o pipefail
|
||||
set -x
|
||||
while true; do
|
||||
STATUS=$(docker logs fluence |& grep -q 'Fluence has been successfully started.' && echo "OK" || echo "FAIL")
|
||||
if [ $STATUS == "OK" ]; then
|
||||
break;
|
||||
else
|
||||
sleep 0.5
|
||||
echo "Waiting for all builtin services to start"
|
||||
fi
|
||||
done
|
||||
|
||||
- name: "Check call_parameters deployment"
|
||||
run: |
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
set -x
|
||||
NODE="/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3"
|
||||
SERVICE_ID=`./deploy.sh $NODE`
|
||||
INPUT=$GITHUB_WORKSPACE/.github/deploy.aqua
|
||||
|
||||
RESULT=$(aqua run --addr $NODE --sk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo= -f 'call(service_id)' -d '{"service_id": "'$SERVICE_ID'"}' --input $INPUT)
|
||||
RESULT=$(echo $RESULT | sed -e 's/Your peerId: [a-zA-Z0-9]*//g')
|
||||
# RESULT=$(echo $RESULT | sed -e 's/Your peerId: [a-zA-Z0-9]*//g')
|
||||
|
||||
EXPECTED_PEER_ID=$(echo -e "$RESULT" | sed -n '1p' | grep -o '12D3.*')
|
||||
RESULT_PEER_ID=$(echo -e "$RESULT" | sed -n '2p' | tr -d \")
|
||||
if [ "$EXPECTED_PEER_ID" -neq "$RESULT_PEER_ID" ]; then
|
||||
if [ "$EXPECTED_PEER_ID" != "$RESULT_PEER_ID" ]; then
|
||||
echo "Expected $EXPECTED_PEER_ID, got $RESULT_PEER_ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RESULT_SERVICE_ID=$(echo -e "$RESULT" | sed -n '3p')
|
||||
if [ "$SERVICE_ID" -neq "$RESULT_SERVICE_ID" ]; then
|
||||
if [ "$SERVICE_ID" != "$RESULT_SERVICE_ID" ]; then
|
||||
echo "Expected $SERVICE_ID, got $RESULT_SERVICE_ID"
|
||||
exit 1
|
||||
fi
|
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
./build.sh
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
NODE="$1"
|
||||
else
|
||||
@ -10,6 +8,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./build.sh
|
||||
|
||||
# check it .wasm was built
|
||||
WASM="artifacts/call_parameters.wasm"
|
||||
|
Loading…
Reference in New Issue
Block a user