Skip to content

Commit

Permalink
refactor: simplify running Kurtosis combinations (#101)
Browse files Browse the repository at this point in the history
Using a set of pre-defined combinations of components,
we're going to test the versions we're interested in.
  • Loading branch information
vcastellm authored Oct 2, 2024
1 parent ac5c318 commit 749ceb8
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:
matrix:
go-version: [ 1.22.x ]
goarch: [ "amd64" ]
e2e-group: [ "elderberry-validium", "elderberry-rollup" ]
e2e-group:
- "fork9-validium"
- "fork9-rollup"
- "fork12-validium"
- "fork12-rollup"
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -35,7 +39,7 @@ jobs:
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli=0.90.1
sudo apt install kurtosis-cli=1.3.0
kurtosis version
- name: Disable kurtosis analytics
Expand Down
2 changes: 1 addition & 1 deletion scripts/local_config
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function check_requirements(){
cat << EOF
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt install kurtosis-cli=0.90.1
sudo apt install kurtosis-cli
kurtosis version
EOF
exit 1
Expand Down
22 changes: 16 additions & 6 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,24 @@ generate-mocks-sync: ## Generates mocks for sync, using mockery tool
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ReorgDetector --dir=../sync --output=../sync --outpkg=sync --inpackage --structname=ReorgDetectorMock --filename=mock_reorgdetector_test.go


.PHONY: test-e2e-elderberry-validium
test-e2e-elderberry-validium: stop ## Runs e2e tests checking elderberry/validium
./run-e2e.sh cdk-validium
.PHONY: test-e2e-fork9-validium
test-e2e-fork9-validium: stop
./run-e2e.sh fork9 cdk-validium
bats .

.PHONY: test-e2e-elderberry-rollup
test-e2e-elderberry-rollup: stop ## Runs e2e tests checking elderberry/rollup
./run-e2e.sh rollup
.PHONY: test-e2e-fork9-rollup
test-e2e-fork9-rollup: stop
./run-e2e.sh fork9 rollup
bats .

.PHONY: test-e2e-fork12-validium
test-e2e-fork12-validium: stop
./run-e2e.sh fork12 cdk-validium
bats .

.PHONY: test-e2e-fork12-rollup
test-e2e-fork12-rollup: stop
./run-e2e.sh fork12 rollup
bats .

.PHONY: stop
Expand Down
4 changes: 0 additions & 4 deletions test/bridge-e2e.bats
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ setup() {
load 'helpers/common'
load 'helpers/lxly-bridge-test'

readonly data_availability_mode=${DATA_AVAILABILITY_MODE:-"cdk-validium"}
$PROJECT_ROOT/test/scripts/kurtosis_prepare_params_yml.sh ../kurtosis-cdk $data_availability_mode
[ $? -ne 0 ] && echo "Error preparing params.yml" && exit 1

if [ -z "$BRIDGE_ADDRESS" ]; then
local combined_json_file="/opt/zkevm/combined.json"
echo "BRIDGE_ADDRESS env variable is not provided, resolving the bridge address from the Kurtosis CDK '$combined_json_file'" >&3
Expand Down
9 changes: 9 additions & 0 deletions test/combinations/fork12-cdk-validium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
args:
zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.3-fork.12
zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC10-fork.12
cdk_node_image: cdk
zkevm_use_gas_token_contract: true
additional_services:
- tx_spammer
data_availability_mode: cdk-validium
sequencer_type: erigon
9 changes: 9 additions & 0 deletions test/combinations/fork12-rollup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
args:
zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.3-fork.12
zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC10-fork.12
cdk_node_image: cdk
zkevm_use_gas_token_contract: true
additional_services:
- tx_spammer
data_availability_mode: rollup
sequencer_type: erigon
12 changes: 12 additions & 0 deletions test/combinations/fork9-cdk-validium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
args:
zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9
zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.4
zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1
cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk
cdk_node_image: cdk
zkevm_use_gas_token_contract: true
additional_services:
- pless_zkevm_node
- tx_spammer
data_availability_mode: cdk-validium
sequencer_type: erigon
12 changes: 12 additions & 0 deletions test/combinations/fork9-rollup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
args:
zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9
zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.4
zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1
cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk
cdk_node_image: cdk
zkevm_use_gas_token_contract: true
additional_services:
- pless_zkevm_node
- tx_spammer
data_availability_mode: rollup
sequencer_type: erigon
17 changes: 10 additions & 7 deletions test/run-e2e.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/bin/bash
source $(dirname $0)/scripts/env.sh
FORK=elderberry
DATA_AVAILABILITY_MODE=$1

FORK=$1
if [ -z $FORK ]; then
echo "Missing FORK: ['fork9', 'fork12']"
exit 1
fi

DATA_AVAILABILITY_MODE=$2
if [ -z $DATA_AVAILABILITY_MODE ]; then
echo "Missing DATA_AVAILABILITY_MODE: ['rollup', 'cdk-validium']"
exit 1
fi
BASE_FOLDER=$(dirname $0)

BASE_FOLDER=$(dirname $0)
docker images -q cdk:latest > /dev/null
if [ $? -ne 0 ] ; then
echo "Building cdk:latest"
Expand All @@ -18,10 +24,7 @@ else
echo "docker cdk:latest already exists"
fi

$BASE_FOLDER/scripts/kurtosis_prepare_params_yml.sh "$KURTOSIS_FOLDER" $DATA_AVAILABILITY_MODE
[ $? -ne 0 ] && echo "Error preparing params.yml" && exit 1

kurtosis clean --all
echo "Override cdk config file"
cp $BASE_FOLDER/config/kurtosis-cdk-node-config.toml.template $KURTOSIS_FOLDER/templates/trusted-node/cdk-node-config.toml
kurtosis run --enclave cdk-v1 --args-file $DEST_KURTOSIS_PARAMS_YML --image-download always $KURTOSIS_FOLDER
kurtosis run --enclave cdk-v1 --args-file "combinations/$FORK-$DATA_AVAILABILITY_MODE.yml" --image-download always $KURTOSIS_FOLDER
31 changes: 0 additions & 31 deletions test/scripts/kurtosis_prepare_params_yml.sh

This file was deleted.

0 comments on commit 749ceb8

Please sign in to comment.