Skip to content
arkadiusjonczekPublic

About

Use Gherkin to write plain-text, human-readable test cases for your PostgreSQL data. πŸ“πŸ‘¨πŸ»β€πŸ’»

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

pgcumber

Release Pipeline Status Release Version License Commit Activity Last Commit Downloads Docker Pulls

Use Gherkin to write plain-text, human-readable test cases for your PostgreSQL data:

Feature: PostgreSQL admin user permissions

  Scenario: The user admin is a superuser on the pgcumber database

    Given The host "localhost"
    And   The port "5432"
    And   The database "pgcumber"

    When  I use username "admin"
    And   I use password "admin"
    And   I connect to the server

    Then  the connection is successful
    And   I am a database superuser

and test it against your PostgreSQL database using pgcumber:

pgcumber features/user/admin.feature

Take a look at the available Steps and the Features to have a better understanding.

Installation

Use homebrew to install pgcumber on macOS or Linux.

Or just download the binary from the releases page for your operating system and architecture.

Homebrew

You can install the homebrew formula, which builds the binary from the source code.

First add one tap to homebrew:

brew tap pgcumber/formula

Then you have to trust the homebrew tap:

brew trust pgcumber/formula

Then you can install the command:

brew install pgcumber

Usage

Use pgcumber and add the feature file:

pgcumber features/user/admin.feature

or directory path as argument:

pgcumber features/

Warning

If you use macOS and you download the binary, you might need remove to the assigned quarantine attribute:

xattr -d com.apple.quarantine pgcumber

This is not necessary if you install pgcumber with homebrew which build it from the source.

Docker

You can also use the Docker image from Docker Hub to run pgcumber as container:

docker run \
  --interactive \
  --tty \
  --rm \
  --volume "$(pwd)/features:/data/pgcumber/features" \
  --network host \
  arkadiusjonczek/pgcumber /data/pgcumber/features

Docker Test Environment

Use the docker compose file docker-compose.yaml to start PostgreSQL:

docker-compose up -d

Then use pgcumber and the feature file features/user/admin.feature:

pgcumber features/pgcumber.feature

After your tests you can stop the docker environment again:

docker-compose down

Background

The implementation is based on godog which is cucumber for golang.

About

Use Gherkin to write plain-text, human-readable test cases for your PostgreSQL data. πŸ“πŸ‘¨πŸ»β€πŸ’»

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages