-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zombienet): add zombienet testing to github workflow (#3192)
- Loading branch information
1 parent
3bbdfe0
commit d788bd6
Showing
6 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: zombienet | ||
run-name: Zombienet tests | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
zombienet-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
stable: true | ||
check-latest: true | ||
|
||
- name: Set cache variables | ||
id: go-cache-paths | ||
run: | | ||
echo "::set-output name=go-build::$(go env GOCACHE)" | ||
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Go build cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-build }} | ||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go-build | ||
|
||
- name: Go modules cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go-mod | ||
|
||
- name: Run build | ||
run: | | ||
make build | ||
echo "$HOME/work/gossamer/gossamer/bin" >> $GITHUB_PATH | ||
- name: Install Zombienet | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
wget -O /usr/local/bin/zombienet https://github.com/paritytech/zombienet/releases/download/v1.3.41/zombienet-linux-x64 | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
wget -O /usr/local/bin/zombienet https://github.com/paritytech/zombienet/releases/download/v1.3.41/zombienet-macos | ||
else | ||
echo "Zombienet for $RUNNER_OS is not supported" | ||
exit 1 | ||
fi | ||
chmod +x /usr/local/bin/zombienet | ||
- name: Zombienet test | ||
run: | | ||
zombienet test -p native zombienet_tests/functional/0001-basic-network.zndsl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[relaychain] | ||
chain_spec_path = "chain/westend-local/westend-local-spec-raw.json" | ||
|
||
chain = "westend-local" | ||
|
||
[[relaychain.nodes]] | ||
name = "alice" | ||
command = "gossamer" | ||
validator = true | ||
args = ["--key alice"] | ||
|
||
[[relaychain.nodes]] | ||
name = "bob" | ||
command = "gossamer" | ||
validator = true | ||
args = ["--key bob"] | ||
|
||
[[relaychain.nodes]] | ||
name = "charlie" | ||
command = "gossamer" | ||
validator = true | ||
args = ["--key charlie"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Description: Small Network test | ||
Network: ./0001-basic-network.toml | ||
Creds: config | ||
|
||
# metrics | ||
alice: reports gossamer_network_node_peer_count_total is 2 within 30 seconds | ||
alice: reports gossamer_network_syncer_is_synced is 1 within 30 seconds | ||
bob: reports gossamer_network_node_peer_count_total is 2 within 30 seconds | ||
bob: reports gossamer_network_syncer_is_synced is 1 within 30 seconds | ||
charlie: reports gossamer_network_node_peer_count_total is 2 within 30 seconds | ||
charlie: reports gossamer_network_syncer_is_synced is 1 within 30 seconds | ||
|
||
alice: log line matches "built block [0-9]+" within 30 seconds | ||
bob: log line matches "built block [0-9]+" within 30 seconds | ||
charlie: log line matches "built block [0-9]+" within 30 seconds |