Set is not empty
You expect the query to return at least one row.
Example
A typical smoke test: after a release or a data load, a table must hold at least one row.
Tests:
- Suite: Smoke Tests
Name: Table Dimension.Customer is loaded
Data Source: DWH
Query: SELECT * FROM Dimension.Customer
Expectation: set is not empty
Queries
One: Data source and Query (First data source and First query work too). A Second data source or Second query on the test is an error — the test ends with Error before anything runs.
Result
If no rows are returned, the result is Failed.
If at least one row is returned, the result is Passed.
If the underlying provider returns an exception, the result is Error.
Properties it reads
None beyond the query. The message never contains data, so Maximum errors logged has nothing to do here.
Remarks
CAT reads one row and closes the connection to the provider; it never looks at the second row.
SELECT COUNT(*) FROM SomeTable and the expectation is set is not empty, the result will always be Passed, because one row (with the number of records) is always returned.Only the query costs time; on a large table restrict it — SELECT TOP(1) … in SQL Server, LIMIT 1 in PostgreSQL, and so on.
Related
- Set is empty — the opposite check.