Skip to content

Commit

Permalink
TS Integration Tests Framework (#1244)
Browse files Browse the repository at this point in the history
Co-authored-by: sampocs <[email protected]>
Co-authored-by: sampocs <[email protected]>
Co-authored-by: riley-stride <[email protected]>
Co-authored-by: Riley Edmunds <[email protected]>
Co-authored-by: Aidan Salzmann <[email protected]>
Co-authored-by: vish-stride <[email protected]>
  • Loading branch information
7 people authored Aug 1, 2024
1 parent d6e4e68 commit b6f4d2e
Show file tree
Hide file tree
Showing 13 changed files with 4,363 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ vue/*
!.vscode/settings.json

.ipynb_checkpoints/*

node_modules
3 changes: 2 additions & 1 deletion dockernet/config/relayer_config_ics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ chains:
gas-prices: 0.02ustrd
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
gaia:
Expand All @@ -30,9 +31,9 @@ chains:
gas-prices: 0.02uatom
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct


paths:
stride-gaia-ics:
Expand Down
2 changes: 2 additions & 0 deletions dockernet/config/relayer_config_juno_osmo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ chains:
gas-prices: 0.02ujuno
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
osmo:
Expand All @@ -32,6 +33,7 @@ chains:
gas-prices: 0.02uosmo
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
paths:
Expand Down
9 changes: 7 additions & 2 deletions dockernet/config/relayer_config_reward_converter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
gaia:
Expand All @@ -32,6 +33,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
dydx:
Expand All @@ -47,6 +49,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
noble:
Expand All @@ -62,6 +65,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
osmo:
Expand All @@ -77,6 +81,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
paths:
Expand Down Expand Up @@ -122,7 +127,7 @@ paths:
src-channel-filter:
rule: ""
channel-list: []
# Paths for host chain (if running DYDX)
# Paths for host chain (if running DYDX)
dydx-noble:
src:
chain-id: DYDX
Expand All @@ -138,4 +143,4 @@ paths:
chain-id: DYDX
src-channel-filter:
rule: ""
channel-list: []
channel-list: []
9 changes: 9 additions & 0 deletions dockernet/config/relayer_config_stride.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
gaia:
Expand All @@ -32,6 +33,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
juno:
Expand All @@ -47,6 +49,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
osmo:
Expand All @@ -62,6 +65,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
stars:
Expand All @@ -77,6 +81,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
host:
Expand All @@ -92,6 +97,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
evmos:
Expand All @@ -107,6 +113,7 @@ chains:
coin-type: 60
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
extra-codecs:
Expand All @@ -124,6 +131,7 @@ chains:
coin-type: 118
debug: false
timeout: 20s
min-loop-duration: 1s
output-format: json
sign-mode: direct
# {new-host-zone}:
Expand All @@ -139,6 +147,7 @@ chains:
# coin-type: {coin-type}
# debug: false
# timeout: 20s
# min-loop-duration: 1s
# output-format: json
# sign-mode: direct

Expand Down
1 change: 1 addition & 0 deletions dockernet/ts-tests/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-prefix=''
8 changes: 8 additions & 0 deletions dockernet/ts-tests/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "all",
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"printWidth": 80
}
35 changes: 35 additions & 0 deletions dockernet/ts-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### running the tests

```bash
# build stride locally and run dokcernet
(cd ../.. && make sync && make start-docker build=sgr)

# install deps
pnpm i

# run tests
pnpm test
```

IMPORTANT: `@cosmjs/*` dependencies must match the versions used by stridejs. To get those versions, run e.g. `pnpm why @cosmjs/amino`.

### debugging (vscode)

- open command palette: `Shift + Command + P (Mac) / Ctrl + Shift + P (Windows/Linux)`
- run the `Debug: Create JavaScript Debug Terminal` command
- set breakpoints
- run `pnpm test`

### test new protobufs

- go to https://github.com/Stride-Labs/stridejs
- update the config in `scripts/clone_repos.ts` to point to the new `stride/cosmos-sdk/ibc-go` version
- run `pnpm i`
- run `pnpm codegen`
- run `git commit...`
- run `git push`
- get the current `stridejs` commit using `git rev-parse HEAD`
- in the integration tests (this project):
- update the `stridejs` dependency commit hash in `package.json`
- `pnpm i`
- `pnpm test`
33 changes: 33 additions & 0 deletions dockernet/ts-tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "stride-integration-tests",
"version": "1.0.0",
"description": "integration tests for stride chain",
"scripts": {
"test": "vitest run",
"test-watch": "vitest watch"
},
"keywords": [
"wow",
"much",
"liquidity"
],
"author": "Stride Labs",
"license": "ISC",
"dependencies": {
"@cosmjs/amino": "0.32.4",
"@cosmjs/encoding": "0.32.4",
"@cosmjs/math": "0.32.4",
"@cosmjs/proto-signing": "0.32.4",
"@cosmjs/stargate": "0.32.4",
"@cosmjs/tendermint-rpc": "0.32.4",
"@cosmology/lcd": "0.13.4",
"@noble/hashes": "1.4.0",
"bech32": "2.0.0",
"jest": "29.7.0",
"prettier": "3.3.3",
"stridejs": "github:Stride-Labs/stridejs#e17c404f6451bad95ef0093f2b41244248bd7ebd",
"typescript": "5.5.3",
"vitest": "2.0.3"
},
"packageManager": "[email protected]+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
}
Loading

0 comments on commit b6f4d2e

Please sign in to comment.