Create first test
OK, I want my test against my data now.
On this page
If you followed the tutorial, you now have CAT Studio running and you can create new projects from templates.
So, what do you need to do to create your first test against your data?
Create a New Project
Open CAT Studio. Create a new project based on Default template. Keep the name “TestMyData”, or change it if you want. CAT will create a folder “TestMyData” and a file “TestMyData.cat.yaml” in the folder of your choice (by default inside CAT folder in your Documents folder).
Locate the generated .cat.yaml
file on your file-system. We call that file CAT project file. Open it in your favourite text editor (NOT in MS Word!).
For editing the configuration, we highly recommend free Visual Studio Code with YAML extension.
Add a Data Source
This is the only advanced and tricky thing - but you do this only once. First, locate this section in the project file:
Here you tell CAT where your data physically is.
First, give it a friendly name. Change “DWH” in the example to something short that describes what the data you are about to test represent (CRM, Accounting, …).
Second, in Provider:
, set what is the “format” of the data. It must be one of those mentioned in the Provider’s documentation.
You also need to provide a Connection string
. See examples in our documentation for the provider of your choice. Change server name, database name, port and other settings to match the connection settings of your database. Ask your database administrator for assistance, if needed.
Never store passwords in the connection string. CAT supports “environment variables”. Anything in your connection string (or the entire connecion string) can be “hidden” in an enviornment variable. It may look like:
Connection string: "%MY_ENVIRONMENT_VARIABLE_NAME%"
Automate a Test
And now the fun part - let’s add a test. Once you have your data sources configured, you’ll be doing only this - adding new tests.
Name:
Provide a descriptive name for your test.
Description:
is optional, but highly recommended - if the test fails in 3 months time (such things really happen) - what would you remind yourself to do to fix it?o
Data Source:
here you specify that friendly name you gave to your data source
Query:
put your SQL/DAX statement
Expectation:
we recommend to start with set is empty
(test passes when your SQL does not return anyting) or set is not empty
(test passes when your SQL returns at least one row) expectations - they are intuitive and supper simple. You’ll learn more of them later.
Run the Test
If you have CAT studio stil open, just hit “Reload Tests” button on the “Test” page. Run the test and explore the results. If the result is Passed
or Failed
, congratulations! You just fully automated your first test against your data. If not, contact us (you may use Feedback button on this page), we’ll help you out.
In this introduction, you learned how to install and use CAT Studio. You created and ran a sample project and you created your very first test. What now?