-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0634c2
commit fc95005
Showing
9 changed files
with
179 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
name: Test e2e | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
- update-external-dependencies | ||
- 'release/**' | ||
pull_request: | ||
|
||
jobs: | ||
test-e2e: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: [ 1.21.x ] | ||
goarch: [ "amd64" ] | ||
e2e-group: [ "elderberry-validium", "elderberry-rollup" ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
env: | ||
GOARCH: ${{ matrix.goarch }} | ||
|
||
- name: Build Docker | ||
run: make build-docker | ||
|
||
|
||
|
||
- name: Test | ||
run: make test-e2e-${{ matrix.e2e-group }} | ||
working-directory: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.PHONY: test-e2e-elderberry-validium | ||
test-e2e-elderberry-validium: stop ## Runs e2e tests checking elderberry/validium | ||
./run-e2e-seq_sender.sh cdk-validium | ||
|
||
.PHONY: test-e2e-elderberry-rollup | ||
test-e2e-elderberry-rollup: stop ## Runs e2e tests checking elderberry/rollup | ||
./run-e2e-seq_sender.sh rollup | ||
|
||
.PHONY: stop | ||
stop: | ||
kurtosis clean --all | ||
|
||
|
||
## Help display. | ||
## Pulls comments from beside commands and prints a nicely formatted | ||
## display with the commands and their usage information. | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: help | ||
help: ## Prints this help | ||
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ | ||
| sort \ | ||
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
source $(dirname $0)/scripts/env.sh | ||
FORK=elderberry | ||
DATA_AVAILABILITY_MODE=$1 | ||
if [ -z $DATA_AVAILABILITY_MODE ]; then | ||
echo "Missing DATA_AVAILABILITY_MODE: ['rollup', 'cdk-validium']" | ||
exit 1 | ||
fi | ||
KURTOSIS_VERSION=jesteban/cdk-seq_sender | ||
BASE_FOLDER=$(dirname $0) | ||
KURTOSIS_FOLDER=$($BASE_FOLDER/scripts/get_kurtosis_clone_folder.sh $KURTOSIS_VERSION) | ||
[ $? -ne 0 ] && echo "Error getting kurtosis folder" && exit 1 | ||
|
||
$BASE_FOLDER/scripts/clone_kurtosis.sh $KURTOSIS_VERSION "$KURTOSIS_FOLDER" | ||
[ $? -ne 0 ] && echo "Error cloning kurtosis " && exit 1 | ||
|
||
docker images -q cdk:latest > /dev/null | ||
if [ $? -ne 0 ] ; then | ||
echo "Building cdk:latest" | ||
pushd $BASE_FOLDER/.. | ||
make build-docker | ||
popd | ||
else | ||
echo "docker cdk:latest already exists" | ||
fi | ||
|
||
$BASE_FOLDER/scripts/kurtosis_prepare_params_yml.sh "$KURTOSIS_FOLDER" "elderberry" "cdk-validium" | ||
[ $? -ne 0 ] && echo "Error preparing params.yml" && exit 1 | ||
|
||
kurtosis clean --all | ||
kurtosis run --enclave cdk-v1 --args-file $DEST_KURTOSIS_PARAMS_YML --image-download always $KURTOSIS_FOLDER | ||
[ $? -ne 0 ] && echo "Error running kurtosis" && exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
source $(dirname $0)/env.sh | ||
|
||
usage() { | ||
echo "Usage: $0 <kurtosis_version> <dest_folder>" | ||
echo "Clones kurtosis-cdk version <kurtosis_version> to folder <dest_folder>" | ||
} | ||
|
||
KURTOSIS_CDK_URL="[email protected]:0xPolygon/kurtosis-cdk.git" | ||
KURTOSIS_VERSION=$1 | ||
if [ -z $KURTOSIS_VERSION ]; then | ||
echo "Missing param KURTOSIS_VERSION" | ||
usage | ||
exit 1 | ||
fi | ||
DEST_FOLDER="$2" | ||
if [ -z $DEST_FOLDER ]; then | ||
echo "Missing param Destination Folder" | ||
usage | ||
exit 1 | ||
fi | ||
if [ -d $DEST_FOLDER ]; then | ||
echo "Folder $DEST_FOLDER already exists. No cloning needed" | ||
pushd $DEST_FOLDER > /dev/null | ||
echo "Pulling latest changes" | ||
git pull | ||
popd > /dev/null | ||
exit 0 | ||
fi | ||
echo "Cloning kurtosis-cdk version $KURTOSIS_VERSION to folder $DEST_FOLDER" | ||
git clone --depth=1 $KURTOSIS_CDK_URL -b "$KURTOSIS_VERSION" "$DEST_FOLDER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
### Common variables | ||
ENCLAVE=cdk-v1 | ||
TMP_CDK_FOLDER=/tmp/cdk | ||
DEST_KURTOSIS_PARAMS_YML=$TMP_CDK_FOLDER/e2e-params.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
source $(dirname $0)/env.sh | ||
|
||
KURTOSIS_VERSION=$1 | ||
if [ -z $KURTOSIS_VERSION ]; then | ||
echo "KURTOSIS_VERSION is not set. Must be set on file env.sh" | ||
exit 1 | ||
fi | ||
KURTOSIS_VERSION_FOLDER_NAME=$(echo $KURTOSIS_VERSION | tr -c '[:alnum:]._-' '_') | ||
DEST_FOLDER=$TMP_CDK_FOLDER/kurtosis-cdk-$KURTOSIS_VERSION_FOLDER_NAME | ||
echo $DEST_FOLDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
source $(dirname $0)/env.sh | ||
|
||
if [ -z $DEST_KURTOSIS_PARAMS_YML ]; then | ||
echo "DEST_KURTOSIS_PARAMS_YML is not set. Must be set on file env.sh" | ||
exit 1 | ||
fi | ||
|
||
KURTOSIS_FOLDER=$1 | ||
if [ -z $KURTOSIS_FOLDER ]; then | ||
echo "Missing param Kurtosis Folder" | ||
exit 1 | ||
fi | ||
|
||
FORK_NAME=$2 | ||
if [ -z $FORK_NAME ]; then | ||
echo "Missing param Fork Name" | ||
exit 1 | ||
fi | ||
DATA_AVAILABILITY_MODE=$3 | ||
if [ -z $DATA_AVAILABILITY_MODE ]; then | ||
echo "Missing param Data Availability Mode : [rollup, cdk-validium]" | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
|
||
cp $KURTOSIS_FOLDER/cdk-erigon-sequencer-params.yml $DEST_KURTOSIS_PARAMS_YML | ||
yq -Y --in-place ".args.data_availability_mode = \"$DATA_AVAILABILITY_MODE\"" $DEST_KURTOSIS_PARAMS_YML | ||
yq -Y --in-place ".args.zkevm_sequence_sender_image = \"cdk:latest\"" $DEST_KURTOSIS_PARAMS_YML | ||
yq -Y --in-place ".args.sequencer_type = \"erigon\"" $DEST_KURTOSIS_PARAMS_YML | ||
yq -Y --in-place ".args.deploy_cdk_erigon_node = true" $DEST_KURTOSIS_PARAMS_YML | ||
yq -Y --in-place ".args.sequencer_type = \"erigon\"" $DEST_KURTOSIS_PARAMS_YML | ||
yq -Y --in-place ".args.sequencer_sender_type = \"cdk\"" $DEST_KURTOSIS_PARAMS_YML |