Skip to content

Commit

Permalink
Allow manual running of all zombienet tests in CI (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpolaczyk authored Jul 31, 2024
1 parent 7d2caa7 commit dfb7b16
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 273 deletions.
62 changes: 62 additions & 0 deletions .github/workflow-templates/zombienet-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Zombienet Tests
description: |
Downloads tanssi binaries compiled in previous step, and executes zombienet test suite using moonwall.
Uploads zombienet logs as an artifact in case of failure.
inputs:
test_name:
description: Zombienet suite to run
required: true

runs:
using: "composite"
steps:
- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
shell: bash
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/tanssi-relay
chmod uog+x target/release/tanssi-relay-prepare-worker
chmod uog+x target/release/tanssi-relay-execute-worker
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test ${{ inputs.test_name }}
- name: "Gather zombie logs"
if: failure()
shell: bash
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ inputs.test_name }}
path: logs
288 changes: 16 additions & 272 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -552,228 +552,26 @@ jobs:
zombienet-tests:
runs-on: self-hosted
needs: ["set-tags", "build"]
strategy:
fail-fast: false
matrix:
test_name: [zombie_tanssi, zombie_tanssi_parathreads, zombie_tanssi_rotation, zombie_tanssi_warp_sync, zombie_tanssi_relay]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs
path: logs

zombienet-tests-parathreads:
runs-on: ubuntu-latest
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_parathreads
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-parathreads
path: logs

zombienet-tests-rotation:
runs-on: self-hosted
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_rotation
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-rotation
path: logs

zombienet-tests-warp-sync:
runs-on: ubuntu-latest
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/container-chain-simple-node
chmod uog+x target/release/container-chain-frontier-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_warp_sync
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-warp-sync
path: logs
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}
- name: Run Zombienet Test ${{ matrix.test_name }}
uses: ./.github/workflow-templates/zombienet-tests
with:
test_name: ${{ matrix.test_name }}

chopsticks-upgrade-test:
runs-on:
labels: ubuntu-latest
needs: ["set-tags", "build"]
strategy:
fail-fast: false
matrix:
chains: [
{ chain: "stagenet_dancebox", runtime: "dancebox" },
Expand Down Expand Up @@ -815,6 +613,7 @@ jobs:
runs-on: self-hosted
needs: ["set-tags", "build"]
strategy:
fail-fast: false
matrix:
chain: ["dancebox"]
steps:
Expand Down Expand Up @@ -894,6 +693,7 @@ jobs:
runs-on: self-hosted
needs: ["set-tags", "build"]
strategy:
fail-fast: false
matrix:
chains: [
{ chain: "frontier_template", runtime: "container-chain-template-frontier" },
Expand Down Expand Up @@ -937,67 +737,11 @@ jobs:
pnpm install
pnpm moonwall test zombie_${{ matrix.chains.chain }}_upgrade
zombienet-tests-tanssi-relay:
runs-on: self-hosted
needs: ["set-tags", "build"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}

- name: Pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- name: "Download binaries"
uses: actions/download-artifact@v4
with:
name: binaries
path: target/release

- name: "Run zombie test"
run: |
chmod uog+x target/release/tanssi-node
chmod uog+x target/release/tanssi-relay
chmod uog+x target/release/tanssi-relay-execute-worker
chmod uog+x target/release/tanssi-relay-prepare-worker
chmod uog+x target/release/container-chain-simple-node
cd test
pnpm install
## Run tests
pnpm moonwall test zombie_tanssi_relay
- name: "Gather zombie logs"
if: failure()
run: |
ls -ltr /tmp
latest_zombie_dir=$(find /tmp -type d -iname "*zombie*" -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
logs_dir="logs"
mkdir -p "$logs_dir"
find "$latest_zombie_dir" -type f -name "*.log" -exec cp {} "$logs_dir" \;
- name: "Upload zombie logs"
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-tanssi-relay
path: logs

docker-tanssi:
runs-on: ubuntu-latest
needs: ["set-tags", "build"]
strategy:
fail-fast: false
matrix:
image: ["tanssi", "container-chain-simple-template", "container-chain-evm-template"]
if: ${{ (needs.set-tags.outputs.image_exists == 'false') && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push') }}
Expand Down
Loading

0 comments on commit dfb7b16

Please sign in to comment.