Skip to content

Commit

Permalink
common setup and custom log
Browse files Browse the repository at this point in the history
  • Loading branch information
andrevtg committed Aug 27, 2021
1 parent d2c4cb3 commit 1a61127
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions vkpr-test/common-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

_common_setup() {
if [ "$VKPR_TEST_SKIP_SETUP" == "true" ]; then
echo "skipping common-setup due to VKPR_TEST_SKIP_SETUP=true"
echo "common_setup: skipping common-setup due to VKPR_TEST_SKIP_SETUP=true" >&3
else
echo "running cluster and installing ingress...."
rit vkpr infra up
if [ "$(k3d cluster list --no-headers | grep 'vkpr-local' | awk '{print $1}')" == "vkpr-local" ]; then
echo "common_setup: vkpr cluster already created, skipping...." >&3
else
echo "common_setup: running vkpr cluster...." >&3
rit vkpr infra up
fi
fi
}
8 changes: 4 additions & 4 deletions vkpr-test/ingress-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ setup_file() {
load 'common-setup'
_common_setup
if [ "$VKPR_TEST_SKIP_SETUP" == "true" ]; then
echo "skipping setup due to VKPR_TEST_SKIP_SETUP=true"
echo "setup: skipping setup due to VKPR_TEST_SKIP_SETUP=true" >&3
else
echo "installing ingress...."
echo "setup: installing ingress...." >&3
rit vkpr ingress install
kubectl wait --for=condition=ready --timeout=1m pod --all
sleep 2
Expand Down Expand Up @@ -44,9 +44,9 @@ setup() {

teardown_file() {
if [ "$VKPR_TEST_SKIP_TEARDOWN" == "true" ]; then
echo "skipping teardown due to VKPR_TEST_SKIP_TEARDOWN=true"
echo "teardown: skipping teardown due to VKPR_TEST_SKIP_TEARDOWN=true" >&3
else
echo "uninstalling ingress...."
echo "teardown: uninstalling ingress...." >&3
rit vkpr ingress remove
rit vkpr infra down
fi
Expand Down

0 comments on commit 1a61127

Please sign in to comment.