File Release Notes and Changelog

Release Name: 0.11

Release Notes

pgTAP 0.11
==========

pgTAP is a collection of TAP-emitting unit testing functions written in
PL/pgSQL and PL/SQL. It is based on the Test::More module distributed with
Perl 5. You could even consider it a port of sorts.

pgTAP 0.11 improves compatibility with PostgreSQL 8.0 and 8.1, and adds the following new test functions:

* todo_start()
* todo_end()
* in_todo()
* can()
* can_ok()

See the change log for more detail.

Change Log

Revision history for pgTAP

0.11  2008-09-24T20:41:42
      - Simplified the tests so that they now load `test_setup.sql` instead of
        setting a bunch of stuff themselves. Now only `test_setup.sql` needs
        to be created from `test_setup.sql.in`, and the other `.sql` files
        depend on it, meaning that one no longer has to specify `TAPSCHEMA`
        for any `make` target other than the default.
      - Eliminated all uses of `E''` in the tests, so that we don't have to
        process them for testing on 8.0.
      - Fixed the spelling of `ON_ROLLBACK` in the test setup. Can't believe I
        had it with one L in all of the test files before! Thanks to Curtis
        "Ovid" Poe for the spot.
      - Added a couple of variants of `todo()` and `skip()`, since I can never
        remember whether the numeric argument comes first or second. Thanks to
        PostgreSQL's functional polymorphism, I don't have to. Also, there are
        variants where the numeric value, if not passed, defaults to 1.
      - Updated the link to the pgTAP home page in `pgtap.sql.in`.
      - TODO tests can now nest.
      - Added `todo_start()`, `todo_end()`, and `in_todo()`.
      - Added variants of `throws_ok()` that test error messages as well as
        error codes.
      - Converted some more tests to use `check_test()`.
      - Added `can()` and `can_ok()`.
      - Fixed a bug in `check_test()` where the leading whitespace for
        diagnostic messages could be off by 1 or more characters.
      - Fixed the `installcheck` target so that it properly installs PL/pgSQL
        into the target database before the tests run.

0.10  2008-09-18T22:59:31
      - Changed `pg_prove` to set `QUIET=1` when it runs, so as to prevent the
        output of extraneous stuff.
      - Added some `GRANT` statements to `plan()` in order to make it easier
        to run tests using roles other than the one that called `plan()`.
        Patch from Rod Taylor.
      - Replaced a call to `lastval()` with a call to `currval()` in order to
        improve compatibility with PostgreSQL 8.0. Reported by David Westbrook.
      - Added support for TODO and SKIP tests.
      - Removed the few uses of named parameters and added alias names instead.
        This improves compatibility for versions of PostgreSQL prior to 8.0.
        Reported by David Westbrook.
      - Fixed the plural of "test" in the output from `finish()`. It was
        plural when there was one test and singular otherwise. So I reversed
        that.
      - Moved assignment to declared variables from the `DECLARE` block to the
        body of the functions. Improves compatibility with versions of
        PostgreSQL prior to 8.0. Reported by David Westbrook.
      - Eliminated passing the result of a function call to `RAISE` in order
        to better support older versions of PostgreSQL. Reported by David
        Westbrook.
      - Switched from using `FOUND` to `GET DIAGNOSTICS ROW_COUNT` because the
        former does not seem to be set for `EXECUTE` SQL in older versions of
        PostgreSQL. Reported by David Westbrook.
      - Added tests specifically targeting PostgreSQL 7.3. From David
        Westbrook.
      - Ported all the way back to PostgreSQL 8.0, thanks to some Makefile
        hackery and a patch file. All tests pass on 8.0, 8.1, 8.2, and 8.3.
        The only exception is `throws_ok()` and `lives_ok()`, which are not
        supported on 8.0. Versions of PostgreSQL lower than 8.0 are not yet
        supported, even though we have made some changes to simplify getting
        things to work in earlier versions.
      - Changed "got/expected" to "have/want", following Schwern's plans for
        Test::Builder 2. Also changed "caught/expected" to "caught/wanted" for
        nice parity when outputting diagnostics for exception testing.
      - Added the `has_table()`, `has_view()`, `has_column()`, `has_pk()`,
        `has_fk()`, `fk_ok()`, `has_unique()` and `has_check()` test
        functions.
      - Added the `col_not_null()` and `col_is_null()` test functions.
      - Added the `col_type_is()`, `col_default_is()`, `col_is_pk()`,
        `col_is_fk()`, `col_is_unique()`, and `col_has_check()` test
        functions.
      - Fixed `is()` and `isnt()` to better handle NULLs.
      - Added `cmp_ok()`.
      - Added the `--set ON_ERROR_STOP=1` option to the call to `psql` in
        `pg_prove`.
      - Renamed `drop_pgtap.sql.in` to `uninstall_pgtap.sql.in`, which is more
        in line with typical PostgreSQL contrib modules.
      - Removed verbose output of the `psql` command from `pg_prove`. Thanks
        to Andy Armstrong for the spot.
      - Divided the tests up into many separate test script files, so that
        things are a bit better organized and easier to maintain.
      - Added the `check_test()` function and started converting internal
        tests to use it instead of the hacked stuff they were doing before.
      - As in Test::Builder 0.81_01, changed the message for extra tests run
        to show the number of tests run rather than the number extra to avoid
        the user having to do mental math.
      - The regression test files are now processed by `make installcheck` and
        `make test` so that the schema can be properly set, if pgTAP is built
        with a schema.

0.02  2008-06-17T16:26:41
      - Converted the documentation to Markdown.
      - Added pg_prove, a Perl script that use TAP::Harness to run tests and
        report the results, juse like the Perl program `prove`.
      - Fixed `no_plan()` so that it no longer emits a plan, which apparently
        was wrong. Now `finish()` outputs it when there's no plan.
      - Fixed the test script so that it now emits a proper plan.
      - Removed all of the configuration settings from `pgtap.sql`, as they're
        now handled by `pg_prove`. I've mengioned them in the README for
        reference.
      - Added `lives_ok()`.
      - Moved the creation of temporary tables into `plan()`, so that
        everything is properly self-contained.
      - Improved the handling of transactions. Test scripts are now assumed to
        be single transactions with a ROLLBACK at the end. This makes it so
        that test scripts don't have to include `drop_pgtap.sql`.
      - Updated `pg_prove` to rollback on an error, rather than just stop.
        This allows all test functions to be properly rolled back, too, in a
        test script that includes them but then encounters an unhandled
        exception.
      - Updated `pg_prove` to emit an appropriate error message if no test
        scripts are specified.
      - Added a Makefile. It uses the typical PostgreSQL installation
        procedures to install pgTAP. The SQL files have now been turned into
        `.in` templates that are processed by `make`.
      - Added support for schema qualification of test functions. Just set the
        `$TAPSCHEMA` environment variable when running `make`.
      - Added support for standard PostgreSQL-type regression testing by just
        copying the test script, setting some variables inside it, and
        providing an `expected/` directory. The test now lives in the `sql/`
        directory.
      - Changed all instances of `RETURN QUERY SELECT` to `RETURN NEXT`, which
        should allow pgtap to run on versions of PostgreSQL earlier than 8.3.
        Thanks to Neil Conway for the suggestion.

0.01  2008-06-07T05:24:27
      - Initial public release. Announcement at
        http://justatheory.com/computers/databases/postgresql/introducing_pgtap.html
Powered By FusionForge