GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - opencastsoftware/pgtap-java: A library for running pgTAP tests using Testcontainers for Java

BranchesTags
Open more actions menu

Latest commit

 

History

62 Commits
62 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
gradle
gradle
 
 
images
images
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
renovate.json
renovate.json
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

pgtap-java

CI Maven Central License

A library for running pgTAP tests using Testcontainers for Java.

A screenshot demonstrating pgTAP test results and descriptions displayed in the IntelliJ Run tool window

Installation

pgtap-java is published for Java 11 and above.

Gradle (build.gradle / build.gradle.kts):

testing {
    suites {
        val test by getting(JvmTestSuite::class) {
            dependencies {
                implementation("com.opencastsoftware:pgtap-java:0.1.0")
            }
        }
    }
}

Maven (pom.xml):

<dependency>
    <groupId>com.opencastsoftware</groupId>
    <artifactId>pgtap-java</artifactId>
    <version>0.1.0</version>
    <scope>test</scope>
</dependency>

Usage

pgtap-java is intended for use with JUnit 5 and Testcontainers for Java.

In order to run pgTAP tests with pgtap-java, you must extend the PgTapTest abstract class provided by this library.

PgTapTest requires 3 constructor parameters:

  • database: PostgreSQLContainer<?> - a Testcontainers PostgreSQL database container. This container image must have pgTAP preinstalled. See our postgres-with-pgtap Containerfile for an example of how you can do that.
  • pgTapTestPath: Path - the path to your pgTAP .sql test files
  • pgTapTmpPath: Path - the path where the pgTAP .sql test files will be mounted inside the PostgreSQL container.

In order for your tests to run, you should use withCopyFileToContainer to mount the pgTapTestsPath at pgTapTmpPath in your database container.

It doesn't matter precisely what pgTapTmpPath you use, as long as you use the same path in the constructor of PgTapTest and with withCopyFileToContainer.

See ExampleTest for an end-to-end example that uses Flyway migrations to set up a test database.

Acknowlegements

This project wouldn't exist without the work of theory, rnorth and the many pgTAP and Testcontainers contributors.

License

All code in this repository is licensed under the Apache License, Version 2.0. See LICENSE.

About

A library for running pgTAP tests using Testcontainers for Java

Topics

javapgtappostgrespostgresqltaptest-anything-protocoltestcontainerstestcontainers-java

Resources

Readme
Apache-2.0 license

Security policy

Security policy
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.