Skip to content

Commit

Permalink
Working basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Mar 17, 2022
1 parent dc73ba4 commit 3eb20ce
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions tests/test.bats
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
setup() {
export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.."
export TESTDIR=$(mktemp -d -t testelasticsearch-XXXXXXXXXX)
export TESTDIR=~/tmp/testelasticsearch
mkdir -p $TESTDIR
export PROJNAME=testelasticsearch
export DDEV_NON_INTERACTIVE=true
ddev delete -Oy ${PROJNAME} || true
cd "${TESTDIR}"
ddev config global --simple-formatting
ddev config --project-name=${PROJNAME} --project-type=php
ddev start -y
}
Expand All @@ -16,19 +18,9 @@ teardown() {
}

@test "basic installation" {
cd ${TESTDIR}
ddev config global --simple-formatting
ddev list
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get ${DIR}
ddev restart
ddev exec "curl -s http://elasticsearch:9200"
# v=$(ddev exec 'printf "version\nquit\nquit\n" | nc memcached 11211')
# [[ "${v}" = VERSION* ]]
# res=$(ddev exec 'printf "list-tubes\nquit\n" | nc -C beanstalkd 11300')
# [[ "${res}" = OK* ]]
# status=$(ddev exec 'drush sapi-sl --format=json | jq -r .default_solr_server.status')
# [ "${status}" = "enabled" ]
# sleep 10 # After a restart, the solr server may not be ready yet.
# ddev drush search-api-solr:reload default_solr_server

ddev exec "curl -s elasticsearch:9200" | grep "${PROJNAME}-elasticsearch"
}

0 comments on commit 3eb20ce

Please sign in to comment.