Update handling of TESTSERVER_COMPOSE_FILE

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 <ryan.chu@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Maurice Kalinowski 2019-02-12 16:20:36 +01:00 committed by Edward Welbourne
parent b43988ada2
commit e8bde992e0
1 changed files with 6 additions and 4 deletions

View File

@ -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}\")