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

Split load test #1041

Merged
merged 10 commits into from
Jan 8, 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
96 changes: 82 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,50 @@ jobs:
- run: ./scripts/coverage.sh
shell: bash

build_image:
name: Build Docker Image
runs-on: ubuntu-20.04
e2e_precompile:
name: e2e precompile tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo ${{ secrets.docker_pass }} | docker login --username ${{ secrets.docker_username }} --password-stdin
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
check-latest: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.15"
- name: NPM Clean Install
run: npm ci
working-directory: ./contracts
- name: Hardhat Clean
run: npx hardhat clean
working-directory: ./contracts
- name: Hardhat Compile
run: npx hardhat compile
working-directory: ./contracts
- name: Install AvalancheGo Release
shell: bash
- run: CURRENT_BRANCH=${{ github.head_ref || github.ref_name }} PUSH_DOCKER_IMAGE=true ./scripts/build_image.sh
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
- name: Build Subnet-EVM Plugin Binary
shell: bash

e2e_test:
name: e2e tests
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
- name: Run E2E Precompile Tests
shell: bash
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/precompile-data ./scripts/run_ginkgo_precompile.sh
- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: subnet-evm-e2e-logs-precompile
path: /tmp/network-runner-root-data*/
retention-days: 5
e2e_warp:
name: e2e warp tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
Expand Down Expand Up @@ -87,16 +119,52 @@ jobs:
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
- name: Run E2E Tests
shell: bash
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh
- name: Run Warp E2E Tests
shell: bash
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo_warp.sh
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/warp-data ./scripts/run_ginkgo_warp.sh
- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: subnet-evm-e2e-logs-warp
path: /tmp/network-runner-root-data*/
retention-days: 5
e2e_load:
name: e2e load tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
check-latest: true
- name: Install AvalancheGo Release
shell: bash
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
- name: Run E2E Load Tests
shell: bash
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/load-data ./scripts/run_ginkgo_load.sh
- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: subnet-evm-e2e-logs
name: subnet-evm-e2e-logs-load
path: /tmp/network-runner-root-data*/
retention-days: 5

build_image:
name: Build Docker Image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: echo ${{ secrets.docker_pass }} | docker login --username ${{ secrets.docker_username }} --password-stdin
shell: bash
- run: CURRENT_BRANCH=${{ github.head_ref || github.ref_name }} PUSH_DOCKER_IMAGE=true ./scripts/build_image.sh
shell: bash
28 changes: 28 additions & 0 deletions scripts/run_ginkgo_load.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e

# This script assumes that an AvalancheGo and Subnet-EVM binaries are available in the standard location
# within the $GOPATH
# The AvalancheGo and PluginDir paths can be specified via the environment variables used in ./scripts/run.sh.

# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)

source "$SUBNET_EVM_PATH"/scripts/constants.sh

source "$SUBNET_EVM_PATH"/scripts/versions.sh

# Build ginkgo
# to install the ginkgo binary (required for test build and run)
go install -v github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION}

TEST_SOURCE_ROOT=$(pwd)

ACK_GINKGO_RC=true ginkgo build ./tests/load

./tests/load/load.test \
--ginkgo.vv \
--ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""}
6 changes: 0 additions & 6 deletions scripts/run_ginkgo.sh → scripts/run_ginkgo_precompile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@ go install -v github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION}

TEST_SOURCE_ROOT=$(pwd)

ACK_GINKGO_RC=true ginkgo build ./tests/load

# By default, it runs all e2e test cases!
# Use "--ginkgo.skip" to skip tests.
# Use "--ginkgo.focus" to select tests.
TEST_SOURCE_ROOT="$TEST_SOURCE_ROOT" ginkgo run -procs=5 tests/precompile \
--ginkgo.vv \
--ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""}

./tests/load/load.test \
--ginkgo.vv \
--ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""}
Loading