Add test to package
package_add_testCreate test cases for Tenzir operators by defining input/output pairs, adding fixtures, and generating test scaffolds for the tenzir-test framework.
Instructions
Add a test to a package.
Use this tool to:
Create test cases for your operators
Define expected behavior with input/output pairs
Set up integration tests with fixtures (e.g., embedded Tenzir nodes)
Generate test scaffolds to be populated later with run_test
Tests use the tenzir-test framework. Provide input/output when known,
or omit output and use the run_test tool with update=True to generate
baselines from actual execution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test | Yes | TQL code written in the test file | |
| input | No | Input data to feed to the pipeline. Pairs with `output` to define test expectations. Omit when the test generates data inline using TQL operators like `from`. | |
| output | No | Expected output from the pipeline. Pairs with `input` for input/output tests, or used alone when the test generates data inline. | |
| timeout | No | Maximum time in seconds for the test to complete (optional) | |
| fixtures | No | List of fixture names (optional) | |
| test_file | No | Path to the test file relative to package tests directory. If not provided, a default name will be generated. | |
| package_dir | Yes | Path to the package directory |