Add geodatabase for acceptance tests

This commit is contained in:
Andrea Borghi 2024-10-01 11:41:36 +02:00
parent 32f6a9b633
commit fe35e23d45
No known key found for this signature in database
GPG Key ID: E0D9422E7E7902BB
4 changed files with 29 additions and 0 deletions

View File

@ -51,6 +51,10 @@ jobs:
run: (cd compose && c2cciutils-docker-logs)
if: always()
- name: Cleanup acceptance tests
run: |
make stop-acceptance-tests
# - name: Remove project jars from cached repository
# run: |
# rm -rf ~/.m2/repository/org/geoserver

View File

@ -94,3 +94,7 @@ acceptance-tests: build-acceptance
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_DATADIR_OPTIONS) up -d)
sleep 30
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_DATADIR_OPTIONS) exec -T acceptance pytest . -vvv --color=yes)
.PHONY: stop-acceptance-tests
stop-acceptance-tests: build-acceptance
(cd compose/ && TAG=$(TAG) GS_USER=$(UID):$(GID) docker compose $(COMPOSE_ACCEPTANCE_DATADIR_OPTIONS) down -v)

View File

@ -1,7 +1,25 @@
services:
geodatabase:
image: imresamu/postgis:15-3.4
environment:
POSTGRES_DB: geodata
POSTGRES_USER: geodata
POSTGRES_PASSWORD: geodata
restart: always
volumes:
- ./acceptance_pg_entrypoint:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U geodata"]
interval: 30s
timeout: 10s
retries: 5
acceptance:
image: acceptance:${TAG}
user: ${GS_USER}
depends_on:
geodatabase:
condition: service_healthy
init-datadir:
condition: service_completed_successfully
gateway:

View File

@ -0,0 +1,3 @@
\c geodata
CREATE SCHEMA IF NOT EXISTS test1;
CREATE SCHEMA IF NOT EXISTS test2;