Skip to content

Commit

Permalink
Tests: enhancing to provide demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Aug 27, 2024
1 parent be8229d commit ad1707b
Show file tree
Hide file tree
Showing 6 changed files with 4,019 additions and 8 deletions.
21 changes: 18 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ LIZMAP_USER_ID:=$(shell id -u)
LIZMAP_USER_GID:=$(shell id -g)

LIZMAP_VERSION_TAG:=3.7
QGIS_VERSION_TAG:=3.28
POSTGIS_VERSION_TAG:=14-3
QGIS_VERSION_TAG:=3.34
POSTGIS_VERSION_TAG:=15-3

QGIS_MAP_WORKERS:=1

Expand Down Expand Up @@ -58,7 +58,7 @@ env: dirs
EOF

run: stop env install-plugins
docker compose up
docker compose up -d

stop:
docker compose down || true
Expand All @@ -77,6 +77,21 @@ pull:
shell:
docker compose exec -u ${LIZMAP_USER_ID} lizmap /bin/sh -l

import-test-data:
export PGPASSWORD=lizmap1234!; psql -h localhost -U lizmap -d lizmap -p 9018 -f sql/test_data.sql

import-lizmap-acl:
@echo "Set repositories and users rights if needed"
@echo "Set view project"
docker compose exec -u $(LIZMAP_USER_ID) lizmap /bin/sh -c ' \
php lizmap/console.php acl2:add __anonymous "lizmap.repositories.view" mapbuilder ; \
php lizmap/console.php acl2:add users "lizmap.repositories.view" mapbuilder ; \
php lizmap/console.php acl2:add admins "lizmap.repositories.view" mapbuilder'
@echo "Set mapbuilder access"
docker compose exec -u $(LIZMAP_USER_ID) lizmap /bin/sh -c ' \
php lizmap/console.php acl2:add __anonymous "mapBuilder.access" ; \
php lizmap/console.php acl2:add users "mapBuilder.access"'

install-module:
docker compose exec -u ${LIZMAP_USER_ID} lizmap php /www/lizmap/install/configurator.php mapBuilder
docker compose exec -u ${LIZMAP_USER_ID} lizmap php /www/lizmap/install/configurator.php mapBuilderAdmin
Expand Down
28 changes: 23 additions & 5 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,41 @@
Steps:

- clean previous versions (optional)
```

```bash
make clean
```

- Launch Lizmap with docker compose
```

```bash
make run
```

If you want to use a specific version of Lizmap (for example a local docker image),
indicate the version of the docker image into `LIZMAP_VERSION_TAG`:
```

```bash
make run LIZMAP_VERSION_TAG=3.6.0-rc.3-98b5cb4ce
```
- Then install modules

- Add the test data
```bash
make import-test-data
```

- Then install modules

```bash
make install-module
```

- Finally, add the needed Lizmap rights with some mapbuilder rights

```bash
make import-lizmap-acl
```

- Open your browser at `http://localhost:9016`

For more information, refer to the [docker compose documentation](https://docs.docker.com/compose/)
Expand Down Expand Up @@ -70,5 +88,5 @@ psql service=lizmap-mapbuilder

## Access to the lizmap container

If you want to enter into the lizmap container to execute some commands,
If you want to enter into the lizmap container to execute some commands,
execute `make shell`.
Loading

0 comments on commit ad1707b

Please sign in to comment.