diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7dae33f..e42779e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -8,9 +8,17 @@ on: jobs: test: - runs-on: ubuntu-latest + # teritorid hangs on ubuntu runner + runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: Checkout teritori-dapp repo + uses: actions/checkout@v4 + with: + repository: TERITORI/teritori-dapp + path: teritori-dapp + ref: 66134e9580135a07aba64e00b68af9f30f8fdb93 - uses: actions/setup-go@v3 with: @@ -19,6 +27,10 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + cache: "yarn" + cache-dependency-path: "teritori-dapp/yarn.lock" - - name: Run integration test - run: make integration-test + - name: Run integration tests + run: make integration-tests + env: + TERITORI_DAPP_REPO: teritori-dapp diff --git a/.gitignore b/.gitignore index 168bfb1..2ba299a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ data *.txt .idea -/teritori-dapp/ \ No newline at end of file +/teritori-dapp/ +/build/ diff --git a/Makefile b/Makefile index e97c05e..7057f2e 100644 --- a/Makefile +++ b/Makefile @@ -214,6 +214,6 @@ docker.publish: docker build . --platform linux/amd64 -t $(IMAGE_TAG) docker push $(IMAGE_TAG) -.PHONY: integration-test -integration-test: +.PHONY: integration-tests +integration-tests: ./integration-test/run.sh \ No newline at end of file diff --git a/integration-test/run.sh b/integration-test/run.sh index f37ca5e..bddc419 100755 --- a/integration-test/run.sh +++ b/integration-test/run.sh @@ -3,6 +3,19 @@ set -euo pipefail IFS=$'\n\t' set -x -make install +commit=66134e9580135a07aba64e00b68af9f30f8fdb93 -parallel --lb -j2 --halt now,done=1 ::: './start.sh >> node_logs.txt 2>&1' './integration-test/test.sh' \ No newline at end of file +if [[ -z "${TERITORI_DAPP_REPO:-}" ]]; then + rm -fr teritori-dapp + git clone https://github.com/TERITORI/teritori-dapp.git + cd teritori-dapp + git checkout $commit +else + cd $TERITORI_DAPP_REPO +fi + +yarn + +npx tsx packages/scripts/integration-testing/simpleTest .. +npx tsx packages/scripts/integration-testing/upgradeTest142toDir .. +npx tsx packages/scripts/integration-testing/upgradeTest120toDir .. \ No newline at end of file diff --git a/integration-test/test.sh b/integration-test/test.sh deleted file mode 100755 index 2ad285b..0000000 --- a/integration-test/test.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -euo pipefail -IFS=$'\n\t' -set -x - -commit=1366a1f06d43e9d1cd53e3dd022df3b4ee47c8d3 - -if [[ -z "${TERITORI_DAPP_REPO:-}" ]]; then - rm -fr teritori-dapp - git clone https://github.com/TERITORI/teritori-dapp.git - cd teritori-dapp - git checkout $commit -else - cd $TERITORI_DAPP_REPO -fi - -yarn - -while ! curl -s http://localhost:26657/status | jq -e '.result.sync_info.latest_block_height|tonumber > 0'; do sleep 5; done - -npx tsx packages/scripts/network-setup/deploy teritori-localnet validator \ No newline at end of file