Set up a test in the editor
Every field of the test editor, including setup SQL and extraction.
In short
The test editor holds everything a test runs with: what to execute, its parameters, checks, transaction mode, timeout and how many rows to read. "Run now" runs the draft without saving, so you can click cells to add checks first.
Before you start
- Who: changing a test needs Edit on the project.
- Plan: SQL Tester is part of every plan, Free included. Your plan sets your runs, projects and environments (Plan & usage shows them). Production execution and load testing are on the paid plans.
- First: choose the environment, or leave it on the project default.
Steps
- Open the editor: press "New test", click a test's name, use "Save as test", or "New test" on a Catalog row.
- Set the name, test group, kind and environment (or "Project default").
- Write the SQL, or name the schema and object - after a catalog sync you can pick it from every object.
- Add parameters and checks, choose the transaction mode, and press "Run now" to try it.
- Press "Save test".
The fields
Good to know
- Description (under Advanced): free text for the team.
- "Setup SQL" and "Teardown SQL" run before and after the statement in the same transaction, so a rollback cleans up. Insert what the test needs in Setup, check, and let the rollback finish.
- "Extract values" copies a value into a variable for a later test.
- Rows are shown when a run finishes and are not stored.
If something goes wrong
- "That object is not in the synced catalog - sync the environment first."
- "Timeout must be between 1 and 300 seconds." / "Captured rows must be between 1 and 1000."
- "Parameter name … is not allowed - use letters, digits and underscores, optionally after a leading @."
Related
- /help/sql-tester/assertions
- /help/sql-tester/variables-and-chaining
- /help/sql-tester/what-a-run-keeps