From e8bde992e073072e795cdb2d4fa5d36089953645 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 12 Feb 2019 16:20:36 +0100 Subject: [PATCH] Update handling of TESTSERVER_COMPOSE_FILE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initially TESTSERVER_COMPOSE_FILE could be manually specified. Later this got removed by accident. Re-enable this feature. Furthermore, check if a module has a platform-specific compose file. If not, fall back to a default docker-compose.yml. This is useful to include testserver.pri from other modules, where no platform-specific requirements are present, ie the image from provisioning works on all platforms. Change-Id: Icb92552fd61196be332b2431ab0f8a43b9157fc8 Reviewed-by: Ryan Chu Reviewed-by: MÃ¥rten Nordheim --- tests/auto/testserver.pri | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/auto/testserver.pri b/tests/auto/testserver.pri index eb83c6c2cc..455f88fa5d 100644 --- a/tests/auto/testserver.pri +++ b/tests/auto/testserver.pri @@ -93,7 +93,7 @@ isEmpty(TESTSERVER_VERSION) { # but it causes a port conflict if the user is running a service that # binds the same port on the host. An alternative solution is to deploy # the docker environment into VirtualBox using docker-machine. - TESTSERVER_COMPOSE_FILE = \ + isEmpty(TESTSERVER_COMPOSE_FILE): TESTSERVER_COMPOSE_FILE = \ $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-for-macOS.yml # The connection configuration for the target machine @@ -106,7 +106,7 @@ isEmpty(TESTSERVER_VERSION) { } else:equals(QMAKE_HOST.os, Windows) { # There is no docker bridge on Windows. It is impossible to ping a container. # Use docker-machine to deploy the docker environment into VirtualBox. - TESTSERVER_COMPOSE_FILE = \ + isEmpty(TESTSERVER_COMPOSE_FILE): TESTSERVER_COMPOSE_FILE = \ $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-for-windows.yml # The connection configuration for the target machine @@ -123,12 +123,14 @@ isEmpty(TESTSERVER_VERSION) { TEST_CMD = 'PowerShell -noprofile' CONFIG += PowerShell } else { - TESTSERVER_COMPOSE_FILE = $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml - + isEmpty(TESTSERVER_COMPOSE_FILE): TESTSERVER_COMPOSE_FILE = \ + $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml # The environment variables passed to the docker-compose file TEST_ENV = 'TEST_DOMAIN=$$DNSDOMAIN' TEST_CMD = env } + !exists($$TESTSERVER_COMPOSE_FILE): error("Invalid TESTSERVER_COMPOSE_FILE specified") + # The domain name is relevant to https keycert (qnetworkreply/crts/qt-test-net-cacert.pem). DEFINES += QT_TEST_SERVER QT_TEST_SERVER_DOMAIN=$$shell_quote(\"$${DNSDOMAIN}\")