diff --git a/commands/mkdocs/mkdocs b/commands/mkdocs/mkdocs index 4e2f7df..ee8686e 100644 --- a/commands/mkdocs/mkdocs +++ b/commands/mkdocs/mkdocs @@ -1,5 +1,4 @@ -#!/bin/bash - +#!/bin/sh #ddev-generated ## Description: Run mkdocs commands @@ -7,9 +6,9 @@ ## Example: "ddev mkdocs build" ## ExecRaw: true -if [ "$1" == "serve" ]; then +if [ "$1" = "serve" ]; then echo "This does not work for mkdocs in ddev" exit 1 fi -mkdocs "${@:1}" +mkdocs "${@}" diff --git a/tests/test.bats b/tests/test.bats index 6ace307..812efbd 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -8,26 +8,36 @@ setup() { ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true cd "${TESTDIR}" ddev config --project-name=${PROJNAME} + ddev get metadrop/ddev-aljibe ddev start -y >/dev/null + ddev aljibe-assistant --auto } health_checks() { + echo "Checking mkdocs health" >&3 ddev exec wget http://mkdocs:8080 -q -O - | grep Welcome | grep -m1 "Welcome to Mkdocs" } -teardown() { +check_build_mkdocs() { + echo "Checking mkdocs build" >&3 + ddev mkdocs build +} + +t() { 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} } -@test "install from release" { +@test "Install from folder" { set -eu -o pipefail - cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) - echo "# ddev get metadrop/ddev-mkdocs with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 - ddev get metadrop/ddev-mkdocs - ddev restart >/dev/null + cd ${TESTDIR} + echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 + ddev get ${DIR} + echo "Installed add-on from directory, restarting ddev" >&3 + ddev restart + echo "Testing mkdocs" >&3 health_checks -} - + check_build_mkdocs +} \ No newline at end of file