Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ddev add-on command #41

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ collector_checks() {
set -eu -o pipefail
cd ${TESTDIR}
ddev config --project-name=${PROJNAME}
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev add-on get ${DIR}
ddev restart

# Check service works
Expand All @@ -62,8 +62,8 @@ collector_checks() {
set -eu -o pipefail
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
ddev config --project-name=${PROJNAME}
echo "# ddev get ddev/ddev-xhgui with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ddev/ddev-xhgui
echo "# ddev add-on get ddev/ddev-xhgui with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev add-on get ddev/ddev-xhgui
ddev restart

# Check service works
Expand All @@ -84,8 +84,8 @@ require_once __DIR__ . '/../vendor/autoload.php';
require_once '/mnt/ddev_config/xhgui/collector/xhgui.collector.php';
echo 'Demo website';" >${TESTDIR}/public/index.php

echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev add-on get ${DIR}
ddev restart

# Check service works
Expand All @@ -94,7 +94,7 @@ echo 'Demo website';" >${TESTDIR}/public/index.php

# Check it removes database on uninstall. 'mysql "name"' returns 1 if db exists, 0 if missing.
ddev mysql "xhgui" -e exit > /dev/null 2>&1 && echo "Database exists." | grep "exists"
ddev get --remove ${DIR}
ddev add-on remove ${DIR}
ddev mysql "xhgui" -e exit > /dev/null 2>&1 && echo "Database exists." || echo "Database missing" | grep "missing"
}

Expand All @@ -112,8 +112,8 @@ require_once __DIR__ . '/../vendor/autoload.php';
require_once '/mnt/ddev_config/xhgui/collector/xhgui.collector.php';
echo 'Demo website';" >${TESTDIR}/public/index.php

echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev add-on get ${DIR}
ddev restart

# Check service works
Expand All @@ -122,7 +122,7 @@ echo 'Demo website';" >${TESTDIR}/public/index.php

# Check it removes database on uninstall. 'mysql "name"' returns 1 if db exists, 0 if missing.
ddev mysql "xhgui" -e exit > /dev/null 2>&1 && echo "Database exists." | grep "exists"
ddev get --remove ${DIR}
ddev add-on remove ${DIR}
ddev mysql "xhgui" -e exit > /dev/null 2>&1 && echo "Database exists." || echo "Database missing" | grep "missing"
}

Expand All @@ -140,8 +140,8 @@ require_once __DIR__ . '/../vendor/autoload.php';
require_once '/mnt/ddev_config/xhgui/collector/xhgui.collector.php';
echo 'Demo website';" >${TESTDIR}/public/index.php

echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev add-on get ${DIR}
ddev restart

# Check service works
Expand All @@ -150,16 +150,16 @@ echo 'Demo website';" >${TESTDIR}/public/index.php

# Check it removes database on uninstall. `psql "xhgui" -c '\q'` returns 1 if db exists, 0 if missing.
ddev psql "xhgui" -c '\q' > /dev/null 2>&1 && echo "Database exists." | grep "exists"
ddev get --remove ${DIR}
ddev add-on remove ${DIR}
ddev psql "xhgui" -c '\q' > /dev/null 2>&1 && echo "Database exists." || echo "Database missing" | grep "missing"
}

@test "install from directory with nonstandard port" {
set -eu -o pipefail
cd ${TESTDIR}
ddev config --project-name=${PROJNAME} --router-http-port=8080 --router-https-port=8443
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
echo "# ddev add-on get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev add-on get ${DIR}
ddev restart

# Check service works
Expand Down