Skip to content

Commit

Permalink
feat: basic integration test (#82)
Browse files Browse the repository at this point in the history
* feat: basic integration test

Signed-off-by: Norman Meier <[email protected]>

* fix: no broadcast-mode block

Signed-off-by: Norman Meier <[email protected]>

* chore: split commit

Signed-off-by: Norman Meier <[email protected]>

---------

Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz authored Jan 18, 2024
1 parent 3fc9457 commit 46aeeb3
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Integration

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: "1.20"

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Run integration test
run: make integration-test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
testnetv2
data
*.txt
.idea
.idea

/teritori-dapp/
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,7 @@ proto-check-breaking:
docker.publish:
docker build . --platform linux/amd64 -t $(IMAGE_TAG)
docker push $(IMAGE_TAG)

.PHONY: integration-test
integration-test:
./integration-test/run.sh
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ Teritori is a Cosmos SDK based blockchain here to enhance Web3 individuals, comm

## All the mainnet chains:
[__ACTIVE__] - [teritori-1](https://github.com/TERITORI/teritori-chain/tree/main/mainnet/teritori-1)

# Dev

## Run custom integration test

```shell
TERITORI_DAPP_REPO=/path/to/teritori-dapp ./integration-test/run.sh
```
8 changes: 8 additions & 0 deletions integration-test/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
set -x

make install

parallel --lb -j2 --halt now,done=1 ::: './start.sh >> node_logs.txt 2>&1' './integration-test/test.sh'
21 changes: 21 additions & 0 deletions integration-test/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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

0 comments on commit 46aeeb3

Please sign in to comment.