Supabase mode

Add --supabase to any of the five commands and run it from inside your Supabase project, the folder that has supabase/config.toml.

What it does for you

  • Finds the project from supabase/config.toml and connects to the local database reported by supabase status.
  • Defaults --schema to public.
  • Writes the generated pgTAP into supabase/tests/seccover/, where supabase test db already looks.
  • Enables pgTAP once, through a first-ordered 000-setup-pgtap hook, so the suite runs on a clean database.
  • On a re-run, replaces only its own generated files and leaves your hand-written tests untouched.

So the tests you generate are the tests your Supabase test run executes, with nothing to copy, wire up or keep in sync.

One command per module

Run from the project root. The paid modules pick up your licence automatically.

cd my-supabase-project

unitautogen --supabase --schema public               # unit tests (free)
unitautogen --supabase integration --schema public   # integration (Team)
unitautogen --supabase seccover --schema public      # security coverage (Enterprise)
unitautogen --supabase pii --schema public           # PII in errors (Enterprise)
unitautogen --supabase hipaa --schema public         # HIPAA evidence (Enterprise)

supabase test db                                     # Supabase runs everything above

Where each command writes

CommandWrites to
default (unit)supabase/tests/seccover/unit/
integrationsupabase/tests/seccover/integration/
seccoversupabase/tests/seccover/security/
piisupabase/tests/seccover/pii_tests/pii_findings.json, a findings report, not pgTAP tests
hipaasupabase/tests/seccover/hipaa/<schema>/hipaa_report.html, with its security tests in security/. It also turns on the Supabase Storage check, --storage.

The pii module produces findings, not tests of its own. It still emits the seccover security tests, which supabase test db runs.

Any of UNITAUTOGEN_DSN, TESTGEN_DSN, DATABASE_URL or PGHOST in the environment replaces the supabase status database. Unset a leftover DATABASE_URL before a Supabase run.