Create a project file
A project file is a text file; every CAT tool creates one for you from a template, and CAT Studio writes one when you save. Pick your tool.
On this page
A CAT project is one file, <name>.cat.yaml, that names the data sources, the tests and the outputs — see the Project file reference for everything it can hold. It is plain text; you can write it in any editor and soon will. To start, let a tool create one from the default template: one data source, one test, nothing else.
CAT Studio does not start from a template — it starts from an empty project and writes the file when you save:
- On the Project page click Create new project (or press
Ctrl+N). - Add a data source (Project or Data sources page → New data source): a name, the technology, the connection details.
- On the Tests page click Add a test, write the query, pick the expectation, give the test a name.
- Press
Ctrl+S: CAT Studio asks where to save and writes<name>.cat.yaml.
The file is an ordinary project file — open it in an editor with Ctrl+Shift+E and you see the same YAML the other tabs show. CAT Studio reads and writes that file from then on; anything you edit in the file shows up in Studio after a reload (Ctrl+Shift+F6).
catcli new --name MyFirstProject
creates MyFirstProject.cat.yaml in the current directory. --directory puts it elsewhere, --commented gives you the variant with every setting explained inline, --list shows the templates — see new.
New-CatProject MyFirstProject
creates MyFirstProject.cat.yaml in the current location. -Path puts it elsewhere, -Commented gives you the variant with every setting explained inline, Get-CatProjectTemplate lists the templates — see New-CatProject.
import justcatit as cat
cat.new_project("MyFirstProject")
creates MyFirstProject.cat.yaml in the current directory. path= puts it elsewhere, commented=True gives you the variant with every setting explained inline, get_project_templates() lists the templates — see new_project.
What you get
The default template, stripped of its comments:
Data sources:
- Name: DWH
Provider: SqlServer@1
Connection string: data source=localhost;integrated security=true;initial catalog=DWH
Tests:
- Name: No new errors in the ErrorLog table
Description: >
We are aware about errors in the past, but we do not expect new ones.
If this test fails, it is necessary to check the dbo.ErrorLog table content.
Data source: DWH
Query: |
SELECT TOP 20 *
FROM dbo.ErrorLog
WHERE ErrorThrownOn >= '20240131'
ORDER BY ErrorThrownOn
Expectation: set is empty
Point the connection string at your data — through an environment variable, never a password in the file — change the query and the expectation, and run it. What each key accepts: Data source properties, Test properties, Outputs.
Related
- Project file — the reference, with a complete example.
- Organize a growing test base — when one file stops being enough.