• Stars
    star
    982
  • Rank 46,621 (Top 1.0 %)
  • Language PLpgSQL
  • Created over 15 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PostgreSQL Unit Testing Suite

pgTAP 1.2.1

pgTAP is a unit testing framework for PostgreSQL written in PL/pgSQL and PL/SQL. It includes a comprehensive collection of TAP-emitting assertion functions, as well as the ability to integrate with other TAP-emitting test frameworks. It can also be used in the xUnit testing style. For detailed documentation, see the documentation in doc/pgtap.mmd or online.

PGXN version 🐘 Postgres

pgTAP must be installed on a host with PostgreSQL server running; it cannot be installed remotely.

To build it, just do this:

make
make install
make installcheck

If you encounter an error such as:

"Makefile", line 8: Need an operator

You need to use GNU make, which may well be installed on your system as gmake:

gmake
gmake install
gmake installcheck

If you encounter an error such as:

make: pg_config: Command not found

Or:

Makefile:52: *** pgTAP requires PostgreSQL 9.1 or later. This is .  Stop.

Be sure that you have pg_config installed and in your path. If you used a package management system such as RPM to install PostgreSQL, be sure that the -devel package is also installed. If necessary tell the build process where to find it:

env PG_CONFIG=/path/to/pg_config make && make install && make installcheck

And finally, if all that fails, copy the entire distribution directory to the contrib/ subdirectory of the PostgreSQL source tree and try it there without pg_config:

env NO_PGXS=1 make && make install && make installcheck

If you encounter an error such as:

ERROR:  must be owner of database regression

You need to run the test suite using a super user, such as the default "postgres" super user:

make installcheck PGUSER=postgres

If you encounter an error such as:

ERROR: Missing extensions required for testing: citext isn ltree

Install the PostgreSQL Additional Supplied Modules, which are required to run the tests. If you used a package management system such as RPM to install PostgreSQL, install the -contrib package.

Once pgTAP is installed, you can add it to a database by connecting as a super user and running:

CREATE EXTENSION pgtap;

If you've upgraded your cluster to PostgreSQL 9.1 and already had pgTAP installed, you can upgrade it to a properly packaged extension with:

CREATE EXTENSION pgtap FROM unpackaged;

If you want to install pgTAP and all of its supporting objects into a specific schema, use the PGOPTIONS environment variable to specify the schema, like so:

PGOPTIONS=--search_path=tap psql -d mydb -f pgTAP.sql

If you want to install pgTAP and all of its supporting objects into a specific schema, use the SCHEMA clause to specify the schema, like so:

CREATE EXTENSION pgtap SCHEMA tap;

Dependencies

pgTAP requires PostgreSQL 9.1 or higher.

Copyright and License

Copyright (c) 2008-2021 David E. Wheeler. Some rights reserved.

Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.

IN NO EVENT SHALL DAVID E. WHEELER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DAVID E. WHEELER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

DAVID E. WHEELER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND DAVID E. WHEELER HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

More Repositories

1

pgenv

PostgreSQL binary manager
Shell
315
star
2

pg-semver

A semantic version data type for PostgreSQL
PLpgSQL
144
star
3

flex-lemon-example

Simple example of a Flex Scanner Paired with a Lemon Parser
C
25
star
4

svn-notify

Subversion activity notification
Perl
18
star
5

semver

Semantic version object for Perl
Perl
12
star
6

kv-pair

A key/value pair data type for PostgreSQL
Makefile
11
star
7

test-simple-js

TAP-emitting JavaScript test framework
JavaScript
11
star
8

citext

Case-insensitive text type for PostgreSQL
C
11
star
9

explanation

Turn an explain plan into a table organized as a proximity tree
PLpgSQL
11
star
10

tap-parser-sourcehandler-pgtap

TAP::Parser::SourceHandler::pgTAP
Perl
11
star
11

catalyst-tutorial

My Take on the Catalyst Tutorial
Perl
10
star
12

my-cap

My Capistrano-powered sysadmin and deployment stuff
Shell
10
star
13

