From 26e720a28ac7f401e2f33630df69fd9b34328925 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 26 Jun 2024 21:17:03 +0800 Subject: [PATCH] refactor script, clone stack separately --- .gitea/workflows/test.yml | 29 ++++++++++++------- ...integration-setup.sh => run-test-stack.sh} | 19 +++++------- 2 files changed, 26 insertions(+), 22 deletions(-) rename scripts/{integration-setup.sh => run-test-stack.sh} (56%) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index d302e68..c06fc12 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -10,6 +10,7 @@ on: env: SO_VERSION: v1.1.0-87fffca-202404110321 + FIXTURENET_ETH_STACKS_VERSION: plugeth-stack jobs: unit-tests: @@ -31,34 +32,42 @@ jobs: name: Run integration tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: ./plugeth-statediff + progress: false - name: Build docker image run: | docker build ./plugeth-statediff -t cerc/plugeth-statediff:local + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 - name: Install stack-orchestrator run: | curl -L -O https://github.com/cerc-io/stack-orchestrator/releases/download/$SO_VERSION/laconic-so chmod +x laconic-so + echo PATH="$PATH:$(pwd)" >> $GITHUB_ENV - name: Clone system-tests - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: cerc-io/system-tests ref: v0.1.0-20240411 path: ./system-tests token: ${{ secrets.CICD_REPO_TOKEN }} + progress: false + - name: Clone fixturenet stack repo + uses: actions/checkout@v4 + with: + repository: cerc-io/fixturenet-eth-stacks + ref: ${{ env.FIXTURENET_ETH_STACKS_VERSION }} + path: ./fixturenet-eth-stacks + progress: false - name: Run testnet stack working-directory: ./plugeth-statediff - env: - LACONIC_SO: ../laconic-so - run: ./scripts/integration-setup.sh - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - + run: | + ./scripts/run-test-stack.sh ../fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth - name: Run tests working-directory: ./system-tests run: | diff --git a/scripts/integration-setup.sh b/scripts/run-test-stack.sh similarity index 56% rename from scripts/integration-setup.sh rename to scripts/run-test-stack.sh index f370a6e..f67ef16 100755 --- a/scripts/integration-setup.sh +++ b/scripts/run-test-stack.sh @@ -1,26 +1,21 @@ #!/bin/bash -# Builds and deploys a stack with only what we need. -# This script assumes we are running in the project root. -set -e +set -ex -STACK_URL="git.vdb.to/cerc-io/fixturenet-eth-stacks" +[[ -d "$1" ]] CONFIG_DIR=$(readlink -f "${CONFIG_DIR:-$(mktemp -d)}") +# By default assume we are running in the project root. export CERC_REPO_BASE_DIR="${CERC_REPO_BASE_DIR:-$(git rev-parse --show-toplevel)/..}" -laconic-so --verbose fetch-stack "$STACK_URL" -stack_dir=$CERC_REPO_BASE_DIR/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth -git -C $stack_dir checkout origin/plugeth-stack - # Note: stack path should be absolute, otherwise SO looks for it in packaged stacks -laconic_so="laconic-so --stack $stack_dir --verbose" +stack_dir=$(readlink -f "$1") -echo CERC_STATEDIFF_DB_GOOSE_MIN_VER=21 >> $CONFIG_DIR/stack.env -# don't run plugeth in the debugger +laconic_so="laconic-so --verbose --stack $stack_dir" + +# Don't run geth/plugeth in the debugger, it will swallow error backtraces echo CERC_REMOTE_DEBUG=false >> $CONFIG_DIR/stack.env -set -x if [[ -z $SKIP_BUILD ]]; then $laconic_so setup-repositories \