Add a script to run tests and update gitea workflow

This commit is contained in:
2024-01-24 16:48:04 +05:30
parent abe9195615
commit 395e8bddee
5 changed files with 67 additions and 29 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Get the key from laconicd
laconicd_key=$(yes | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe)
# 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
EOL
)
echo "$config" > "$config_file"
# Wait for the laconid endpoint to come up
docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
# Run tests
yarn test