Skip to content

Allow for testing procedures that execute transaction control #354

Description

@jnasbyupgrade

If you try to test a procedure that includes transaction control statements (ie, COMMIT) using something like lives_ok() you'll get this confusing error:

died: 2D000: invalid transaction termination

The reason is that a procedure that executes transaction control establishes a "non-atomic execution context", but almost all other commands (including SELECT) establish an "atomic execution context".

The easy part of this would be to create procedure versions of useful tap functions (such as lives_ok() and throws_ok()).

The hard part would be figuring out how to get such a procedure to generate valid TAP output. RAISE is one obvious possibility, but it would depend on having client_min_messages set low enough. There'd also be an issue with the extra noise that RAISE generates.

Of course another problem would be support for xUnit / runtests() functionality.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions