diff --git a/test/Makefile b/test/Makefile index 742322d0..f57e5640 100644 --- a/test/Makefile +++ b/test/Makefile @@ -25,12 +25,12 @@ generate-mocks-da: ## Generates mocks for dataavailability, using mockery tool .PHONY: test-e2e-elderberry-validium test-e2e-elderberry-validium: stop ## Runs e2e tests checking elderberry/validium ./run-e2e.sh cdk-validium - bats test/bridge-e2e.bats + bats test .PHONY: test-e2e-elderberry-rollup test-e2e-elderberry-rollup: stop ## Runs e2e tests checking elderberry/rollup ./run-e2e.sh rollup - bats test/bridge-e2e.bats + bats test .PHONY: stop stop: diff --git a/test/bridge-e2e.bats b/test/bridge-e2e.bats index 184d7ec3..6841b8b7 100644 --- a/test/bridge-e2e.bats +++ b/test/bridge-e2e.bats @@ -1,15 +1,8 @@ setup() { - bats_load_library 'bats-support' - bats_load_library 'bats-assert' + load 'helpers/common-setup' + _common_setup - # get the containing directory of this file - # use $BATS_TEST_FILENAME instead of ${BASH_SOURCE[0]} or $0, - # as those will point to the bats executable's location or the preprocessed file respectively - DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )" - # make executables in src/ visible to PATH - PATH="$DIR/../src:$PATH" - - $DIR/scripts/kurtosis_prepare_params_yml.sh ../kurtosis-cdk cdk-validium + $PROJECT_ROOT/test/scripts/kurtosis_prepare_params_yml.sh ../kurtosis-cdk cdk-validium # Check if the genesis file is already downloaded if [ ! -f "./tmp/cdk/genesis/genesis.json" ]; then diff --git a/test/e2e.bats b/test/e2e.bats new file mode 100644 index 00000000..c85e33ce --- /dev/null +++ b/test/e2e.bats @@ -0,0 +1,10 @@ +setup() { + load 'helpers/common-setup' + _common_setup +} + +@test "Verify batches" { + echo "Waiting 10 minutes to get some verified batch...." + run $PROJECT_ROOT/test/scripts/batch_verification_monitor.sh 0 600 + assert_success +} diff --git a/test/helpers/common-setup.bash b/test/helpers/common-setup.bash new file mode 100644 index 00000000..b7691366 --- /dev/null +++ b/test/helpers/common-setup.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +_common_setup() { + bats_load_library 'bats-support' + bats_load_library 'bats-assert' + + # get the containing directory of this file + # use $BATS_TEST_FILENAME instead of ${BASH_SOURCE[0]} or $0, + # as those will point to the bats executable's location or the preprocessed file respectively + PROJECT_ROOT="$( cd "$( dirname "$BATS_TEST_FILENAME" )/.." >/dev/null 2>&1 && pwd )" + # make executables in src/ visible to PATH + PATH="$PROJECT_ROOT/src:$PATH" +} diff --git a/test/run-e2e.sh b/test/run-e2e.sh index a0db5d56..0dfb9d19 100755 --- a/test/run-e2e.sh +++ b/test/run-e2e.sh @@ -23,6 +23,3 @@ $BASE_FOLDER/scripts/kurtosis_prepare_params_yml.sh "$KURTOSIS_FOLDER" "elderber 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 -echo "Waiting 10 minutes to get some verified batch...." -scripts/batch_verification_monitor.sh 0 600