diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4e2ed3a36..e387d320e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 diff --git a/Makefile b/Makefile index e62b6cdb0..7383feb16 100644 --- a/Makefile +++ b/Makefile @@ -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) \ No newline at end of file diff --git a/compose/acceptance.yml b/compose/acceptance.yml index a8f48dd82..e6d35fa98 100644 --- a/compose/acceptance.yml +++ b/compose/acceptance.yml @@ -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: diff --git a/compose/acceptance_pg_entrypoint/001_create_schemas.sql b/compose/acceptance_pg_entrypoint/001_create_schemas.sql new file mode 100755 index 000000000..230f04cfc --- /dev/null +++ b/compose/acceptance_pg_entrypoint/001_create_schemas.sql @@ -0,0 +1,3 @@ +\c geodata +CREATE SCHEMA IF NOT EXISTS test1; +CREATE SCHEMA IF NOT EXISTS test2; \ No newline at end of file