From c8de832210d98ffa2b967cd6beff0441b585c6cf Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 23 Nov 2019 00:02:17 +0100 Subject: [PATCH] Simplify tests --- .tests/Makefile | 22 ++++++++++------------ .tests/tests/framework-wordpress.sh | 13 +++++++++---- .travis.yml | 14 -------------- 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/.tests/Makefile b/.tests/Makefile index 658de61a..9fea0ef6 100644 --- a/.tests/Makefile +++ b/.tests/Makefile @@ -2,8 +2,6 @@ ifneq (,) .error This Makefile requires GNU Make. endif -SHELL = /bin/sh - # ------------------------------------------------------------------------------------------------- # Misc Targets @@ -71,7 +69,7 @@ logs: # ------------------------------------------------------------------------------------------------- ### -### +### PHP Modules ### test-smoke-modules: $(PWD)/tests/modules-curl-vhosts.sh "modules" @@ -82,14 +80,14 @@ test-smoke-modules: ### -### +### Configuration ### test-smoke-config: $(PWD)/tests/config-xdebug.sh ### -### +### Intranet ### test-smoke-intranet: $(PWD)/tests/intranet-homepage.sh @@ -100,7 +98,7 @@ test-smoke-intranet: ### -### +### Intranet Vendors ### test-smoke-vendors: $(PWD)/tests/vendor-adminer-mysql.sh @@ -112,7 +110,7 @@ test-smoke-vendors: ### -### +### Virtual Host ### test-smoke-vhosts: $(PWD)/tests/vhost-directory_index.sh @@ -121,14 +119,14 @@ test-smoke-vhosts: ### -### +### Reverse Proxy ### test-smoke-rproxies: $(PWD)/tests/rproxy-javascript.sh ### -### +### SSL ### test-smoke-ssl: $(PWD)/tests/ssl-intranet.sh @@ -136,21 +134,21 @@ test-smoke-ssl: ### -### +### Bind ### test-smoke-bind: @echo noop ### -### +### Autostart ### test-smoke-autostart: $(PWD)/tests/autostart-examples.sh ### -### +### Frameworks ### test-smoke-framework-cakephp: $(PWD)/tests/framework-cakephp.sh diff --git a/.tests/tests/framework-wordpress.sh b/.tests/tests/framework-wordpress.sh index e4a518ec..f4e00cbb 100755 --- a/.tests/tests/framework-wordpress.sh +++ b/.tests/tests/framework-wordpress.sh @@ -55,10 +55,14 @@ PROJECT_NAME="this-is-my-grepable-project-name" # Setup Wordpress project -run "docker-compose exec --user devilbox -T php bash -c 'rm -rf /shared/httpd/${VHOST}'" "${RETRIES}" "${DVLBOX_PATH}" -run "docker-compose exec --user devilbox -T php bash -c 'mkdir -p /shared/httpd/${VHOST}'" "${RETRIES}" "${DVLBOX_PATH}" -run "docker-compose exec --user devilbox -T php bash -c 'git clone https://github.com/WordPress/WordPress /shared/httpd/${VHOST}/wordpress'" "${RETRIES}" "${DVLBOX_PATH}" -run "docker-compose exec --user devilbox -T php bash -c 'ln -sf wordpress /shared/httpd/${VHOST}/htdocs'" "${RETRIES}" "${DVLBOX_PATH}" +run "docker-compose exec --user devilbox -T php bash -c ' \ + rm -rf /shared/httpd/${VHOST} \ + && mkdir -p /shared/httpd/${VHOST} \ + && git clone https://github.com/WordPress/WordPress /shared/httpd/${VHOST}/wordpress \ + && ln -sf wordpress /shared/httpd/${VHOST}/htdocs'" \ + "${RETRIES}" "${DVLBOX_PATH}" + +# Setup Database run "docker-compose exec --user devilbox -T php mysql -u root -h mysql --password=\"${MYSQL_ROOT_PASSWORD}\" -e \"DROP DATABASE IF EXISTS ${DB_NAME}; CREATE DATABASE ${DB_NAME};\"" "${RETRIES}" "${DVLBOX_PATH}" # Configure Wordpress database settings @@ -105,3 +109,4 @@ fi # Test Wordpress run "docker-compose exec --user devilbox -T php curl -sS --fail -L 'http://${VHOST}.${TLD_SUFFIX}:${HOST_PORT_HTTPD}/' | grep '${PROJECT_NAME}' >/dev/null" "${RETRIES}" "${DVLBOX_PATH}" +run " curl -sS --fail -L --header 'host: ${VHOST}.${TLD_SUFFIX}' 'http://localhost:${HOST_PORT_HTTPD}/' | grep '${PROJECT_NAME}' >/dev/null" "${RETRIES}" "${DVLBOX_PATH}" diff --git a/.travis.yml b/.travis.yml index a9a67816..9a43d7b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -293,20 +293,6 @@ script: make linkcheck2; elif [ "${S1}" = "UPDATE" ]; then ./update-docker.sh "${V1}"; - elif [ "${S1}" = "DOCKER" ]; then - cd .tests/; - make start; - make test-smoke-modules; - make test-smoke-config; - make test-smoke-intranet; - make test-smoke-vendors; - make test-smoke-vhosts; - make test-smoke-rproxies; - make test-smoke-ssl; - make test-smoke-bind; - make test-smoke-autostart; - make test-smoke-framework-cakephp; - make test-smoke-framework-drupal; else cd .tests/; make start;