Skip to content

Commit

Permalink
test: better
Browse files Browse the repository at this point in the history
  • Loading branch information
vcastellm committed Sep 10, 2024
1 parent 8b57644 commit 702165f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
4 changes: 2 additions & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 3 additions & 10 deletions test/bridge-e2e.bats
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions test/e2e.bats
Original file line number Diff line number Diff line change
@@ -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
}
13 changes: 13 additions & 0 deletions test/helpers/common-setup.bash
Original file line number Diff line number Diff line change
@@ -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"
}
3 changes: 0 additions & 3 deletions test/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 702165f

Please sign in to comment.