abn / pgtap-container

Base container for pgTAP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

pgTap Container For Testing

A pgTap enabled PostgreSQL Alpine containers, across multiple versions of postgres. These images are built on top of the Docker Hub Postgres Images.

For convenience, this image also includes the wait-for script.

Usage

The image releases are available on quay.io as well as GitHub Packages.

# Run the postgres server with tests mounted in
podman run -d --name pgtap -v `pwd`/examples/tests:/opt/pgtap/tests:z quay.io/abn/pgtap:1.3.1-pg16

# Run your tests suite
podman exec -it pgtap pg_prove -U postgres -h postgres --ext .sql -r /opt/pgtap/tests

Example: Docker Compose

# podman-compose up --renew-anon-volumes --abort-on-container-exit --exit-code-from tests tests
version: '3.7'
services:
  postgres:
    image: quay.io/abn/pgtap:1.3.1-pg16
    environment:
      POSTGRES_PASSWORD: pgtap
    ports:
      - 5432:5432

  tests:
    image: quay.io/abn/pgtap:1.3.1-pg16
    environment:
      PGPASSWORD: pgtap
    command: wait-for postgres:5432 -t 60 -- pg_prove -U postgres -h postgres --ext .sql -r /opt/pgtap/tests
    depends_on:
      - postgres
    volumes:
      - "./tests/:/opt/pgtap/tests/:z"

About

Base container for pgTAP

License:MIT License


Languages

Language:Dockerfile 100.0%