Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit 335fe0d

Browse files
committed
try again
1 parent ee33808 commit 335fe0d

File tree

7 files changed

+53
-3
lines changed

7 files changed

+53
-3
lines changed

tests/auto/datasync/WsRemoteConnectorTest/WsRemoteConnectorTest.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ DEFINES += QT_DEPRECATED_WARNINGS
2020

2121

2222
SOURCES += tst_wsremoteconnector.cpp
23+
2324
DEFINES += SRCDIR=\\\"$$PWD/\\\"
2425
DEFINES += BUILDDIR=\\\"$$OUT_PWD/\\\"
2526

2627
HEADERS +=
28+
29+
include(setup.pri)
30+
DEFINES += SETUP_CONF=\\\"$$SETUP_FILE\\\"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[general]
2+
name=QtDataSync-TestServer
3+
4+
[server]
5+
host=localhost
6+
port=4242
7+
secret=baum42
8+
9+
[database]
10+
name=QtDataSync
11+
host=localhost
12+
port=15432
13+
username=qtdatasync
14+
password=baum42
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SETUP_FILE=$$PWD/server-setup.conf

tests/auto/datasync/WsRemoteConnectorTest/tst_wsremoteconnector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ void WsRemoteConnectorTest::initTestCase()
5959

6060
//now start the server!
6161
QProcess p;
62-
p.start(QStringLiteral("%1/../../../../bin/qdatasyncserver start -c %2/../../../../tools/qdatasyncserver/docker_setup.conf")
62+
p.start(QStringLiteral("%1/../../../../bin/qdatasyncserver start -c %2")
6363
.arg(BUILDDIR)
64-
.arg(SRCDIR));
64+
.arg(SETUP_CONF));
6565
QVERIFY2(p.waitForFinished(), qPrintable(p.errorString()));
6666
QCOMPARE(p.exitCode(), EXIT_SUCCESS);
6767
}

tests/ci/docker-compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '2.2'
2+
services:
3+
datasync_postgres:
4+
container_name: datasync_example_postgres
5+
image: postgres:latest
6+
ports:
7+
- "15432:5432/tcp"
8+
environment:
9+
POSTGRES_USER: qtdatasync
10+
POSTGRES_PASSWORD: baum42
11+
POSTGRES_DB: QtDataSync
12+
network_mode: "bridge"

tests/ci/server-setup.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[general]
2+
name=QtDataSync-TestServer
3+
4+
[server]
5+
host=localhost
6+
port=4242
7+
secret=baum42
8+
9+
[database]
10+
name=QtDataSync
11+
port=15432
12+
username=qtdatasync
13+
password=baum42

tests/ci/setup.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ if [[ $PLATFORM == "gcc_64" ]]; then
66
sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.14.0/docker-compose-$(uname -s)-$(uname -m)"
77
sudo chmod +x /usr/local/bin/docker-compose
88

9-
sudo docker-compose -f ./tools/qdatasyncserver/docker-compose.yaml up -d
9+
sudo docker-compose -f ./tests/ci/docker-compose.yaml up -d
10+
#docker run -d --name datasync_example_postgres -e POSTGRES_USER=qtdatasync -e POSTGRES_PASSWORD=baum42 -e POSTGRES_DB=QtDataSync postgres:latest
11+
12+
13+
postgresIp=$(sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datasync_example_postgres)
14+
echo host=$postgresIp >> ./tests/ci/server-setup.conf
15+
echo 'SETUP_FILE=$$PWD/../../../ci/server-setup.conf' > ./tests/auto/datasync/WsRemoteConnectorTest/setup.pri
1016
fi
1117

1218
# disable test on osx as workaround (build fail and no docker support)

0 commit comments

Comments
 (0)