Skip to content

Commit

Permalink
Fix tests a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
catch committed Nov 23, 2023
1 parent e3f66d1 commit 432e1e8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test.bats
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
setup() {
set -eu -o pipefail
export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.."
export TESTDIR=~/tmp/test-addon-template
export TESTDIR=~/tmp/test-gander
mkdir -p $TESTDIR
export PROJNAME=test-addon-template
export PROJNAME=test-gander
export DDEV_NON_INTERACTIVE=true
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true
cd "${TESTDIR}"
Expand All @@ -13,15 +13,14 @@ setup() {

health_checks() {
# Do something useful here that verifies the add-on
# ddev exec "curl -s elasticsearch:9200" | grep "${PROJNAME}-elasticsearch"
ddev exec "curl -s https://localhost:443/"
ddev exec "curl -s grafana:3000 | grep grafana | wc -l"
}

teardown() {
set -eu -o pipefail
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR}
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} >/dev/null 2>&1 || exit 1
}

@test "install from directory" {
Expand All @@ -36,8 +35,8 @@ teardown() {
@test "install from release" {
set -eu -o pipefail
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
echo "# ddev get ddev/ddev-addon-template with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ddev/ddev-addon-template
echo "# ddev get ddev/ddev-gander with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ddev/ddev-gander
ddev restart >/dev/null
health_checks
}
Expand Down

0 comments on commit 432e1e8

Please sign in to comment.