diff --git a/.github/workflows/kalatori-test.yml b/.github/workflows/kalatori-test.yml index f97f2bf..61de1d9 100644 --- a/.github/workflows/kalatori-test.yml +++ b/.github/workflows/kalatori-test.yml @@ -41,17 +41,18 @@ jobs: sudo chmod +x /usr/local/bin/docker-compose docker-compose --version - - name: Build and Start Containers + - name: Build Containers working-directory: ./tests run: | - docker-compose up -d --build chopsticks-polkadot chopsticks-statemint kalatori-rust-app + docker-compose build - - name: Wait for Dependencies to Initialize - run: sleep 60 + - name: Run Tests + working-directory: ./tests + run: | + docker-compose up --exit-code-from tests --abort-on-container-exit tests - - name: Run Tests and Capture Exit Code + - name: Tear Down Containers working-directory: ./tests + if: always() run: | - docker-compose run tests || exit_code=$? docker-compose down - exit ${exit_code:-0} diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 5b64f6f..7282c9a 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -52,4 +52,4 @@ services: - kalatori-rust-app environment: - DAEMON_HOST=http://kalatori-daemon:16726 - command: /bin/sh -c "sleep 50 && yarn install && yarn test" + command: /bin/sh -c "sleep 180 && yarn install && yarn test" diff --git a/tests/kalatori-api-test-suite/package.json b/tests/kalatori-api-test-suite/package.json index c362547..1f1a998 100644 --- a/tests/kalatori-api-test-suite/package.json +++ b/tests/kalatori-api-test-suite/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "test": "jest" + "test": "jest --silent" }, "keywords": [], "author": "", diff --git a/tests/kalatori-api-test-suite/tests/order.test.ts b/tests/kalatori-api-test-suite/tests/order.test.ts index 68a222e..db49606 100644 --- a/tests/kalatori-api-test-suite/tests/order.test.ts +++ b/tests/kalatori-api-test-suite/tests/order.test.ts @@ -271,6 +271,7 @@ describe('Order Endpoint Blackbox Tests', () => { halfAmount, orderDetails.currency.asset_id ); + // lets wait for the changes to get propagated on chain and app to catch them await new Promise(resolve => setTimeout(resolve, 15000)); @@ -310,6 +311,7 @@ describe('Order Endpoint Blackbox Tests', () => { halfAmount, orderDetails.currency.asset_id ); + // lets wait for the changes to get propagated on chain and app to catch them await new Promise(resolve => setTimeout(resolve, 15000));