Skip to content

Instantly share code, notes, and snippets.

@bradjones1
Created March 10, 2016 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradjones1/782ec8283d963a2b5511 to your computer and use it in GitHub Desktop.
Save bradjones1/782ec8283d963a2b5511 to your computer and use it in GitHub Desktop.
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