diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 1693679c8e..09838acd79 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -218,6 +218,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/ diff --git a/tests/Makefile b/tests/Makefile index 1272966ead..9060dea7cf 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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 ?= admin@localhost.local @@ -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) @@ -44,23 +46,14 @@ 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 \ @@ -68,8 +61,9 @@ show-qgis-server-versions: -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: @@ -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 diff --git a/tests/add_server_plugins.sh b/tests/add_server_plugins.sh deleted file mode 100755 index 249b0169b1..0000000000 --- a/tests/add_server_plugins.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Remove legacy folders about qgis-plugin-manager -if [ -d /srv/plugins/.cache_qgis_plugin_manager ]; then - rm -rf /srv/plugins/.cache_qgis_plugin_manager -fi -if [ -f /srv/plugins/sources.list ]; then - rm -f /srv/plugins/sources.list -fi - -echo "QGIS Server Lizmap and WfsOutputExtension plugins" -echo "Unstable from https://packages.3liz.org" -# qgis-plugin-manager init -echo "https://packages.3liz.org/pub/server-plugins-repository/unstable/plugins.[VERSION].xml" > /tmp/sources-plugin-manager.list -qgis-plugin-manager update -qgis-plugin-manager install -f "Lizmap server" -qgis-plugin-manager install -f wfsOutputExtension -qgis-plugin-manager install -f atlasprint - -# echo "QGIS Server Lizmap plugin" -# Latest commit -# echo "Latest commit from https://packages.3liz.org" -# wget https://packages.3liz.org/pub/lizmap-server-qgis-plugin/lizmap_server.master.zip -O /tmp/lizmap_server.master.zip - -# Latest release -# VERSION=1.1.1 -# echo "Stable release from GitHub" -# wget https://github.com/3liz/qgis-lizmap-server-plugin/releases/latest/download/lizmap_server.${VERSION}.zip -O /tmp/lizmap_server.master.zip - -# unzip -o /tmp/lizmap_server.master.zip -d /srv/plugins/ -# rm /tmp/lizmap_server.master.zip diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 8f115bf52b..e800e9afad 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -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 @@ -67,29 +67,40 @@ services: - ${LZMWEBPORT}:80 depends_on: - lizmap + # Qgis RCP 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: + 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 + 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: ./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 } + # Qgis workers frontend map: container_name: "lizmap${LZMBRANCH}_test_qgis" - image: 3liz/qgis-map-server:${LZMQGSRVVERSION} + image: 3liz/qjazz:${LZMQGSRVVERSION} + command: ["qjazz-server-http", "serve", "-C", "/srv/etc/qgis-server.toml"] environment: - PGSERVICEFILE: /srv/etc/pg_service.conf - 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 + CONF_LOGGING__LEVEL: trace 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 } ports: - - ${LZMQGSRVPORT}:8080 + - ${LZMQGSRVPORT}:9080 + - ${LZMQGSADMINPORT}:9876 webdav: container_name: lizmap${LZMBRANCH}_test_webdav image: ugeek/webdav:amd64 diff --git a/tests/docker-conf/phpfpm/lizmapConfig.ini.php b/tests/docker-conf/phpfpm/lizmapConfig.ini.php index 01b7e3d602..52b418f108 100644 --- a/tests/docker-conf/phpfpm/lizmapConfig.ini.php +++ b/tests/docker-conf/phpfpm/lizmapConfig.ini.php @@ -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 diff --git a/tests/docker-conf/qgis-server.toml b/tests/docker-conf/qgis-server.toml new file mode 100644 index 0000000000..97913ad1e4 --- /dev/null +++ b/tests/docker-conf/qgis-server.toml @@ -0,0 +1,39 @@ +# +# 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" +address= "tcp://map-rpc" +route = "/" + +[[backends.root.api]] +endpoint = "lizmap" +name = "Lizmap api" + diff --git a/tests/run-docker b/tests/run-docker index 686f7577da..5a85f3247a 100755 --- a/tests/run-docker +++ b/tests/run-docker @@ -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 "$@"