Available for PostgreSQL, Community and Team

Your database tests, in the pipeline that gates the merge.

For DevOps teams that gate merges and releases on evidence, not on a green that means nothing ran.

How to do it

Add one flag to the run you already do. The unit and integration commands both take it.

  1. Install pgTAP and plpgsql_check on the CI database; connect with UNITAUTOGEN_DSN or the PG* variables.
  2. Add --report to the default command, or to integration, and every CI report format lands in the --out folder:
unitautogen --schema public --report --out ci_out
# ci_out/  report.html  report.json  junit.xml  cobertura.xml  coverage.lcov

What lands in CI, and where it goes

Standard formats, so nothing needs a custom parser.

Gating the merge and the release

A build that proves nothing should not go green. These are the exit codes to wire to a required check.

A GitHub Action that runs on every pull request looks like this, and the same shape fits GitLab CI, Azure Pipelines or Jenkins.

jobs:
  db-tests:
    steps:
      - run: unitautogen --schema public --report --out ci_out
      - run: unitautogen seccover --schema public --sec-gate   # exits 4 on a leak
      - uses: actions/upload-artifact@v4                        # keep report.html
        with: { path: ci_out/report.html }
      - uses: codecov/codecov-action@v4                         # coverage.lcov -> the PR
        with: { files: ci_out/coverage.lcov }

The report a reviewer opens

  • One row per routine, its branch and statement coverage
  • Uncovered lines named, with why an input never reached them
  • The integration report adds one row per root, click it for the call map
  • The same generator, seed data and format for unit and integration
UnitAutogen coverage report kept as a CI build artifact

How it fits a pipeline

What platforms suggest

Running your database tests in CI is what the platform tells you to do.