pg-hostname

Function to get the PostgreSQL server host name
PLpgSQL
9
star
14

theory

Profile readme
9
star
15

text-markup

Parse files in many different text markup formats into HTML.
Perl
9
star
16

pg-hash64

Generate 64-bit hash integers from PostgreSQL strings
C
8
star
17

colnames

Lists the column names in a PostgreSQL RECORD value
C
8
star
18

justatheory

Just a Theory
HTML
7
star
19

fsa-rules

Build simple rules-based state machines in Perl
Perl
6
star
20

module-build-jsan

Build a JSAN distribution with Module::Build
Perl
5
star
21

check_perl_modules

Nagios plugin verifying that the latest versions of all Perl modules are installed
Perl
5
star
22

tddd

“Test Driven Database Development”, OSCON 2010 Tutorial
5
star
23

circle

IRC logging, search, and paste
Perl
4
star
24

pg-priv

PostgreSQL ACL parser and iterator
Perl
4
star
25

postgres-xc-rpm

Spec file and supporting files to generate Postgres-XC RPMs
C
4
star
26

tap-parser-sourcehandler-mytap

Stream TAP from MyTAP test scripts
Perl
4
star
27

Buzzalot

Asynchronous messaging on the iPhone and iPod Touch.
Objective-C
3
star
28

activitymail

CVS activity notification
Perl
3
star
29

DFURLRegularExpression

URL-matching regular expressions
Objective-C
3
star
30

markover

The beginnings of an experimental Lemon-based Markdown Parser
C
3
star
31

pgadmin3

Fork of the PGAdmin III project
C++
2
star
32

gtin

A GTIN (bar code) data type for PostgreSQL
C
2
star
33

pg_meta

2
star
34

pgagent

PGAdmin
C++
2
star
35

class-meta

Class automation, introspection, and data validation
Perl
2
star
36

encode-zapcp1252

Zap Windows Western Gremlins
Perl
2
star
37

apache-faketable

Pure Perl implementation of the Apache::Table interface.
Perl
2
star
38

apache-dir

Simple Perl Version of mod_dir
Perl
2
star
39

app-info

Information about software packages on a system
Perl
2
star
40

winperl-travis

Experimenting with testing a Perl project on a Travis CI Windows Host
Perl
2
star
41

time-piece-iso

ISO 8601 Subclass of Time::Piece
Perl
2
star
42

svn-notify-filter-markdown

Convert SVN::Notify log messages from Markdown to HTML
Perl
1
star
43

pgxn-action

GitHub action to build and release PGXN extensions
Shell
1
star
44

crab-utils

In which I write variants of Coreutils to learn Rust
Rust
1
star
45

query-punq

Perl's Unique Query language (Experimental)
Perl
1
star
46

plack-middleware-tweakenv

Tweak the Plack environment
Perl
1
star
47

masonx-interp-withcallbacks

Mason callback support via Params::CallbackRequest.
Perl
1
star
48

Bundle-Theory

A bundle to install all of Theory's favorite modules
Perl
1
star
49

widget-meta

Metadata for user interface widgets
Perl
1
star
50

lingua-strfname

Formats people's names
Perl
1
star
51

Versioning

Versioning of changes to database
1
star
52

object-relation

Experimental Advanced Object Relational Mapper
Perl
1
star
53

text-markover

Experimental Markdown Parser Implemented with HOP
Perl
1
star
54

dist-zilla-localetextdomain

Locale::TextDomain support for Dist::Zilla
Perl
1
star
55

module-build-db

Build and test database-backed Perl applications
Perl
1
star
56

class-meta-express

Concise, expressive creation of Class::Meta classes
Perl
1
star
57

template-declare-bricolage

Perlish XML Generation for Bricolage's SOAP API
Perl
1
star
58

http.query

Easy GET query string management in JavaScript
JavaScript
1
star
59

ipc-simple

Simple File‐handle based command execution, with detailed diagnostics
Perl
1
star
60

params-callbackrequest

Functional and object-oriented callback architecture
Perl
1
star