diff --git a/5.6/Dockerfile b/5.6/Dockerfile index 6e87e9fd..9cb4e882 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -213,8 +213,6 @@ RUN set -xe; \ redis \ ssh2 \ ;\ - # Disable xdebug by default - rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \ # Cleanup docker-php-source delete; \ rm -rf /tmp/pear ~/.pearrc; \ diff --git a/7.0/Dockerfile b/7.0/Dockerfile index fdca3b39..c8c040bf 100644 --- a/7.0/Dockerfile +++ b/7.0/Dockerfile @@ -163,7 +163,7 @@ RUN set -xe; \ libzip4 \ msodbcsql17 \ ;\ - # SSH2 must be installed from source + # SSH2 must be installed from source for PHP 7.x git clone https://github.com/php/pecl-networking-ssh2.git /usr/src/php/ext/ssh2 && rm -rf /usr/src/php/ext/ssh2/.git; \ \ docker-php-ext-configure >/dev/null gd \ @@ -221,8 +221,6 @@ RUN set -xe; \ redis \ sqlsrv \ ;\ - # Disable xdebug by default - rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \ # Cleanup docker-php-source delete; \ rm -rf /tmp/pear ~/.pearrc; \ diff --git a/7.1/Dockerfile b/7.1/Dockerfile index 8c9e8379..48b7dd24 100644 --- a/7.1/Dockerfile +++ b/7.1/Dockerfile @@ -163,7 +163,7 @@ RUN set -xe; \ libzip4 \ msodbcsql17 \ ;\ - # SSH2 must be installed from source + # SSH2 must be installed from source for PHP 7.x git clone https://github.com/php/pecl-networking-ssh2.git /usr/src/php/ext/ssh2 && rm -rf /usr/src/php/ext/ssh2/.git; \ \ docker-php-ext-configure >/dev/null gd \ @@ -187,6 +187,7 @@ RUN set -xe; \ imap \ intl \ ldap \ + # mcrypt is deprecated in 7.1 and removed in 7.2. See Deprecated features. mcrypt \ mysqli \ opcache \ @@ -221,8 +222,6 @@ RUN set -xe; \ redis \ sqlsrv \ ;\ - # Disable xdebug by default - rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \ # Cleanup docker-php-source delete; \ rm -rf /tmp/pear ~/.pearrc; \ diff --git a/7.2/Dockerfile b/7.2/Dockerfile index a8a37fc7..f2f53672 100644 --- a/7.2/Dockerfile +++ b/7.2/Dockerfile @@ -125,7 +125,6 @@ RUN set -xe; \ libldap2-dev \ libmagickcore-dev \ libmagickwand-dev \ - libmcrypt-dev \ libmemcached-dev \ libmhash-dev \ libpng-dev \ @@ -151,7 +150,6 @@ RUN set -xe; \ libldap-2.4-2 \ libmagickcore-6.q16-3 \ libmagickwand-6.q16-3 \ - libmcrypt4 \ libmemcached11 \ libmemcachedutil2 \ libmhash2 \ @@ -163,10 +161,8 @@ RUN set -xe; \ libzip4 \ msodbcsql17 \ ;\ - # SSH2 must be installed from source + # SSH2 must be installed from source for PHP 7.x git clone https://github.com/php/pecl-networking-ssh2.git /usr/src/php/ext/ssh2 && rm -rf /usr/src/php/ext/ssh2/.git; \ - # XDEBUG must be installed from source - git clone https://github.com/xdebug/xdebug.git /usr/src/php/ext/xdebug && rm -rf /usr/src/php/ext/xdebug/.git; \ \ docker-php-ext-configure >/dev/null gd \ --with-freetype-dir=/usr/include/ \ @@ -189,7 +185,8 @@ RUN set -xe; \ imap \ intl \ ldap \ - # mcrypt is removed from 7.2. See Deprecated features + # mcrypt is deprecated in 7.1 and removed in 7.2. See Deprecated features. + # mcrypt \ mysqli \ opcache \ pcntl \ @@ -199,7 +196,6 @@ RUN set -xe; \ soap \ sockets \ ssh2 \ - xdebug \ xsl \ zip \ ;\ @@ -213,6 +209,7 @@ RUN set -xe; \ pdo_sqlsrv \ redis \ sqlsrv \ + xdebug \ ;\ docker-php-ext-enable \ apcu \ @@ -223,8 +220,6 @@ RUN set -xe; \ redis \ sqlsrv \ ;\ - # Disable xdebug by default - rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \ # Cleanup docker-php-source delete; \ rm -rf /tmp/pear ~/.pearrc; \ diff --git a/7.3/Dockerfile b/7.3/Dockerfile index 22cf336c..97bd6fb8 100644 --- a/7.3/Dockerfile +++ b/7.3/Dockerfile @@ -125,7 +125,6 @@ RUN set -xe; \ libldap2-dev \ libmagickcore-dev \ libmagickwand-dev \ - libmcrypt-dev \ libmemcached-dev \ libmhash-dev \ libpng-dev \ @@ -150,7 +149,6 @@ RUN set -xe; \ libldap-2.4-2 \ libmagickcore-6.q16-3 \ libmagickwand-6.q16-3 \ - libmcrypt4 \ libmemcached11 \ libmemcachedutil2 \ libmhash2 \ @@ -162,10 +160,8 @@ RUN set -xe; \ libzip4 \ msodbcsql17 \ ;\ - # SSH2 must be installed from source + # SSH2 must be installed from source for PHP 7.x git clone https://github.com/php/pecl-networking-ssh2.git /usr/src/php/ext/ssh2 && rm -rf /usr/src/php/ext/ssh2/.git; \ - # XDEBUG must be installed from source - git clone https://github.com/xdebug/xdebug.git /usr/src/php/ext/xdebug && rm -rf /usr/src/php/ext/xdebug/.git; \ \ docker-php-ext-configure >/dev/null gd \ --with-freetype-dir=/usr/include/ \ @@ -188,7 +184,8 @@ RUN set -xe; \ imap \ intl \ ldap \ - # mcrypt is removed from 7.2. See Deprecated features + # mcrypt is deprecated in 7.1 and removed in 7.2. See Deprecated features. + # mcrypt \ mysqli \ opcache \ pcntl \ @@ -198,7 +195,6 @@ RUN set -xe; \ soap \ sockets \ ssh2 \ - xdebug \ xsl \ zip \ ;\ @@ -209,23 +205,21 @@ RUN set -xe; \ imagick \ # Use memcached (not memcache) for PHP 7.x memcached \ - # sqlsrv is currently not supported in PHP 7.3 - #pdo_sqlsrv \ + #pdo_sqlsrv - currently not supported in PHP 7.3 redis \ - #sqlsrv \ + #sqlsrv - currently not supported in PHP 7.3 + # There is currently no stable pecl release of xdebug for PHP 7.3 + xdebug-2.7.0beta1 \ ;\ docker-php-ext-enable \ apcu \ gnupg \ imagick \ memcached \ - # sqlsrv is currently not supported in PHP 7.3 - #pdo_sqlsrv \ + #pdo_sqlsrv - currently not supported in PHP 7.3 redis \ - #sqlsrv \ + #sqlsrv - currently not supported in PHP 7.3 ;\ - # Disable xdebug by default - rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \ # Cleanup docker-php-source delete; \ rm -rf /tmp/pear ~/.pearrc; \ diff --git a/cloud9/tests/test.bats b/cloud9/tests/test.bats index f5a06e2c..adb4fa37 100755 --- a/cloud9/tests/test.bats +++ b/cloud9/tests/test.bats @@ -65,7 +65,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output # This is a dirty hack to get tests to pass on Travis. # TODO: This should be replaced with a proper Cloud9 healthcheck in Dockerfile sleep 10 diff --git a/tests/.docksal/services/cli/crontab b/tests/.docksal/services/cli/crontab index 389f5c04..82d24cee 100644 --- a/tests/.docksal/services/cli/crontab +++ b/tests/.docksal/services/cli/crontab @@ -1 +1 @@ -* * * * * echo "The current date is $(date)" >> /tmp/date.txt +* * * * * echo "The current date is $(date)" > /tmp/date.txt diff --git a/tests/test.bats b/tests/test.bats index 3dd25341..90fcdca2 100755 --- a/tests/test.bats +++ b/tests/test.bats @@ -65,7 +65,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -117,7 +119,9 @@ _healthcheck_wait () -v $(pwd)/../tests/docroot:/var/www/docroot \ "$IMAGE" docker cp $(pwd)/../tests/scripts "$NAME:/var/www/" - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -173,7 +177,9 @@ _healthcheck_wait () ### Setup ### make start -e ENV='-e XDEBUG_ENABLED=1' - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -201,7 +207,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -257,7 +265,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -285,7 +295,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -308,7 +320,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -331,7 +345,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -360,7 +376,9 @@ _healthcheck_wait () ### Setup ### make start -e ENV="-e SECRET_SSH_PRIVATE_KEY" - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -381,7 +399,9 @@ _healthcheck_wait () [[ $SKIP == 1 ]] && skip make start - _healthcheck_wait + + run _healthcheck_wait + unset output run docker exec -u docker "${NAME}" cat /tmp/test-startup.txt [[ ${status} == 0 ]] @@ -404,7 +424,9 @@ _healthcheck_wait () ### Setup ### make start -e ENV='-e SECRET_ACAPI_EMAIL -e SECRET_ACAPI_KEY' - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -442,7 +464,9 @@ _healthcheck_wait () ### Setup ### make start -e ENV='-e SECRET_PLATFORMSH_CLI_TOKEN' - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -475,7 +499,9 @@ _healthcheck_wait () ### Setup ### make start -e ENV='-e SECRET_TERMINUS_TOKEN' - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -505,21 +531,15 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait - ### Tests ### - # Confirm output from cron is working - - # Create tmp date file and confirm it's empty - docker exec -u docker "$NAME" bash -lc 'touch /tmp/date.txt' - run docker exec -u docker "$NAME" bash -lc 'cat /tmp/date.txt' - [[ "${output}" == "" ]] + run _healthcheck_wait unset output - # Sleep for 60+1 seconds so cron can run again. - sleep 61 + ### Tests ### - # Confirm cron has ran and file contents has changed + # Give cron 60s to invoke the scheduled test job + sleep 60 + # Confirm cron has run and file contents has changed run docker exec -u docker "$NAME" bash -lc 'tail -1 /tmp/date.txt' [[ "${output}" =~ "The current date is " ]] unset output @@ -533,7 +553,9 @@ _healthcheck_wait () ### Setup ### make start -e ENV='-e GIT_USER_EMAIL=git@example.com -e GIT_USER_NAME="Docksal CLI"' - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### @@ -555,19 +577,19 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ### # Check PHPCS libraries loaded - run docker exec -u docker "$NAME" bash -lc 'phpcs -i' - [[ "${output}" =~ (" DrupalPractice "|" DrupalPractice,"|" DrupalPractice"$) ]] - [[ "${output}" =~ (" Drupal "|" Drupal,"|" Drupal"$) ]] - [[ "${output}" =~ (" WordPress-VIP "|" WordPress-VIP,"|" WordPress-VIP"$) ]] - [[ "${output}" =~ (" WordPress-Core "|" WordPress-Core,"|" WordPress-Core"$) ]] - [[ "${output}" =~ (" WordPress-Extra "|" WordPress-Extra,"|" WordPress-Extra"$) ]] - [[ "${output}" =~ (" WordPress-Docs "|" WordPress-Docs,"|" WordPress-Docs"$) ]] - [[ "${output}" =~ (" WordPress "|" WordPress,"|" WordPress"$) ]] + # Normalize the output from phpcs -i so it's easier to do matches + run docker exec -u docker "$NAME" bash -lc "phpcs -i | sed 's/,//g'" + output="${output} " + [[ "${output}" =~ " Drupal " ]] + [[ "${output}" =~ " DrupalPractice " ]] + [[ "${output}" =~ " WordPress " ]] # Includes WordPress-Core, WordPress-Docs and WordPress-Extra unset output ### Cleanup ### @@ -579,7 +601,9 @@ _healthcheck_wait () ### Setup ### make start - _healthcheck_wait + + run _healthcheck_wait + unset output ### Tests ###