Find untested objects with the catalog
Sync an environment, see coverage per object and generate boundary tests and data checks.
In short
The catalog lists every stored procedure, function, view and table an environment exposes, with its test coverage - so you can see which have no test. From a row you open a new test, generate boundary tests for a routine or generate data checks for a table or view.
Before you start
- Who: anyone who can see the project can browse the catalog. A new test, generated boundary tests or generated data checks need Edit.
- Plan: a sync opens a connection, so it counts toward the 30-a-minute limit. Generated tests each count as a run when they run.
- First: an environment you can reach (see /help/sql-tester/connections-and-environments).
Sync and browse
- Open the "Catalog" tab and choose an environment, or keep "Every environment".
- Press "Sync now". A message says how many objects were found, how many are new and how many are gone.
- Search by name, or filter by kind and coverage: Never run, Passing or Failing.
- Press "New test" on a row to open the editor with the object and parameters filled in.
Generate boundary tests
- On a stored procedure or function row, press "Generate boundary tests".
- A happy-path test with typical values is made, plus one test per edge value of each input parameter, up to 60 per click.
- Find them in a test group named after the object, tagged Generated.
- Add Error raised or No error to each one to say which outcome is right.
Generate data checks
- On a table or view row, open the row's menu and press "Generate data checks".
- One check says the table has rows; one check per column that may be empty says no row leaves it empty. Up to 60 per click.
- Each check is a query that counts on the database, so it judges the whole table, not only the rows a run keeps.
- Find them in a test group named after the table, tagged Generated. The table now counts as covered.
- Keep the checks whose rule must hold for your data and delete the ones where an empty table or empty values are fine.
- Press it again after a new column appears: only checks the project does not hold yet are added.
Good to know
- Sync reads only metadata - names, parameters and columns. It runs nothing and reads no rows, so it is safe on any tier, including Production. It opens a connection, so it counts toward the 30-a-minute limit.
- Anyone who can see the project can browse the catalog.
- Only the happy path has a check. Edge tests pass when the server raises no error until you add one.
Generated tests really run They call the real procedure with NULL, huge numbers and long strings. They roll back, but they run, and each counts toward your run limit. Try them on Local, Development or QA first.
If something goes wrong
- "Catalog sync failed: …": the message names the cause; test the environment's connection.
- "Data checks are written for PostgreSQL, SQL Server, MySQL, MariaDB and SQLite connections.": other databases get boundary tests for routines only.
Related
- /help/sql-tester/assertions
- /help/sql-tester/case-editor
- /help/sql-tester/insights