Skip to content

Commit ef13288

Browse files
authored
feat: Add E2E tests CI workflow (#1)
* feat: Add test CI * fix: correct npm script * fix: path * chore: dont build test files * chore: bring up gno * chore: latest gnodev * chore: master build * chore: entrypoint * test * command hack * chore: bring up docker in steps * chore: run example * chore: Add wait-on timeout * chore show docker logs * chore: wait * chore * chore: display docker info * chore: wait * chore: fix entrypoint * chore: fix test typo * chore: adjust block heights * chore: last. height adj * chore: more height adj * chore: Add gnoland docker * fix: AbciInfo decoding * chore: check tx on test8
1 parent 5603686 commit ef13288

8 files changed

Lines changed: 345 additions & 27 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: E2E Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20.x
16+
check-latest: true
17+
18+
- name: Install dependencies
19+
run: npm install -g pnpm && pnpm install
20+
- name: Build the project
21+
run: pnpm build
22+
- name: Run tests
23+
run: |
24+
docker compose up -d
25+
pnpm test
26+
./node_modules/.bin/wait-on http://127.0.0.1:26657/status --timeout 30000 && sleep 20s &&node build/example.js
27+
docker compose logs

docker-compose.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
services:
2+
gnoland:
3+
image: "ghcr.io/gnolang/gno/gnoland:master"
4+
entrypoint: "sh"
5+
command:
6+
- -c
7+
- |
8+
gnoland secrets init
9+
gnoland config init
10+
gnoland config set rpc.laddr tcp://0.0.0.0:26657
11+
gnoland start --lazy --skip-genesis-sig-verification
12+
ports:
13+
- 127.0.0.1:26657:26657
14+
healthcheck:
15+
test: ["CMD", "wget", "-q", "--spider", "http://localhost:26657/health"]
16+
interval: 5s
17+
timeout: 10s
18+
retries: 60
19+
start_period: 30s
20+
21+
supernova:
22+
image: ghcr.io/gnolang/supernova:1.5.2
23+
command:
24+
- --sub-accounts=5
25+
- --transactions=1000
26+
- --chain-id=dev
27+
- --url=http://gnoland:26657
28+
- --mnemonic=source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast
29+
restart: on-failure
30+
depends_on:
31+
gnoland:
32+
condition: service_healthy

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"ses": "^1.13.0",
4848
"typescript": "^5.8.3",
4949
"typescript-eslint": "^8.36.0",
50-
"vitest": "^3.2.4"
50+
"vitest": "^3.2.4",
51+
"wait-on": "^8.0.4"
5152
}
5253
}

0 commit comments

Comments
 (0)