Skip to content

Commit 8990268

Browse files
committed
Use QJazz in tests
1 parent c9fce4a commit 8990268

File tree

9 files changed

+94
-82
lines changed

9 files changed

+94
-82
lines changed

.github/workflows/e2e_tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
- name: "LEGACY"
3131
php: "8.2"
3232
pg-postgis: "14-3"
33-
qgis-server: "3.40"
33+
qgis-server: "qgis-ltr-eager"
3434
update-projects: "FALSE"
3535
- name: "BLEEDING_EDGE"
3636
php: "8.4"
3737
pg-postgis: "17-3"
38-
qgis-server: "3.42"
38+
qgis-server: "qgis-release-eager"
3939
update-projects: "TRUE"
4040
env:
4141
CYPRESS_CI: TRUE
@@ -315,6 +315,7 @@ jobs:
315315
mkdir -p /tmp/e2e/lwc
316316
mkdir -p /tmp/e2e/docker
317317
docker logs lizmap${{ env.LZMBRANCH }}_test_qgis &> /tmp/e2e/docker/qgis-server.log | true
318+
docker logs lizmap${{ env.LZMBRANCH }}_test_qgis_rpc &> /tmp/e2e/docker/qgis-server-rpc.log | true
318319
docker logs lizmap${{ env.LZMBRANCH }}_test_php &> /tmp/e2e/docker/php.log | true
319320
docker logs lizmap${{ env.LZMBRANCH }}_test_nginx &> /tmp/e2e/docker/nginx.log | true
320321
cp -r ../lizmap/var/log /tmp/e2e/lwc/

tests/Makefile

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ LIZMAP_GROUP_ID ?= $(shell id -g)
1515
# Note that GH Action E2E has its own version config for PHP, PG and QGIS
1616
PHP_VERSION ?= 8.2
1717
LZMPOSTGISVERSION ?= 14-3
18-
LZMQGSRVVERSION ?= 3.40
18+
LZMQGSRVVERSION ?= qgis-ltr-eager
1919
QGSRVAPIPORT ?= 8134
2020
LZMPGPORT ?= 8132
2121
LZMQGSRVPORT ?= 8131
22+
LZMQGSADMINPORT ?= 9876
2223
LZMWEBPORT ?= 8130
2324
LIZMAP_ADMIN_LOGIN ?= admin
2425
LIZMAP_ADMIN_EMAIL ?= admin@localhost.local
@@ -37,6 +38,7 @@ env:
3738
LZMBRANCH=$(LZMBRANCH)
3839
LZMPGPORT=$(LZMPGPORT)
3940
LZMQGSRVPORT=$(LZMQGSRVPORT)
41+
LZMQGSADMINPORT=$(LZMQGSADMINPORT)
4042
LZMWEBPORT=$(LZMWEBPORT)
4143
QGSRVAPIPORT=$(QGSRVAPIPORT)
4244
LIZMAP_ADMIN_LOGIN=$(LIZMAP_ADMIN_LOGIN)
@@ -50,32 +52,24 @@ env:
5052

5153

5254
build-plugins:
53-
docker run \
54-
-u $(LIZMAP_USER_ID):$(LIZMAP_GROUP_ID) \
55-
--rm -i \
56-
-e QGSRV_SERVER_PLUGINPATH=/srv/plugins \
57-
-e QGIS_PLUGIN_MANAGER_SOURCES_FILE=/tmp/sources-plugin-manager.list \
58-
-e QGIS_PLUGIN_MANAGER_CACHE_DIR=/tmp/cache-plugin-manager \
59-
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
60-
-v $(shell pwd)/:/src \
61-
--entrypoint /src/add_server_plugins.sh \
62-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
55+
echo "Plugins are auto installed at qgis worker startup"
6356

6457
show-qgis-server-versions:
6558
docker run \
6659
--rm -i \
67-
--entrypoint qgisserver \
68-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
69-
--version
60+
--entrypoint qjazz-config \
61+
3liz/qjazz:${LZMQGSRVVERSION} \
62+
version
7063
docker run \
7164
-u $(LIZMAP_USER_ID):$(LIZMAP_GROUP_ID) \
7265
--rm -i \
73-
-e QGSRV_SERVER_PLUGINPATH=/srv/plugins \
66+
-e QGIS_PLUGINPATH=/srv/plugins \
7467
-e QGIS_PLUGIN_MANAGER_SKIP_SOURCES_FILE=True \
7568
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
7669
-v $(shell pwd)/:/src \
70+
--workdir /srv/plugins \
7771
--entrypoint qgis-plugin-manager \
78-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
72+
3liz/qjazz:${LZMQGSRVVERSION} \
7973
list
8074

