[tap-l] ANN: pgTAP 0.21

David E. Wheeler david at kineticode.com
Fri May 29 01:31:54 GMT 2009


Fellow Testers,

I'm pleased to announce the release of pgTAP 0.21, now available for  
download on [pgFoundry](http://pgfoundry.org/frs/?group_id=1000389).  
I've updated the [documentation](http://pgtap.projects.postgresql.org/documentation.html 
) on the Web site, as well.

What is pgTAP? It's a unit testing framework for PostgreSQL. See the  
[Web site](http://pgtap.projects.postgresql.org/) for the gory details.
This release follows several days of compulsive hacking following the  
success of my [PGCon presentation](http://www.pgcon.org/2009/schedule/events/165.en.html 
) and the testing BOF. In particular, Norman Yamada remarked in [his  
talk](http://www.pgcon.org/2009/schedule/events/146.en.html) that his  
team was using pgTAP to validate schemas following replication. I had  
also been asked to write functions to make sure that a list of objects  
in a database were exactly those that should be there. So I went to  
work adding a slew of new assertion functions to test such things.  
They include:

* tablespaces_are()
* schemas_are()
* tables_are()
* views_are()
* sequences_are()
* indexes_are()
* functions_are()
* users_are()
* groups_are()
* languages_are()
* opclasses_are()
* rules_are()

Check 'em out! I also added a bunch of new assertion functions for  
testing functions, performance regressions, languages, operator  
classes, and rules. Here's a complete list of changes:

Revision history for pgTAP
==========================

0.21 2009-05-29T00:04:31
-------------------------
* Fixed a bug in the processing of the `--schema` and `--match` options
  that only shows up in Getopt::Long 2.38 or higher.
* A few doc and test typos fixed thanks to Gabrielle Roth.
* Fixed failing test on Solaris 10 on Intel thanks to Gabrielle Roth.
* Fixed a failing test for the version number string on 8.4 beta.
* Added `performs_ok()`.
* Added `has_language()`, `hasnt_language()`, and
  `language_is_trusted()`.
* Added `has_opclass()` and `hasnt_opclass()`.
* Added `has_rule()`, `hasnt_rule()`, `rule_is_instead()`, and
  `rule_is_on()`.
* Added `tablespaces_are()`, `schemas_are()`, `tables_are()`,
  `views_are()`, `sequences_are()`, `functions_are()`, `indexes_are()`,
  `users_are()`, `groups_are()`, `opclasses_are()`, `languages_are()`,
  and `rules_are()`.
* Added a `has_trigger(table, trigger, description)`. Note that this
  means that if you were previously using `has_trigger(schema, table,
  trigger)`, you will need to cast the third argument to `NAME` to get
  it working again.
* Changed `can_ok()` to `has_function()`, so that it's named like all of
  the other functions that check for the presence of database objects.
  The old `can_ok()` function is still available as an alias, but it
  emits a warning and will be removed in a future version of pgTAP.
* Added `hasnt_trigger()`, `hasnt_index()`, and `hasnt_function()`.
* Added `function_lang_is()`, `function_returns()`, `is_definer()`,
  `is_aggregate()`, `is_strict()`, and `volatility_is()`.

0.20 2009-03-29T19:05:40
-------------------------

* Changed the names of the functions tested in `sql/do_tap.sql` and
  `sql/runtests.sql` so that they are less likely to be ordered
  differently given varying collation orders provided in different
  locales and by different vendors. Reported by Ingmar Brouns.
* Added the `--formatter` and `--archive` options to `pg_prove`.
* Fixed the typos in `pg_prove` where the output of `--help` listed
  `--test-match` and `--test-schema` instead of `--match` and
  `--schema`.
* Added `has_cast()`, `hasnt_cast()`, and `cast_context_is()`.
* Fixed a borked function signature in `has_trigger()`.
* Added `has_operator()`, `has_leftop()`, and `has_rightop()`.
* Fixed a bug where the order of columns found for multicolum indexes by
  `has_index()` could be wrong. Reported by Jeff Wartes. Thanks to
  Andrew Gierth for help fixing the query.

Enjoy!

David



More information about the tap-l mailing list