Skip to content

Commit

Permalink
Added tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
penyaskito committed Jan 13, 2025
1 parent 7f48c48 commit 6ff31dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 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-authentik
mkdir -p $TESTDIR
export PROJNAME=test-addon-template
export PROJNAME=test-authentik
export DDEV_NON_INTERACTIVE=true
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true
cd "${TESTDIR}"
Expand All @@ -14,7 +14,7 @@ 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 -sI authentik:9000" | grep -i "Location: /flows/-/default/authentication/?next=/" > /dev/null || (echo "# Authentik not detected" >&2 && exit 1);
}

teardown() {
Expand All @@ -36,8 +36,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 penyaskito/ddev-authentik with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get penyaskito/ddev-authentik
ddev restart >/dev/null
health_checks
}
Expand Down

0 comments on commit 6ff31dd

Please sign in to comment.