8175
upgrade-projects:
@@ -86,14 +80,14 @@ upgrade-projects:
8680
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
8781
-v $(shell pwd)/qgis-projects/tests:/tmp/qgis-projects \
8882
--entrypoint /srv/plugins/upgrade_projects.py \
89-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
83+
3liz/qjazz:${LZMQGSRVVERSION} \
9084

9185
up: env
92-
docker compose up -V --force-recreate -d
86+
docker compose --profile=swagger --profile=webdav up -V --force-recreate -d
9387

9488
stop:
95-
docker compose stop
89+
docker compose --profile=swagger --profile=webdav stop
9690

9791
reset:
98-
docker compose down -v --remove-orphans
92+
docker compose --profile=swagger --profile=webdav down -v --remove-orphans
9993
./lizmap-ctl clean

tests/add_server_plugins.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/docker-compose.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,32 +67,40 @@ services:
6767
- ${LZMWEBPORT}:80
6868
depends_on:
6969
- lizmap
70-
map:
71-
container_name: "lizmap${LZMBRANCH}_test_qgis"
72-
image: 3liz/qgis-map-server:${LZMQGSRVVERSION}
70+
# QGIS RPC backend
71+
map-rpc:
72+
container_name: "lizmap${LZMBRANCH}_test_qgis_rpc"
73+
image: 3liz/qjazz:${LZMQGSRVVERSION}
74+
command: ["qjazz-rpc", "serve", "-C", "/srv/etc/qgis-server.toml"]
7375
environment:
74-
PGSERVICEFILE: /srv/etc/pg_service.conf
76+
CONF_LOGGING__LEVEL: trace
77+
CONF_WORKER__NUM_PROCESSES: 4
78+
CONF_DISPLAY_XVFB: ON
79+
CONF_USER: ${LIZMAP_USER_ID}:${LIZMAP_GROUP_ID}
80+
QGIS_PLUGINPATH: /srv/qgis-server-plugins
7581
QGIS_SERVER_LIZMAP_REVEAL_SETTINGS: yes
76-
QGSRV_API_ENABLED_LIZMAP: yes
77-
QGSRV_CACHE_ROOTDIR: /srv/projects
78-
QGSRV_CACHE_SIZE: '20'
79-
# For testing purpose, I think it's better to have a strict check of layers
80-
QGSRV_CACHE_STRICT_CHECK: yes
81-
QGSRV_LOGGING_LEVEL: DEBUG
82-
QGSRV_SERVER_PLUGINPATH: /srv/qgis-server-plugins
83-
QGSRV_MANAGEMENT_ENABLED: yes
84-
QGSRV_MANAGEMENT_INTERFACES: "0.0.0.0"
85-
QGSRV_SERVER_WORKERS: 4
86-
QGSRV_USER: ${LIZMAP_USER_ID}:${LIZMAP_GROUP_ID}
87-
ROUTER_HOST: map
82+
QGIS_PLUGIN_MANAGER_SOURCES_FILE: /srv/etc/plugin-sources.list
83+
PGSERVICEFILE: /srv/etc/pg_service.conf
8884
volumes:
8985
- { type: bind, source: ./qgis-projects, target: /srv/projects }
9086
- { type: bind, source: ./qgis-server-plugins, target: /srv/qgis-server-plugins }
91-
- { type: bind, source: ./wps-data, target: /srv/data }
9287
- { type: bind, source: ./docker-conf/pg_service.conf, target: /srv/etc/pg_service.conf }
88+
- { type: bind, source: ./docker-conf/qgis-server.toml, target: /srv/etc/qgis-server.toml }
89+
- type: bind
90+
source: ./docker-conf/unstable-plugin-sources.list
91+
target: /srv/etc/plugin-sources.list
92+
# QGIS workers frontend
93+
map:
94+
container_name: "lizmap${LZMBRANCH}_test_qgis"
95+
image: 3liz/qjazz:${LZMQGSRVVERSION}
96+
command: ["qjazz-map", "serve", "-C", "/srv/etc/qgis-server.toml"]
97+
environment:
98+
CONF_LOGGING__LEVEL: trace
99+
volumes:
100+
- { type: bind, source: ./docker-conf/qgis-server.toml, target: /srv/etc/qgis-server.toml }
93101
ports:
94-
- ${LZMQGSRVPORT}:8080
95-
- ${QGSRVAPIPORT}:19876
102+
- ${LZMQGSRVPORT}:9080
103+
- ${LZMQGSADMINPORT}:9876
96104
webdav:
97105
container_name: lizmap${LZMBRANCH}_test_webdav
98106
image: ugeek/webdav:amd64
@@ -104,6 +112,8 @@ services:
104112
- UID=${LIZMAP_USER_ID}
105113
- GID=${LIZMAP_GROUP_ID}
106114
- TZ=Europe/Rome
115+
profiles:
116+
- webdav
107117
swagger:
108118
container_name: lizmap${LZMBRANCH}_swagger_ui
109119
image: docker.swagger.io/swaggerapi/swagger-ui

