Skip to content

Commit

Permalink
Add geodatabase for acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danduk82 committed Oct 1, 2024
1 parent 32f6a9b commit fe35e23
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 18 additions & 0 deletions compose/acceptance.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
3 changes: 3 additions & 0 deletions compose/acceptance_pg_entrypoint/001_create_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\c geodata
CREATE SCHEMA IF NOT EXISTS test1;
CREATE SCHEMA IF NOT EXISTS test2;

0 comments on commit fe35e23

Please sign in to comment.