Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drupal 8 unit test script
#!/usr/bin/env bash
# see https://github.com/docker/compose/issues/374#issuecomment-174506025
set -e
echoerr() { echo "$@" 1>&2; }
echoerr wait-for-port: waiting for port 80 to open
((TIMEOUT=60*15))
timeout $TIMEOUT bash <<EOT
while ! (echo > /dev/tcp/localhost/80) >/dev/null 2>&1;
do sleep 1;
done;
EOT
RESULT=$?
if [ $RESULT -eq 0 ]; then
sleep 1
echoerr wait-for-port: done
else
echoerr wait-for-port: timeout waiting for webserver to start.
fi
export SIMPLETEST_DB=sqlite://localhost//dev/shm/sqlite.ci
cd ~www-data/html/web/core
../../vendor/bin/phpunit --filter '/^((?!simpletest\\Functional).)*$/' --colors=never
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment