Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: basic integration test #82

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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