Skip to content

Commit e7da2ca

Browse files
dmarteauGustry
authored andcommitted
Use QJazz in tests
1 parent 7072c68 commit e7da2ca

File tree

6 files changed

+85
-47
lines changed

6 files changed

+85
-47
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ deploy-package-unstable:
149149
- fabric
150150

151151
deploy-docker-unstable:
152-
image: ${REGISTRY_URL}/factory-ci-runner:build-package
152+
image: ${REGISTRY_URL}/factory-ci-runner:factory-ci
153153
stage: deploy
154154
script:
155155
- update-service lizmap

tests/Makefile

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ PREFIX:=lizmap-$(LZMBRANCH)-tests
1313
LIZMAP_USER_ID ?= $(shell id -u)
1414
LIZMAP_GROUP_ID ?= $(shell id -g)
1515
LZMPOSTGISVERSION ?= 14-3
16-
LZMQGSRVVERSION ?= 3.34
16+
LZMQGSRVVERSION ?= qgis-ltr-eager
1717
LZMPGPORT ?= 8132
1818
LZMQGSRVPORT ?= 8131
19+
LZMQGSADMINPORT ?= 9876
1920
LZMWEBPORT ?= 8130
2021
LIZMAP_ADMIN_LOGIN ?= admin
2122
LIZMAP_ADMIN_EMAIL ?= admin@localhost.local
@@ -33,6 +34,7 @@ env:
3334
LZMBRANCH=$(LZMBRANCH)
3435
LZMPGPORT=$(LZMPGPORT)
3536
LZMQGSRVPORT=$(LZMQGSRVPORT)
37+
LZMQGSADMINPORT=$(LZMQGSADMINPORT)
3638
LZMWEBPORT=$(LZMWEBPORT)
3739
LIZMAP_ADMIN_LOGIN=$(LIZMAP_ADMIN_LOGIN)
3840
LIZMAP_ADMIN_EMAIL=$(LIZMAP_ADMIN_EMAIL)
@@ -44,32 +46,24 @@ env:
4446

4547

4648
build-plugins:
47-
docker run \
48-
-u $(LIZMAP_USER_ID):$(LIZMAP_GROUP_ID) \
49-
--rm -i \
50-
-e QGSRV_SERVER_PLUGINPATH=/srv/plugins \
51-
-e QGIS_PLUGIN_MANAGER_SOURCES_FILE=/tmp/sources-plugin-manager.list \
52-
-e QGIS_PLUGIN_MANAGER_CACHE_DIR=/tmp/cache-plugin-manager \
53-
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
54-
-v $(shell pwd)/:/src \
55-
--entrypoint /src/add_server_plugins.sh \
56-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
49+
echo "Plugins are auto installed at qgis worker startup"
5750

5851
show-qgis-server-versions:
5952
docker run \
6053
--rm -i \
61-
--entrypoint qgisserver \
62-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
63-
--version
54+
--entrypoint qjazz-config \
55+
3liz/qjazz:${LZMQGSRVVERSION} \
56+
version
6457
docker run \
6558
-u $(LIZMAP_USER_ID):$(LIZMAP_GROUP_ID) \
6659
--rm -i \
6760
-e QGSRV_SERVER_PLUGINPATH=/srv/plugins \
6861
-e QGIS_PLUGIN_MANAGER_SKIP_SOURCES_FILE=True \
6962
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
7063
-v $(shell pwd)/:/src \
64+
--workdir /srv/plugins \
7165
--entrypoint qgis-plugin-manager \
72-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
66+
3liz/qjazz:${LZMQGSRVVERSION} \
7367
list
7468

7569
upgrade-projects:
@@ -80,7 +74,7 @@ upgrade-projects:
8074
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
8175
-v $(shell pwd)/qgis-projects/tests:/tmp/qgis-projects \
8276
--entrypoint /srv/plugins/upgrade_projects.py \
83-
3liz/qgis-map-server:${LZMQGSRVVERSION} \
77+
3liz/qjazz:${LZMQGSRVVERSION} \
8478

8579
up: env
8680
docker compose up -V --force-recreate -d

