laconic-registry-cli/test/run-tests.sh
Prathamesh Musale 094a3d4383
All checks were successful
Publish npm package to gitea / npm_publish (18.x) (release) Successful in 1m9s
Lint / lint (18.x) (push) Successful in 1m5s
Tests / cli_tests (18.x) (push) Successful in 8m29s
Handle race condition in CI tests and upgrade SDK (#64)
Part of #63

Reviewed-on: #64
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-06-17 08:03:14 +00:00

37 lines
1008 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# Wait for the laconid endpoint to come up
docker compose exec laconicd sh -c "curl --retry 20 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
# Get the key from laconicd
laconicd_key=$(yes | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe)
# Get the fixturenet account address
laconicd_account_address=$(docker compose exec laconicd laconicd keys list | awk '/- address:/ {print $3}')
# Set parameters for the test suite
cosmos_chain_id=laconic_9000-1
laconicd_rest_endpoint=http://127.0.0.1:1317
laconicd_gql_endpoint=http://127.0.0.1:9473/api
# Create the required config
config_file="config.yml"
config=$(cat <<EOL
services:
cns:
restEndpoint: $laconicd_rest_endpoint
gqlEndpoint: $laconicd_gql_endpoint
userKey: $laconicd_key
bondId:
chainId: $cosmos_chain_id
gas: 200000
fees: 200000aphoton
EOL
)
echo "$config" > "$config_file"
# Run tests
TEST_ACCOUNT=$laconicd_account_address yarn test