Expand description
Test command — run unit tests against the database.
Executes EXECUTE UNIT TEST statements attached to project objects
against a Materialize instance spun up in Docker. The pipeline:
- Load — Compile the project and optionally load/generate type metadata.
- Filter — Select tests matching the user’s filter pattern (supports
database.schema.object#test_namewith wildcards at any level). - Connect — Establish a database connection to the target environment.
- Execute — For each test: locate the target view, desugar the test into SQL, execute setup statements, run the assertion query, and classify the result.
- Report — Print pass/fail output and, when requested, produce a JUnit XML report.
§Outcome Classification
- Passed — Assertion query returned zero rows (no mismatches).
- Failed — Assertion query returned rows (missing or unexpected data) or a runtime error occurred during execution.
- ValidationFailed — Test definition is invalid (bad target, malformed
AT TIME, etc.). Tracked separately so summary output distinguishes broken definitions from runtime failures.