tb test

Generates and runs tests. The following subcommands are available:

CommandDescription
create [OPTIONS]Creates a test in YAML format from a pipe datafile.
run [FILES]Runs all the tests in the project or specific tests passed as arguments.
update [FILES]Updates the test's expectations.

tb test create

Creates a test in YAML format from an API endpoint.

For example: tb test create api_events --prompt "test for the customer id 42 and the event type 'purchase'".

OptionDescription
--prompt TEXTPasses a prompt to generate a customized test.

Tests are stored in the tests folder in your project as YAML files. For a description of the test file format, see Test files.

tb test run

Runs all the tests in the project tb test run or specific tests passed as arguments.

For example: tb test tests/run api_events.yaml.

Tinybird creates a fresh workspace for each test run. Secrets will not persist between test runs. To avoid test failures, add a default value to your secrets: {{ tb_secret("secret_name", "default_value") }}.

tb test update

Updates the test's expectations. For example: tb test update api_events.

Updated