Test your project¶
Test your data project before deploying to Tinybird Cloud. Use this guide to validate deployments, load fixture data, call local ingest APIs, and run YAML test suites.
You can validate and test with these workflows:
- Check the deployment before creating it.
- Create fixture files in your project.
- Ingest sample data through local APIs.
- Run and update YAML tests with
tb test.
Check deployment¶
After finishing development, run tb deploy --check to validate the deployment before creating it.
tb deploy --check
Connection checks¶
When you run tb deploy --check (local) or tb --cloud deploy --check (cloud), Tinybird validates external connections to S3, Kafka, GCS, and databases referenced via table functions.
For local checks:
- Use tb secret set to store connection secrets.
- If you use S3 locally, start Tinybird Local with
tb local start --use-aws-creds.
Fixture files¶
Fixtures are sample files stored in the fixtures/ folder.
my-app/ ├─ datasources/ │ ├─ user_actions.datasource │ └─ ... ├─ fixtures/ │ ├─ user_actions.ndjson │ └─ ...
Create fixtures manually. For example:
cat > fixtures/user_actions.ndjson <<'EOF'
{"timestamp":"2026-01-01 00:00:00","action":"CLICKED","user_id":"u_1"}
{"timestamp":"2026-01-01 00:01:00","action":"VIEWED","user_id":"u_2"}
EOF
When fixture files match the data source name (for example, fixtures/user_actions.ndjson for datasources/user_actions.datasource), tb build loads them automatically.
If you use custom fixture filenames, append them manually:
tb datasource append user_actions --file fixtures/custom_user_actions.ndjson
Call the ingest APIs¶
You can also test by calling local ingest APIs:
- Send events to the local Events API.
- Ingest files through the Data Sources API.
Get a token with tb token ls, then call your local endpoint:
curl \
-X POST 'http://localhost:7181/v0/events?name=<your_datasource>' \
-H "Authorization: Bearer <your_token>" \
-d $'<your_data>'
Create a test suite¶
Create test YAML files manually in the tests/ folder.
Example tests/user_action_insights_widget.yaml:
- name: user_action_insights_widget_clicked
description: Returns user actions filtered by CLICKED
expected_http_status: 200
parameters: action=CLICKED
expected_result: |
{"action":"CLICKED", "user_id":"u_1"}
Then run tests:
tb test run
To refresh expected results for a test file or resource:
tb test update user_action_insights_widget
Copy Pipes write into target data sources instead of returning rows directly. To test them:
- Create a YAML test file for the copy pipe in
tests/. - Run
tb copy run <copy_pipe>to populate the target data source. - Run
tb test update <copy_pipe>to capture expected results.
Next steps¶
- Make changes to your data sources and test them. See Evolve data sources.
- Learn more about deployments.
- Learn about datafiles, like
.datasourceand.pipefiles. See Datafiles.