2024-03-12 12:06:24 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Forwards all args to yarn on the sdk-test-runner container
|
|
|
|
|
|
|
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
|
|
|
yarn_args=("--inspect-brk=8888")
|
|
|
|
yarn_args+=("${@:-test}")
|
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
# Get the key from laconicd
|
|
|
|
laconicd_key=$(
|
|
|
|
yes | docker compose exec laconicd laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
2024-03-12 12:06:24 +00:00
|
|
|
)
|
|
|
|
# Set parameters for the test suite
|
|
|
|
cosmos_chain_id=laconic_9000-1
|
2024-04-01 09:57:26 +00:00
|
|
|
laconicd_rpc_endpoint=http://laconicd:26657
|
|
|
|
laconicd_gql_endpoint=http://laconicd:9473/api
|
2024-03-12 12:06:24 +00:00
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
2024-03-12 12:06:24 +00:00
|
|
|
|
|
|
|
# Run tests
|
|
|
|
docker compose exec \
|
|
|
|
-e COSMOS_CHAIN_ID="$cosmos_chain_id" \
|
|
|
|
-e LACONICD_REST_ENDPOINT="$laconicd_rpc_endpoint" \
|
|
|
|
-e LACONICD_GQL_ENDPOINT="$laconicd_gql_endpoint" \
|
2024-04-01 09:57:26 +00:00
|
|
|
-e PRIVATE_KEY="$laconicd_key" \
|
2024-03-12 12:06:24 +00:00
|
|
|
sdk-test-runner yarn run "${yarn_args[@]}"
|