Skip to content

Commit

Permalink
fix: bats submodule files
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Aug 7, 2023
1 parent d229e8c commit b190fa3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "charts/hedera-network/tests/bats"]
path = dev/tests/bats
path = charts/hedera-network/tests/bats
url = https://github.com/bats-core/bats-core.git
[submodule "dev/tests/test_helper/bats-support"]
[submodule "charts/hedera-network/tests/test_helper/bats-support"]
path = charts/hedera-network/tests/test_helper/bats-support
url = https://github.com/bats-core/bats-support.git
[submodule "dev/tests/test_helper/bats-assert"]
[submodule "charts/hedera-network/tests/test_helper/bats-assert"]
path = charts/hedera-network/tests/test_helper/bats-assert
url = https://github.com/bats-core/bats-assert.git
1 change: 1 addition & 0 deletions charts/hedera-network/tests/bats
Submodule bats added at fb7d15
1 change: 1 addition & 0 deletions charts/hedera-network/tests/test_helper/bats-assert
Submodule bats-assert added at 42e4d8
1 change: 1 addition & 0 deletions charts/hedera-network/tests/test_helper/bats-support
Submodule bats-support added at 3c8fad
25 changes: 25 additions & 0 deletions charts/hedera-network/tests/test_helper/common-setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

_common_setup() {
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
# 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/scripts:$PATH"

# setup TEST_SCRIPTS
SCRIPT_DIR="${PROJECT_ROOT}/scripts"

# load test functions
source "$SCRIPT_DIR/include.sh"
}

# This is to check the bats test execution status
check_test_status() {
echo "status = ${status}"
echo "output = ${output}"
[[ "${status}" -eq 0 ]]
}

0 comments on commit b190fa3

Please sign in to comment.