Skip to content

Commit

Permalink
Use QJazz in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Jan 29, 2025
1 parent 83943a0 commit 532ff0b
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 70 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ jobs:
mkdir -p /tmp/e2e/lwc
mkdir -p /tmp/e2e/docker
docker logs lizmap${{ env.LZMBRANCH }}_test_qgis &> /tmp/e2e/docker/qgis-server.log | true
docker logs lizmap${{ env.LZMBRANCH }}_test_qgis_rpc &> /tmp/e2e/docker/qgis-server-rpc.log | true
docker logs lizmap${{ env.LZMBRANCH }}_test_php &> /tmp/e2e/docker/php.log | true
docker logs lizmap${{ env.LZMBRANCH }}_test_nginx &> /tmp/e2e/docker/nginx.log | true
cp -r ../lizmap/var/log /tmp/e2e/lwc/
Expand Down
26 changes: 10 additions & 16 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ PREFIX:=lizmap-$(LZMBRANCH)-tests
LIZMAP_USER_ID ?= $(shell id -u)
LIZMAP_GROUP_ID ?= $(shell id -g)
LZMPOSTGISVERSION ?= 14-3
LZMQGSRVVERSION ?= 3.34
LZMQGSRVVERSION ?= qgis-ltr-eager
LZMPGPORT ?= 8132
LZMQGSRVPORT ?= 8131
LZMQGSADMINPORT ?= 9876
LZMWEBPORT ?= 8130
LIZMAP_ADMIN_LOGIN ?= admin
LIZMAP_ADMIN_EMAIL ?= [email protected]
Expand All @@ -33,6 +34,7 @@ env:
LZMBRANCH=$(LZMBRANCH)
LZMPGPORT=$(LZMPGPORT)
LZMQGSRVPORT=$(LZMQGSRVPORT)
LZMQGSADMINPORT=$(LZMQGSADMINPORT)
LZMWEBPORT=$(LZMWEBPORT)
LIZMAP_ADMIN_LOGIN=$(LIZMAP_ADMIN_LOGIN)
LIZMAP_ADMIN_EMAIL=$(LIZMAP_ADMIN_EMAIL)
Expand All @@ -44,32 +46,24 @@ env:


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

show-qgis-server-versions:
docker run \
--rm -i \
--entrypoint qgisserver \
3liz/qgis-map-server:${LZMQGSRVVERSION} \
--version
--entrypoint qjazz-config \
3liz/qjazz:${LZMQGSRVVERSION} \
version
docker run \
-u $(LIZMAP_USER_ID):$(LIZMAP_GROUP_ID) \
--rm -i \
-e QGSRV_SERVER_PLUGINPATH=/srv/plugins \
-e QGIS_PLUGIN_MANAGER_SKIP_SOURCES_FILE=True \
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
-v $(shell pwd)/:/src \
--workdir /srv/plugins \
--entrypoint qgis-plugin-manager \
3liz/qgis-map-server:${LZMQGSRVVERSION} \
3liz/qjazz:${LZMQGSRVVERSION} \
list

upgrade-projects:
Expand All @@ -80,7 +74,7 @@ upgrade-projects:
-v $(shell pwd)/qgis-server-plugins:/srv/plugins \
-v $(shell pwd)/qgis-projects/tests:/tmp/qgis-projects \
--entrypoint /srv/plugins/upgrade_projects.py \
3liz/qgis-map-server:${LZMQGSRVVERSION} \
3liz/qjazz:${LZMQGSRVVERSION} \

up: env
docker compose up -V --force-recreate -d
Expand Down
33 changes: 0 additions & 33 deletions tests/add_server_plugins.sh

This file was deleted.

