What is Unit Testing/ Data Validator/ Data Tests/Results Validator?

Knowledge Drop

Last Tested: Sep 24, 2019

All three of these names refer to the same feature, which is called “data tests” (formerly referred to as unit testing). This is a feature released as part of Looker 6, generally available on version 6.20.

This is essentially Unit testing for LookML, where you write a query, assert that the query’s result is expected! You can create data tests in model filesview files, or in separate, dedicated data test files.

Below is an example of implementation:

test: test_there_are_users { explore_source: users { column: count {} } assert: there_is_data { expression: ${users.count} > 100 ;; }}

More detail here:
https://docs.looker.com/reference/model-params/test?version=6.20

https://docs.google.com/document/d/1G3fLBZduZwCURi9BOvYOMdFsssHQOlXga2MSP7UHvd0/edit#

This content is subject to limited support.                

Version history
Last update:
‎04-05-2021 03:32 PM
Updated by: