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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"package_dir": "<package_dir>",
"test": "<test>"
},
"name": "package_add_test"
}
}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 |