47 changes: 30 additions & 17 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
SLAPD_ORGANISATION: "Lizmap"
SLAPD_DOMAIN: "tests.lizmap"
volumes:
- { type: bind, source: ./docker-conf/openldap/ldif, target: /customldif }
- { type: bind, source: ./docker-conf/openldap/ldif, target: /customldif }
lizmap:
build:
context: ./docker-conf/phpfpm
Expand Down Expand Up @@ -67,29 +67,40 @@ services:
- ${LZMWEBPORT}:80
depends_on:
- lizmap
map:
container_name: "lizmap${LZMBRANCH}_test_qgis"
image: 3liz/qgis-map-server:${LZMQGSRVVERSION}
# QGIS RPC backend
map-rpc:
container_name: "lizmap${LZMBRANCH}_test_qgis_rpc"
image: 3liz/qjazz:${LZMQGSRVVERSION}
command: ["qjazz-rpc", "serve", "-C", "/srv/etc/qgis-server.toml"]
environment:
PGSERVICEFILE: /srv/etc/pg_service.conf
CONF_LOGGING__LEVEL: trace
CONF_WORKER__NUM_PROCESSES: 4
CONF_DISPLAY_XVFB: ON
CONF_USER: ${LIZMAP_USER_ID}:${LIZMAP_GROUP_ID}
QGIS_PLUGINPATH: /srv/qgis-server-plugins
QGIS_SERVER_LIZMAP_REVEAL_SETTINGS: yes
QGSRV_API_ENABLED_LIZMAP: yes
QGSRV_CACHE_ROOTDIR: /srv/projects
QGSRV_CACHE_SIZE: '20'
# For testing purpose, I think it's better to have a strict check of layers
QGSRV_CACHE_STRICT_CHECK: yes
QGSRV_LOGGING_LEVEL: DEBUG
QGSRV_SERVER_PLUGINPATH: /srv/qgis-server-plugins
QGSRV_SERVER_WORKERS: 4
QGSRV_USER: ${LIZMAP_USER_ID}:${LIZMAP_GROUP_ID}
ROUTER_HOST: map
QGIS_PLUGIN_MANAGER_SOURCES_FILE: /srv/etc/plugin-sources.list
PGSERVICEFILE: /srv/etc/pg_service.conf
volumes:
- { type: bind, source: ./qgis-projects, target: /srv/projects }
- { type: bind, source: ./qgis-server-plugins, target: /srv/qgis-server-plugins }
- { type: bind, source: ./wps-data, target: /srv/data }
- { type: bind, source: ./docker-conf/pg_service.conf, target: /srv/etc/pg_service.conf }
- { type: bind, source: ./docker-conf/qgis-server.toml, target: /srv/etc/qgis-server.toml }
- type: bind
source: ./docker-conf/unstable-plugin-sources.list
target: /srv/etc/plugin-sources.list
# QGIS workers frontend
map:
container_name: "lizmap${LZMBRANCH}_test_qgis"
image: 3liz/qjazz:${LZMQGSRVVERSION}
command: ["qjazz-map", "serve", "-C", "/srv/etc/qgis-server.toml"]
environment:
CONF_LOGGING__LEVEL: trace
volumes:
- { type: bind, source: ./docker-conf/qgis-server.toml, target: /srv/etc/qgis-server.toml }
ports:
- ${LZMQGSRVPORT}:8080
- ${LZMQGSRVPORT}:9080
- ${LZMQGSADMINPORT}:9876
webdav:
container_name: lizmap${LZMBRANCH}_test_webdav
image: ugeek/webdav:amd64
Expand All @@ -101,6 +112,8 @@ services:
- UID=${LIZMAP_USER_ID}
- GID=${LIZMAP_GROUP_ID}
- TZ=Europe/Rome
#profiles:
# - webdav
volumes:
pg_data:
name: "lizmap${LZMBRANCH}_pg_data"
4 changes: 2 additions & 2 deletions tests/docker-conf/phpfpm/lizmapConfig.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
;list the different map services (servers, generic parameters, etc.)
[services]
;Wms map server
wmsServerURL="http://map:8080/ows/"
wmsServerURL="http://map:9080/"
;WMS subdomain URLs list (optional)
wmsPublicUrlList=
;URL to the API exposed by the Lizmap plugin for QGIS Server
lizmapPluginAPIURL="http://map:8080/lizmap/"
lizmapPluginAPIURL="http://map:9080/lizmap/"

onlyMaps=off
defaultRepository=testsrepository
Expand Down
40 changes: 40 additions & 0 deletions tests/docker-conf/qgis-server.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Worker backend configuration
#


[worker]
name = "Server"

[worker.qgis]
max_projects = 20

[worker.qgis.projects]
ignore_bad_layers = false

[worker.qgis.projects.search_paths]
'/' = "/srv/projects"

# Plugins allowed to install from plugin paths
[worker.qgis.plugins]
install = [
"Lizmap server",
"atlasprint",
"wfsOutputExtension",
]
# Auto install plugins from embedded plugin manager
install_mode = "auto"

#
# HTTP Front end configuration
#

[backends.root]
title = "Root backend"
host = "map-rpc"
route = "/"

[[backends.root.api]]
endpoint = "lizmap"
name = "Lizmap api"

1 change: 1 addition & 0 deletions tests/docker-conf/unstable-plugin-sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://packages.3liz.org/pub/server-plugins-repository/unstable/plugins.[VERSION].xml
2 changes: 0 additions & 2 deletions tests/run-docker
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ if [ "$CMD" == "reset" ]; then
elif [ "$CMD" == "build" ]; then
# install or update base images, to be sure we have the latest images
docker compose pull
# install or update plugins, to be sure we have the latest plugins
make build-plugins
fi

docker compose $CMD "$@"

0 comments on commit 532ff0b

Please sign in to comment.