Update tests CI workflow
This commit is contained in:
parent
e43597f168
commit
bb96c5bd16
@ -35,21 +35,21 @@ jobs:
|
|||||||
- name: Install registry-cli
|
- name: Install registry-cli
|
||||||
run: yarn global add file:$PWD
|
run: yarn global add file:$PWD
|
||||||
|
|
||||||
- name: Checkout laconicd
|
- name: Checkout laconic2d
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: "./laconicd/"
|
path: "./laconic2d/"
|
||||||
repository: cerc-io/laconicd
|
repository: cerc-io/laconic2d
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: main
|
ref: main
|
||||||
|
|
||||||
- name: Build laconicd container
|
- name: Build laconic2d container
|
||||||
working-directory: ./laconicd/tests/sdk_tests
|
working-directory: ./laconic2d/tests/sdk_tests
|
||||||
run: ./build-laconicd-container.sh
|
run: ./build-laconic2d-container.sh
|
||||||
- name: Start laconicd container
|
- name: Start laconic2d container
|
||||||
env:
|
env:
|
||||||
TEST_AUCTION_ENABLED: true
|
TEST_AUCTION_ENABLED: true
|
||||||
run: docker compose up laconicd -d
|
run: docker compose up laconic2d -d
|
||||||
|
|
||||||
- name: Run registry-cli tests
|
- name: Run registry-cli tests
|
||||||
run: ./test/run-tests.sh
|
run: ./test/run-tests.sh
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
services:
|
services:
|
||||||
laconicd:
|
laconic2d:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: cerc/laconicd:local
|
image: cerc/laconic2d:local
|
||||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||||
environment:
|
environment:
|
||||||
- TEST_AUCTION_ENABLED
|
- TEST_AUCTION_ENABLED
|
||||||
- TEST_REGISTRY_EXPIRY
|
- TEST_REGISTRY_EXPIRY
|
||||||
- LOGLEVEL
|
- LOGLEVEL
|
||||||
volumes:
|
volumes:
|
||||||
- ./laconicd/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
- ./laconic2d/scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
||||||
interval: 1s
|
interval: 1s
|
||||||
@ -17,10 +17,11 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "9473:9473"
|
- "9473:9473"
|
||||||
- "1317:1317"
|
- "1317:1317"
|
||||||
|
- "26657:26657"
|
||||||
|
|
||||||
cli-test-runner:
|
cli-test-runner:
|
||||||
image: cerc/laconic-registry-cli:local
|
image: cerc/laconic-registry-cli:local
|
||||||
depends_on:
|
depends_on:
|
||||||
laconicd:
|
laconic2d:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
command: tail -F /dev/null
|
command: tail -F /dev/null
|
||||||
|
@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(chainId, 'Invalid CNS Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
if (!address && privateKey) {
|
if (!address && privateKey) {
|
||||||
address = new Account(Buffer.from(privateKey, 'hex')).getCosmosAddress();
|
address = new Account(Buffer.from(privateKey, 'hex')).address;
|
||||||
}
|
}
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Get the key from laconicd
|
# Get the key from laconic2d
|
||||||
laconicd_key=$(yes | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe)
|
laconic2d_key=$(yes | docker compose exec laconic2d laconic2d keys export mykey --unarmored-hex --unsafe)
|
||||||
|
|
||||||
# Get the fixturenet account address
|
# Get the fixturenet account address
|
||||||
laconicd_account_address=$(docker compose exec laconicd laconicd keys list | awk '/- address:/ {print $3}')
|
laconic2d_account_address=$(docker compose exec laconic2d laconic2d keys list | awk '/- address:/ {print $3}')
|
||||||
|
|
||||||
# Set parameters for the test suite
|
# Set parameters for the test suite
|
||||||
cosmos_chain_id=laconic_9000-1
|
cosmos_chain_id=laconic_9000-1
|
||||||
laconicd_rest_endpoint=http://127.0.0.1:1317
|
laconic2d_rpc_endpoint=http://127.0.0.1:26657
|
||||||
laconicd_gql_endpoint=http://127.0.0.1:9473/api
|
laconic2d_gql_endpoint=http://127.0.0.1:9473/api
|
||||||
|
|
||||||
# Create the required config
|
# Create the required config
|
||||||
config_file="config.yml"
|
config_file="config.yml"
|
||||||
config=$(cat <<EOL
|
config=$(cat <<EOL
|
||||||
services:
|
services:
|
||||||
cns:
|
cns:
|
||||||
restEndpoint: $laconicd_rest_endpoint
|
restEndpoint: $laconic2d_rpc_endpoint
|
||||||
gqlEndpoint: $laconicd_gql_endpoint
|
gqlEndpoint: $laconic2d_gql_endpoint
|
||||||
userKey: $laconicd_key
|
userKey: $laconic2d_key
|
||||||
bondId:
|
bondId:
|
||||||
chainId: $cosmos_chain_id
|
chainId: $cosmos_chain_id
|
||||||
gas: 200000
|
gas: 200000
|
||||||
@ -28,7 +28,7 @@ EOL
|
|||||||
echo "$config" > "$config_file"
|
echo "$config" > "$config_file"
|
||||||
|
|
||||||
# Wait for the laconid endpoint to come up
|
# 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"
|
docker compose exec laconic2d sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
TEST_ACCOUNT=$laconicd_account_address yarn test
|
TEST_ACCOUNT=$laconic2d_account_address yarn test
|
||||||
|
Loading…
Reference in New Issue
Block a user