tests/docker-compose.yml

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ services:
88
POSTGRES_USER: lizmap
99
volumes:
1010
- pg_data:/var/lib/postgresql/data
11-
- "../:/srv/lzm/"
11+
- { type: bind, source: "..", target: /srv/lzm/ }
1212
ports:
1313
- ${LZMPGPORT}:5432
1414
networks:
1515
default:
1616
aliases:
1717
- db.lizmap.local
1818
redis:
19-
image: redis:7.4
19+
image: redis:7-alpine
2020
container_name: "lizmap${LZMBRANCH}_test_redis"
2121
openldap:
2222
build: ./docker-conf/openldap
@@ -27,7 +27,7 @@ services:
2727
SLAPD_ORGANISATION: "Lizmap"
2828
SLAPD_DOMAIN: "tests.lizmap"
2929
volumes:
30-
- "./docker-conf/openldap/ldif:/customldif"
30+
- { type: bind, source: ./docker-conf/openldap/ldif, target: /customldif }
3131
lizmap:
3232
build:
3333
context: ./docker-conf/phpfpm
@@ -44,8 +44,8 @@ services:
4444
- LIZMAP_ADMIN_DEFAULT_PASSWORD_SOURCE
4545
- ECHO_OGC_ORIGINAL_REQUEST=on
4646
volumes:
47-
- "../:/srv/lzm/"
48-
- ./docker-conf/pg_service.conf:/srv/etc/pg_service.conf
47+
- { type: bind, source: "..", target: /srv/lzm/ }
48+
- { type: bind, source: ./docker-conf/pg_service.conf, target: /srv/etc/pg_service.conf }
4949
- ./docker-conf/phpfpm/admin.conf:/srv/etc/admin.conf
5050
depends_on:
5151
- pgsql
@@ -55,8 +55,8 @@ services:
5555
image: nginx:alpine
5656
container_name: "lizmap${LZMBRANCH}_test_nginx"
5757
volumes:
58-
- "./docker-conf/nginx-default.conf:/etc/nginx/conf.d/default.conf"
59-
- "../:/srv/lzm/"
58+
- { type: bind, source: ./docker-conf/nginx-default.conf, target: /etc/nginx/conf.d/default.conf }
59+
- { type: bind, source: "..", target: /srv/lzm/ }
6060
command: /bin/sh -c "nginx -g 'daemon off;'"
6161
networks:
6262
default:
@@ -67,34 +67,41 @@ services:
6767
- ${LZMWEBPORT}:80
6868
depends_on:
6969
- lizmap
70+
# Qgis RCP 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"]
75+
environment:
76+
CONF_LOGGING__LEVEL: debug
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
81+
QGIS_SERVER_LIZMAP_REVEAL_SETTINGS: yes
82+
PGSERVICEFILE: /srv/etc/pg_service.conf
83+
volumes:
84+
- { type: bind, source: ./qgis-projects, target: /srv/projects }
85+
- { type: bind, source: ./qgis-server-plugins, target: /srv/qgis-server-plugins }
86+
- { type: bind, source: ./docker-conf/pg_service.conf, target: /srv/etc/pg_service.conf }
87+
- { type: bind, source: ./docker-conf/qgis-server.toml, target: /srv/etc/qgis-server.toml }
88+
# Qgis workers frontend
7089
map:
7190
container_name: "lizmap${LZMBRANCH}_test_qgis"
72-
image: 3liz/qgis-map-server:${LZMQGSRVVERSION}
91+
image: 3liz/qjazz:${LZMQGSRVVERSION}
92+
command: ["qjazz-server-http", "serve", "-C", "/srv/etc/qgis-server.toml"]
7393
environment:
74-
PGSERVICEFILE: /srv/etc/pg_service.conf
75-
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_SERVER_WORKERS: 4
84-
QGSRV_USER: ${LIZMAP_USER_ID}:${LIZMAP_GROUP_ID}
85-
ROUTER_HOST: map
94+
CONF_LOGGING__LEVEL: trace
8695
volumes:
87-
- ./qgis-projects:/srv/projects
88-
- ./qgis-server-plugins:/srv/qgis-server-plugins
89-
- ./wps-data:/srv/data
90-
- ./docker-conf/pg_service.conf:/srv/etc/pg_service.conf
96+
- { type: bind, source: ./docker-conf/qgis-server.toml, target: /srv/etc/qgis-server.toml }
9197
ports:
92-
- ${LZMQGSRVPORT}:8080
98+
- ${LZMQGSRVPORT}:9080
99+
- ${LZMQGSADMINPORT}:9876
93100
webdav:
94101
container_name: lizmap${LZMBRANCH}_test_webdav
95102
image: ugeek/webdav:amd64
96103
volumes:
97-
- ./qgis-projects/webdav/test:/media
104+
- { type: bind, source: ./qgis-projects/webdav/test, target: /media }
98105
environment:
99106
- USERNAME=webdav
100107
- PASSWORD=webdav

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
;Wms map server
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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Worker backend configuration
3+
#
4+
5+
[worker]
6+
name = "Qgis"
7+
8+
[worker.qgis]
9+
max_projects = 20
10+
11+
[worker.qgis.projects]
12+
ignore_bad_layers = true
13+
14+
[worker.qgis.projects.search_paths]
15+
'/' = "/srv/projects"
16+
17+
# Plugins allowed to install from plugin paths
18+
[worker.qgis.plugins]
19+
install = [
20+
"Lizmap server",
21+
"atlasprint",
22+
"wfsOutputExtension",
23+
]
24+
# Auto install plugins from embedded plugin manager
25+
install_mode = "auto"
26+
27+
#
28+
# HTTP Front end configuration
29+
#
30+
31+
[backends.root]
32+
title = "Root backend"
33+
address= "tcp://map-rpc"
34+
route = "/"
35+
36+
[[backends.root.api]]
37+
endpoint = "lizmap"
38+
name = "Lizmap api"
39+

tests/run-docker

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ if [ "$CMD" == "reset" ]; then
1919
elif [ "$CMD" == "build" ]; then
2020
# install or update base images, to be sure we have the latest images
2121
docker compose pull
22-
# install or update plugins, to be sure we have the latest plugins
23-
make build-plugins
2422
fi
2523

2624
docker compose $CMD "$@"

0 commit comments

Comments
 (0)