tests/docker-conf/phpfpm/lizmapConfig.ini.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
;list the different map services (servers, generic parameters, etc.)
66
[services]
77
;URL to QGIS Server for OGC web services
8-
wmsServerURL="http://map:8080/ows/"
8+
wmsServerURL="http://map:9080/"
99
;WMS subdomain URLs list (optional)
1010
wmsPublicUrlList=
1111
;URL to the API exposed by the Lizmap plugin for QGIS Server
12-
lizmapPluginAPIURL="http://map:8080/lizmap/"
12+
lizmapPluginAPIURL="http://map:9080/lizmap/"
1313

1414
onlyMaps=off
1515
defaultRepository=testsrepository

tests/docker-conf/qgis-server.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Worker backend configuration
3+
#
4+
5+
6+
[worker]
7+
name = "Server"
8+
9+
[worker.qgis]
10+
max_projects = 20
11+
12+
[worker.qgis.projects]
13+
ignore_bad_layers = false
14+
15+
[worker.qgis.projects.search_paths]
16+
'/' = "/srv/projects"
17+
18+
# Plugins allowed to install from plugin paths
19+
[worker.qgis.plugins]
20+
install = [
21+
"Lizmap server",
22+
"atlasprint",
23+
"wfsOutputExtension",
24+
]
25+
# Auto install plugins from embedded plugin manager
26+
install_mode = "auto"
27+
28+
#
29+
# HTTP Front end configuration
30+
#
31+
32+
[backends.root]
33+
title = "Root backend"
34+
host = "map-rpc"
35+
route = "/"
36+
37+
[[backends.root.api]]
38+
endpoint = "lizmap"
39+
name = "Lizmap"
40+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://packages.3liz.org/pub/server-plugins-repository/unstable/plugins.[VERSION].xml

tests/end2end/playwright.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineConfig({
44
testDir: './playwright',
55
snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}',
66
/* Maximum time one test can run for. */
7-
timeout: 30 * 1000,
7+
timeout: 10 * 1000,
88
expect: {
99
/**
1010
* Maximum time expect() should wait for the condition to be met.
@@ -17,7 +17,8 @@ export default defineConfig({
1717
/* Fail the build on CI if you accidentally left test.only in the source code. */
1818
forbidOnly: !!process.env.CI,
1919
/* Retry on CI only */
20-
retries: process.env.CI ? 2 : 0,
20+
/* retries: process.env.CI ? 2 : 0, */
21+
retries: 0,
2122
/* Opt out of parallel tests on CI. */
2223
workers: process.env.CI ? 2 : undefined,
2324
/* Reporter to use. */

tests/run-docker

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ if [ "$CMD" == "reset" ]; then
1818
exit 0
1919
elif [ "$CMD" == "build" ]; then
2020
# install or update base images, to be sure we have the latest images
21-
docker compose pull
22-
# install or update plugins, to be sure we have the latest plugins
23-
make build-plugins
21+
docker compose --profile=webdav --profile=swagger pull
2422
fi
2523

26-
docker compose $CMD "$@"
24+
docker compose --profile=webdav --profile=swagger $CMD "$@"

0 commit comments

Comments
 (0)