From f62ad8e131516b23760f79247f4bf0e4c569c82b Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 25 Jul 2024 21:09:34 +0800 Subject: [PATCH] [wip] use external fixturenet stack --- .gitea/workflows/test.yml | 10 +++++++++- scripts/integration-setup.sh | 27 --------------------------- scripts/run-test-stack.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 28 deletions(-) delete mode 100755 scripts/integration-setup.sh create mode 100755 scripts/run-test-stack.sh diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index add588c..98c648a 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -11,6 +11,7 @@ on: env: SO_VERSION: roysc/fix-eth-stacks SYSTEM_TESTS_REF: roysc/test-blob-tx + FIXTURENET_ETH_STACKS_REF: main jobs: test-beacon-collector: @@ -47,9 +48,16 @@ jobs: - name: "Install pytest" working-directory: ./system-tests run: pip3 install pytest + - name: "Clone fixturenet stack repo" + uses: actions/checkout@v4 + with: + repository: cerc-io/fixturenet-eth-stacks + ref: ${{ env.FIXTURENET_ETH_STACKS_REF }} + path: ./fixturenet-eth-stacks + progress: false - name: "Run fixturenet stack" - run: ./scripts/integration-setup.sh + run: ./scripts/run-test-stack.sh ./fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth - name: "Run server" run: docker compose -f test/compose.yml up --wait --quiet-pull - name: "Run tests" diff --git a/scripts/integration-setup.sh b/scripts/integration-setup.sh deleted file mode 100755 index 8b5d4f1..0000000 --- a/scripts/integration-setup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Builds and deploys a stack with only what we need. -# This script assumes it is running in the project root. - -set -e - -laconic_so="${LACONIC_SO:-laconic-so} --stack $(readlink -f test) --verbose" -config_dir=$(readlink -f "${CONFIG_DIR:-$(mktemp -d)}") - -# Prevent conflicting tty output -export BUILDKIT_PROGRESS=plain - -# By default assume we are running in the project root -export CERC_REPO_BASE_DIR="${CERC_REPO_BASE_DIR:-..}" -# The debugger can swallow error messages on panic -echo CERC_REMOTE_DEBUG=false >> $config_dir/stack.env - -set -x - -if [[ -z $SKIP_BUILD ]]; then - $laconic_so setup-repositories - $laconic_so build-containers -fi - -$laconic_so deploy \ - --env-file $config_dir/stack.env \ - --cluster test up diff --git a/scripts/run-test-stack.sh b/scripts/run-test-stack.sh new file mode 100755 index 0000000..d5869da --- /dev/null +++ b/scripts/run-test-stack.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e + +stack_dir=$(readlink -f "$1") +[[ -d "$stack_dir" ]] + +laconic_so="laconic-so --verbose --stack $stack_dir" + +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)/..}" + +# 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 + # Prevent conflicting tty output + export BUILDKIT_PROGRESS=plain + + $laconic_so setup-repositories + $laconic_so build-containers +fi + +if ! $laconic_so deploy \ + --env-file $CONFIG_DIR/stack.env \ + --cluster test up +then + $laconic_so deploy --cluster test logs + exit 1 +fi