diff --git a/docker-compose.yml b/docker-compose.yml index cef6090..c6542ff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ services: laconicd: restart: unless-stopped image: cerc/laconicd:local - command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] + command: ["bash", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] environment: - TEST_AUCTION_ENABLED - TEST_REGISTRY_EXPIRY @@ -10,7 +10,7 @@ services: volumes: - ./laconicd/scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh healthcheck: - test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"] + test: ["CMD", "curl", "-v", "http://127.0.0.1", "6060"] interval: 1s timeout: 5s retries: 30 diff --git a/package.json b/package.json index aa277ce..9b8bda9 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "typescript": "^4.6.3" }, "dependencies": { - "@cerc-io/registry-sdk": "^0.2.1", + "@cerc-io/registry-sdk": "^0.2.2", "fs-extra": "^10.1.0", "js-yaml": "^3.14.1", "lodash": "^4.17.21", diff --git a/test/cli.test.ts b/test/cli.test.ts index c8d37e7..b5d5ff5 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -67,12 +67,12 @@ describe('Test laconic CLI commands', () => { expect(outputObj).toHaveProperty('node'); expect(outputObj).toHaveProperty('node.network', CHAIN_ID); expect(outputObj).toHaveProperty('sync'); - expect(Number(outputObj.sync.latest_block_height)).toBeGreaterThan(0); + expect(Number(outputObj.sync.latestBlockHeight)).toBeGreaterThan(0); expect(outputObj).toHaveProperty('validator'); expect(outputObj).toHaveProperty('validators'); - expect(outputObj).toHaveProperty('num_peers'); + expect(outputObj).toHaveProperty('numPeers'); expect(outputObj).toHaveProperty('peers'); - expect(outputObj).toHaveProperty('disk_usage'); + expect(outputObj).toHaveProperty('diskUsage'); }); describe('Bond operations', () => { diff --git a/test/run-tests.sh b/test/run-tests.sh index c09ec97..6c692aa 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +set -e +set -u + +# 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" + # Get the key from laconicd laconicd_key=$(yes | docker compose exec laconicd laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe) @@ -27,8 +33,5 @@ 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 TEST_ACCOUNT=$laconicd_account_address yarn test diff --git a/yarn.lock b/yarn.lock index 7b55ecb..e29d3ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -302,10 +302,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cerc-io/registry-sdk@^0.2.1": - version "0.2.1" - resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.1/registry-sdk-0.2.1.tgz#c25cbfc89e469197b18e960baa4204e9e5c5511c" - integrity sha512-rshIFOaYVyKJu4MU0OATN0JLYrjue9xvQ4Eqnd2z03lS8WMh0gt1eJHzp8A8sxs1IP/jpb6mWXhmu0oQujO2Sg== +"@cerc-io/registry-sdk@^0.2.2": + version "0.2.2" + resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.2/registry-sdk-0.2.2.tgz#2e8a533f069b4bb9f4cd4798e783f52e29167d0d" + integrity sha512-ocRMbWtdewOg02ORfK1U+qbTqB46anHP4ApXokGkY4d+mFSApR3sdUEi2geHcs8oh+SG8YAp7LUJ9AAJneNY8g== dependencies: "@cosmjs/amino" "^0.28.1" "@cosmjs/crypto" "^0.28.1"