Within Spectacles, you can run all data tests for your project using the Assert validator.
Running the Assert validator
To run the Assert validator, you must specify the LookML project and Git branch to test in addition to your API credentials. As with your API credentials, these can be set via the command line (
--branch), environment variables (
LOOKER_GIT_BRANCH), or a YAML file.
Once the desired project and branch have been set, run Assert validation as follows:
spectacles assert \ --base-url https://company_name.looker.com \ --client-id HpB53crD3DMDkdJPCRc \ --client-secret jDRSM6ZGG9D5WH3r5FynQ9c \ --project thelook \ --branch dev-john-doe-294a
spectacles assert --config-file looker_configuration.yml
In the next section, we’ll learn how to deploy Spectacles in a production continuous integration pipeline.
If every Explore passes, the Assert validator will exit with code 0. If any test fails, it will exit with code 102.👉 Next: Deploying