tenzir-test 0.12.0__tar.gz → 0.13.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/PKG-INFO +7 -7
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/README.md +6 -6
- tenzir_test-0.13.1/changelog/config.yaml +4 -0
- tenzir_test-0.13.1/changelog/releases/v0.11.0/entries/01-expose-tenzir-test-as-a-library.md +27 -0
- tenzir_test-0.13.1/changelog/releases/v0.11.0/manifest.yaml +4 -0
- tenzir_test-0.13.1/changelog/releases/v0.11.0/notes.md +23 -0
- tenzir_test-0.13.1/changelog/releases/v0.12.0/entries/01-honor-no-color-for-python-api-consumers.md +16 -0
- tenzir_test-0.13.1/changelog/releases/v0.12.0/manifest.yaml +4 -0
- tenzir_test-0.13.1/changelog/releases/v0.12.0/notes.md +17 -0
- tenzir_test-0.13.1/changelog/releases/v0.13.0/entries/01-improve-diagnostics-when-tenzir-node-fails-to-start.md +12 -0
- tenzir_test-0.13.1/changelog/releases/v0.13.0/entries/01-library-mode-and-package-dirs.md +32 -0
- tenzir_test-0.13.1/changelog/releases/v0.13.0/manifest.yaml +4 -0
- tenzir_test-0.13.1/changelog/releases/v0.13.0/notes.md +29 -0
- tenzir_test-0.13.1/changelog/releases/v0.13.1/entries/strip-root-paths-from-diff-runner-output.md +11 -0
- tenzir_test-0.13.1/changelog/releases/v0.13.1/manifest.yaml +5 -0
- tenzir_test-0.13.1/changelog/releases/v0.13.1/notes.md +9 -0
- tenzir_test-0.13.1/example-library/README.md +43 -0
- tenzir_test-0.13.1/example-library/bar/operators/double.tql +1 -0
- tenzir_test-0.13.1/example-library/bar/package.yaml +4 -0
- tenzir_test-0.13.1/example-library/bar/test.yaml +2 -0
- tenzir_test-0.13.1/example-library/bar/tests/use-foo.tql +2 -0
- tenzir_test-0.13.1/example-library/bar/tests/use-foo.txt +3 -0
- tenzir_test-0.13.1/example-library/foo/operators/increment.tql +1 -0
- tenzir_test-0.13.1/example-library/foo/package.yaml +4 -0
- tenzir_test-0.13.1/example-library/foo/test.yaml +2 -0
- tenzir_test-0.13.1/example-library/foo/tests/use-bar.tql +2 -0
- tenzir_test-0.13.1/example-library/foo/tests/use-bar.txt +3 -0
- tenzir_test-0.13.1/example-package/operators/deeply/nested/twist.tql +7 -0
- tenzir_test-0.13.1/example-package/operators/filter.tql +1 -0
- tenzir_test-0.13.1/example-package/operators/parse.tql +2 -0
- tenzir_test-0.13.1/example-package/package.yaml +29 -0
- tenzir_test-0.13.1/example-package/tests/context/01-context-list.tql +2 -0
- tenzir_test-0.13.1/example-package/tests/context/01-context-list.txt +5 -0
- tenzir_test-0.13.1/example-package/tests/context/02-context-update.tql +4 -0
- tenzir_test-0.13.1/example-package/tests/context/03-context-inspect.tql +1 -0
- tenzir_test-0.13.1/example-package/tests/context/test.yaml +2 -0
- tenzir_test-0.13.1/example-package/tests/inputs/sample.log +12 -0
- tenzir_test-0.13.1/example-package/tests/ops.tql +4 -0
- tenzir_test-0.13.1/example-package/tests/ops.txt +15 -0
- tenzir_test-0.13.1/example-package/tests/twist.tql +4 -0
- tenzir_test-0.13.1/example-package/tests/twist.txt +12 -0
- tenzir_test-0.13.1/example-project/tests/context/03-context-inspect.txt +12 -0
- tenzir_test-0.13.1/example-satellite/README.md +27 -0
- tenzir_test-0.13.1/example-satellite/fixtures.py +14 -0
- tenzir_test-0.13.1/example-satellite/inputs/input.txt +1 -0
- tenzir_test-0.13.1/example-satellite/tests/hex/reuse.txt +2 -0
- tenzir_test-0.13.1/example-satellite/tests/hex/reuse.xxd +1 -0
- tenzir_test-0.13.1/example-satellite/tests/satellite/input.sh +2 -0
- tenzir_test-0.13.1/example-satellite/tests/satellite/input.txt +2 -0
- tenzir_test-0.13.1/example-satellite/tests/satellite/marker.sh +4 -0
- tenzir_test-0.13.1/example-satellite/tests/satellite/marker.txt +1 -0
- tenzir_test-0.13.1/example-satellite/tests/satellite/test.yaml +3 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/pyproject.toml +10 -8
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/cli.py +19 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/config.py +1 -1
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/fixtures/node.py +83 -6
- tenzir_test-0.13.1/src/tenzir_test/py.typed +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/run.py +161 -3
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/diff_runner.py +8 -3
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_run.py +61 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_run_config.py +72 -4
- tenzir_test-0.12.0/src/tenzir_test/checks.py +0 -31
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/.gitignore +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/LICENSE +0 -0
- {tenzir_test-0.12.0/example-project → tenzir_test-0.13.1/example-package}/tests/context/02-context-update.txt +0 -0
- {tenzir_test-0.12.0/example-project → tenzir_test-0.13.1/example-package}/tests/context/03-context-inspect.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/README.md +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/fixtures/README.md +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/fixtures/__init__.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/fixtures/http.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/fixtures/server.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/inputs/events.ndjson +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/runners/__init__.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/runners/xxd.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/context/01-context-create.tql +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/context/01-context-create.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/context/02-context-update.tql +0 -0
- /tenzir_test-0.12.0/example-project/tests/lazy.txt → /tenzir_test-0.13.1/example-project/tests/context/02-context-update.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/context/03-context-inspect.tql +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/context/test.yaml +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/fail.tql +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/fail.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/hex/hello.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/hex/hello.xxd +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/http-fixture.tql +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/http-fixture.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/lazy.tql +0 -0
- /tenzir_test-0.12.0/example-project/tests/shell/http-fixture-check.txt → /tenzir_test-0.13.1/example-project/tests/lazy.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/node-fixture.tql +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/node-fixture.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/executor-only/sum.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/executor-only/sum.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/executor-with-http-fixture/request.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/executor-with-http-fixture/request.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/executor-with-http-fixture/test.yaml +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/executor-with-node-fixture/context-manager.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/executor-with-node-fixture/context-manager.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/fixture-driving/manual_control.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/fixture-driving/manual_control.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/pure-python/flaky_coin.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/pure-python/flaky_coin.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/pure-python/hello_world.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/python/pure-python/hello_world.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/read-inputs.tql +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/read-inputs.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/shell/exit-code-test.sh +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/shell/exit-code-test.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/shell/http-fixture-check.sh +0 -0
- /tenzir_test-0.12.0/src/tenzir_test/py.typed → /tenzir_test-0.13.1/example-project/tests/shell/http-fixture-check.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/shell/tmp-dir.sh +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/example-project/tests/shell/tmp-dir.txt +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/__init__.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/_python_runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/engine/__init__.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/engine/operations.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/engine/registry.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/engine/state.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/engine/worker.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/fixtures/__init__.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/packages.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/__init__.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/_utils.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/custom_python_fixture_runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/ext_runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/shell_runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/tenzir_runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/src/tenzir_test/runners/tql_runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_cli.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_config.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_engine_operations.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_python_runner.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_runner_registry.py +0 -0
- {tenzir_test-0.12.0 → tenzir_test-0.13.1}/tests/test_shell_runner.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tenzir-test
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: Reusable test execution framework extracted from the Tenzir repository.
|
|
5
5
|
Project-URL: Homepage, https://github.com/tenzir/test
|
|
6
6
|
Project-URL: Repository, https://github.com/tenzir/test
|
|
@@ -63,18 +63,18 @@ for an end-to-end walkthrough of writing tests.
|
|
|
63
63
|
We also provide a dense [reference](https://docs.tenzir.com/reference/test) that
|
|
64
64
|
explains concepts, configuration, multi-project execution, and CLI details.
|
|
65
65
|
|
|
66
|
-
## 🧑💻 Development
|
|
67
|
-
|
|
68
|
-
Contributor workflows, quality gates, and release procedures live in
|
|
69
|
-
[`DEVELOPMENT.md`](DEVELOPMENT.md). Follow that guide when you work on the
|
|
70
|
-
project locally.
|
|
71
|
-
|
|
72
66
|
## 🗞️ Releases
|
|
73
67
|
|
|
74
68
|
New versions are published to PyPI through trusted publishing when a GitHub
|
|
75
69
|
release is created. Review the latest release notes on GitHub for details about
|
|
76
70
|
what's new.
|
|
77
71
|
|
|
72
|
+
## 🤝 Contributing
|
|
73
|
+
|
|
74
|
+
Want to contribute? We're all-in on agentic coding with [Claude
|
|
75
|
+
Code](https://claude.ai/code)! The repo comes pre-configured with our [custom
|
|
76
|
+
plugins](https://github.com/tenzir/claude-plugins)—just clone and start hacking.
|
|
77
|
+
|
|
78
78
|
## 📜 License
|
|
79
79
|
|
|
80
80
|
`tenzir-test` is available under the Apache License, Version 2.0. See
|
|
@@ -34,18 +34,18 @@ for an end-to-end walkthrough of writing tests.
|
|
|
34
34
|
We also provide a dense [reference](https://docs.tenzir.com/reference/test) that
|
|
35
35
|
explains concepts, configuration, multi-project execution, and CLI details.
|
|
36
36
|
|
|
37
|
-
## 🧑💻 Development
|
|
38
|
-
|
|
39
|
-
Contributor workflows, quality gates, and release procedures live in
|
|
40
|
-
[`DEVELOPMENT.md`](DEVELOPMENT.md). Follow that guide when you work on the
|
|
41
|
-
project locally.
|
|
42
|
-
|
|
43
37
|
## 🗞️ Releases
|
|
44
38
|
|
|
45
39
|
New versions are published to PyPI through trusted publishing when a GitHub
|
|
46
40
|
release is created. Review the latest release notes on GitHub for details about
|
|
47
41
|
what's new.
|
|
48
42
|
|
|
43
|
+
## 🤝 Contributing
|
|
44
|
+
|
|
45
|
+
Want to contribute? We're all-in on agentic coding with [Claude
|
|
46
|
+
Code](https://claude.ai/code)! The repo comes pre-configured with our [custom
|
|
47
|
+
plugins](https://github.com/tenzir/claude-plugins)—just clone and start hacking.
|
|
48
|
+
|
|
49
49
|
## 📜 License
|
|
50
50
|
|
|
51
51
|
`tenzir-test` is available under the Apache License, Version 2.0. See
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Expose tenzir-test as a library
|
|
3
|
+
type: feature
|
|
4
|
+
authors:
|
|
5
|
+
- mavam
|
|
6
|
+
- codex
|
|
7
|
+
created: 2025-11-04
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The test framework now exposes its harness as a reusable Python library,
|
|
11
|
+
returning structured execution results instead of exiting the process. Callers
|
|
12
|
+
can import the new `execute` helper and receive an `ExecutionResult` with
|
|
13
|
+
project summaries, exit codes, and failure details for downstream automation.
|
|
14
|
+
|
|
15
|
+
Example:
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
from tenzir_test import ExecutionResult, execute
|
|
21
|
+
|
|
22
|
+
result: ExecutionResult = execute(tests=[Path("tests/pipeline.tql")])
|
|
23
|
+
if result.exit_code:
|
|
24
|
+
raise SystemExit(result.exit_code)
|
|
25
|
+
for project in result.project_results:
|
|
26
|
+
print(project.selection.root, project.summary.total)
|
|
27
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Expose tenzir-test as a reusable Python library.
|
|
2
|
+
|
|
3
|
+
## 🚀 Features
|
|
4
|
+
|
|
5
|
+
### Expose tenzir-test as a library
|
|
6
|
+
|
|
7
|
+
The test framework now exposes its harness as a reusable Python library, returning structured execution results instead of exiting the process. Callers can import the new `execute` helper and receive an `ExecutionResult` with project summaries, exit codes, and failure details for downstream automation.
|
|
8
|
+
|
|
9
|
+
Example:
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
from tenzir_test import ExecutionResult, execute
|
|
15
|
+
|
|
16
|
+
result: ExecutionResult = execute(tests=[Path("tests/pipeline.tql")])
|
|
17
|
+
if result.exit_code:
|
|
18
|
+
raise SystemExit(result.exit_code)
|
|
19
|
+
for project in result.project_results:
|
|
20
|
+
print(project.selection.root, project.summary.total)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
*By @mavam and @codex.*
|
tenzir_test-0.13.1/changelog/releases/v0.12.0/entries/01-honor-no-color-for-python-api-consumers.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Add configurable color output control
|
|
3
|
+
type: feature
|
|
4
|
+
authors:
|
|
5
|
+
- codex
|
|
6
|
+
- mavam
|
|
7
|
+
created: 2025-11-05
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
We default library consumers to plain output, keep the CLI smart about ANSI usage, and honour `NO_COLOR` across every helper while locking the behaviour down with tests.
|
|
11
|
+
|
|
12
|
+
When you `import tenzir_test.run`, the harness now emits unstyled text so CI logs stay machine-readable. You can still opt back into colours via `run.set_color_mode(run.ColorMode.ALWAYS)` or let auto-detection pick the best option.
|
|
13
|
+
|
|
14
|
+
Running `tenzir-test` in a terminal still shows coloured summaries, but redirecting stdout—or exporting `NO_COLOR=1`—forces the palette to plain text, covering diff hunks, failure trees, retry banners, and runner diagnostics.
|
|
15
|
+
|
|
16
|
+
A single palette helper now drives every glyph and symbol, and pytest coverage exercises CLI, library, and `NO_COLOR` modes to catch regressions immediately.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Minor release with improved NO_COLOR handling.
|
|
2
|
+
|
|
3
|
+
## 🚀 Features
|
|
4
|
+
|
|
5
|
+
### Add configurable color output control
|
|
6
|
+
|
|
7
|
+
We switched library consumers to plain output by default and added full `NO_COLOR` support, keeping ANSI colors only where they enhance the interactive experience.
|
|
8
|
+
|
|
9
|
+
When you `import tenzir_test.run` directly, the harness now emits unstyled text by default—perfect for log parsers, CI systems, and automation scripts that expect machine-readable output. If you need colors back, call `run.set_color_mode(run.ColorMode.ALWAYS)` to force ANSI sequences on, or use `run.ColorMode.AUTO` to let the harness detect terminal capabilities.
|
|
10
|
+
|
|
11
|
+
The `tenzir-test` CLI continues to auto-detect your terminal and renders colors when you run tests interactively. Redirect stdout to a file or pipe, and it automatically switches to plain mode. Set `NO_COLOR=1` in your environment, and every output—failure trees, diff hunks, retry banners—strips its color codes.
|
|
12
|
+
|
|
13
|
+
All palette logic now lives in a single helper that colorizes checkmarks, crosses, diff lines, and progress indicators consistently. This unification means `run.print_diff(...)` respects your color mode choice everywhere, whether you invoke it from the CLI or from library code.
|
|
14
|
+
|
|
15
|
+
We added pytest coverage for all three modes—CLI with colors, library without colors, and `NO_COLOR=1` forcing plain output—so future changes won't break the contract.
|
|
16
|
+
|
|
17
|
+
*By @codex and @mavam.*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Improve diagnostics when Tenzir Node fails to start
|
|
3
|
+
type: change
|
|
4
|
+
authors:
|
|
5
|
+
- Alainx277
|
|
6
|
+
- claude
|
|
7
|
+
prs:
|
|
8
|
+
- 2
|
|
9
|
+
created: 2025-12-02
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
The `node` fixture now reports the exit code and stderr output when `tenzir-node` fails to start, making it easier to diagnose startup failures. Previously, the error message provided no context about why the node failed to produce an endpoint.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Library mode and extra packages
|
|
3
|
+
type: feature
|
|
4
|
+
authors:
|
|
5
|
+
- codex
|
|
6
|
+
- mavam
|
|
7
|
+
prs:
|
|
8
|
+
- 4
|
|
9
|
+
created: 2025-12-02
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Explicit package loading for tests: use `--package-dirs` (repeatable, accepts
|
|
13
|
+
comma-separated lists) to point the harness at package directories. The same
|
|
14
|
+
flag is passed to the Tenzir binaries, and it merges with any `package-dirs:`
|
|
15
|
+
declared in directory `test.yaml` files. Entries are normalized and
|
|
16
|
+
de-duplicated, then exported via `TENZIR_PACKAGE_DIRS` for fixtures.
|
|
17
|
+
|
|
18
|
+
The test configuration uses the same spelling: add
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
package-dirs:
|
|
22
|
+
- ../shared-packages
|
|
23
|
+
- /opt/tenzir/packages/foo
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
to a directory `test.yaml` when you want those packages available for the tests
|
|
27
|
+
below it.
|
|
28
|
+
|
|
29
|
+
Example: `uvx tenzir-test --package-dirs example-library example-library`
|
|
30
|
+
loads both `foo` and `bar` packages so their operators can cross-import. The
|
|
31
|
+
example-library `test.yaml` files demonstrate the config-based approach if you
|
|
32
|
+
prefer not to pass the `--package-dirs` flag.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
This release adds `--package-dirs` support and improves startup diagnostics.
|
|
2
|
+
|
|
3
|
+
## 🚀 Features
|
|
4
|
+
|
|
5
|
+
### Library mode and extra packages
|
|
6
|
+
|
|
7
|
+
Explicit package loading for tests: use `--package-dirs` (repeatable, accepts comma-separated lists) to point the harness at package directories. The same flag is passed to the Tenzir binaries, and it merges with any `package-dirs:` declared in directory `test.yaml` files. Entries are normalized and de-duplicated, then exported via `TENZIR_PACKAGE_DIRS` for fixtures.
|
|
8
|
+
|
|
9
|
+
The test configuration uses the same spelling: add
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
package-dirs:
|
|
13
|
+
- ../shared-packages
|
|
14
|
+
- /opt/tenzir/packages/foo
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
to a directory `test.yaml` when you want those packages available for the tests below it.
|
|
18
|
+
|
|
19
|
+
Example: `uvx tenzir-test --package-dirs example-library example-library` loads both `foo` and `bar` packages so their operators can cross-import. The example-library `test.yaml` files demonstrate the config-based approach if you prefer not to pass the `--package-dirs` flag.
|
|
20
|
+
|
|
21
|
+
*By @codex and @mavam in [#4](https://github.com/tenzir/test/pull/4).*
|
|
22
|
+
|
|
23
|
+
## 🔧 Changes
|
|
24
|
+
|
|
25
|
+
### Improve diagnostics when Tenzir Node fails to start
|
|
26
|
+
|
|
27
|
+
The `node` fixture now reports the exit code and stderr output when `tenzir-node` fails to start, making it easier to diagnose startup failures. Previously, the error message provided no context about why the node failed to produce an endpoint.
|
|
28
|
+
|
|
29
|
+
*By @Alainx277 and @claude in [#2](https://github.com/tenzir/test/pull/2).*
|
tenzir_test-0.13.1/changelog/releases/v0.13.1/entries/strip-root-paths-from-diff-runner-output.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Strip root paths from diff_runner output
|
|
3
|
+
type: bugfix
|
|
4
|
+
authors:
|
|
5
|
+
- tobim
|
|
6
|
+
- claude
|
|
7
|
+
pr: 5
|
|
8
|
+
created: 2025-12-08T15:44:59.615542Z
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
The `DiffRunner` now strips the ROOT path prefix from output to make paths relative, consistent with `run_simple_test` behavior.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
This release fixes path handling in the diff runner to strip root path prefixes from output, making paths relative and consistent with other test runners.
|
|
2
|
+
|
|
3
|
+
## 🐞 Bug fixes
|
|
4
|
+
|
|
5
|
+
### Strip root paths from diff_runner output
|
|
6
|
+
|
|
7
|
+
The `DiffRunner` now strips the ROOT path prefix from output to make paths relative, consistent with `run_simple_test` behavior.
|
|
8
|
+
|
|
9
|
+
*By @tobim and @claude in [#5](https://github.com/tenzir/test/pull/5).*
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Example Library
|
|
2
|
+
|
|
3
|
+
This directory contains two sibling packages, `foo` and `bar`, to demonstrate
|
|
4
|
+
explicit package loading. Point `tenzir-test` at the directory and add
|
|
5
|
+
`--package-dirs example-library` so both packages are visible to every test:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
uvx tenzir-test --package-dirs example-library example-library
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Layout
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
example-library/
|
|
15
|
+
├── foo/
|
|
16
|
+
│ ├── package.yaml
|
|
17
|
+
│ ├── test.yaml
|
|
18
|
+
│ ├── operators/
|
|
19
|
+
│ │ └── increment.tql
|
|
20
|
+
│ └── tests/
|
|
21
|
+
│ ├── use-bar.tql
|
|
22
|
+
│ └── use-bar.txt
|
|
23
|
+
└── bar/
|
|
24
|
+
├── package.yaml
|
|
25
|
+
├── test.yaml
|
|
26
|
+
├── operators/
|
|
27
|
+
│ └── double.tql
|
|
28
|
+
└── tests/
|
|
29
|
+
├── use-foo.tql
|
|
30
|
+
└── use-foo.txt
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Cross-package usage
|
|
34
|
+
|
|
35
|
+
- `foo/tests/use-bar.tql` calls `bar::double`.
|
|
36
|
+
- `bar/tests/use-foo.tql` calls `foo::increment`.
|
|
37
|
+
|
|
38
|
+
Because `--package-dirs` points at the library, both packages are visible to
|
|
39
|
+
every test without additional flags.
|
|
40
|
+
|
|
41
|
+
You can also pin package discovery in a directory `test.yaml` by setting
|
|
42
|
+
`package-dirs:` there. This example keeps the entries commented so the CLI
|
|
43
|
+
flag remains the primary, explicit mechanism.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
x = x * 2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
x = x + 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
where actor == "admin"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# The package ID defines the top-level module name. For example, placing a
|
|
2
|
+
# user-defined operator `foo` in operators/foo.tql makes it callable via
|
|
3
|
+
# `example::foo`.
|
|
4
|
+
#
|
|
5
|
+
# If you do not specify an ID, the directory name of this package.yaml will be
|
|
6
|
+
# used as the ID. Package installation fails if the ID or directory name
|
|
7
|
+
# contains invalid characters. Allowed characters are alphanumeric and
|
|
8
|
+
# underscore, e.g., `my-package` is invalid but `my_package` is okay.
|
|
9
|
+
id: example
|
|
10
|
+
|
|
11
|
+
# The name should be a short, human-readable description of the package.
|
|
12
|
+
name: Example Package
|
|
13
|
+
|
|
14
|
+
# The description should provide a brief overview of the package's purpose and
|
|
15
|
+
# functionality. Markdown is supported.
|
|
16
|
+
description: |
|
|
17
|
+
This is an example package that demonstrates how to write tests for Tenzir
|
|
18
|
+
packages.
|
|
19
|
+
|
|
20
|
+
# Contexts live inside a node. The test harness passes --package-dirs to the node
|
|
21
|
+
# fixture, making contexts also available in the fixture. The harness also
|
|
22
|
+
# passes --package-dirs to the Tenzir running that invokes the the `tenzir`
|
|
23
|
+
# binary. In this case the context configuration gets ignored.
|
|
24
|
+
contexts:
|
|
25
|
+
ctx:
|
|
26
|
+
type: lookup-table
|
|
27
|
+
description: |
|
|
28
|
+
An example context that gets installed by the test framework when the
|
|
29
|
+
harness passes --package-dirs to the node fixture.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
context::inspect "ctx"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
2025-09-23 [root] All your base are belong to us
|
|
2
|
+
2025-09-24 [user] System takeover initiated by root user
|
|
3
|
+
2025-09-25 [admin] Security breach detected in main database
|
|
4
|
+
2025-09-26 [root] Access privileges escalated successfully
|
|
5
|
+
2025-09-27 [system] Firewall rules modified by unauthorized user
|
|
6
|
+
2025-09-28 [user] Connection established to remote server
|
|
7
|
+
2025-09-29 [root] Database backup corrupted during transfer
|
|
8
|
+
2025-09-30 [admin] Emergency protocols activated
|
|
9
|
+
2025-10-01 [system] Network traffic redirected to external host
|
|
10
|
+
2025-10-02 [root] All security measures have been bypassed
|
|
11
|
+
2025-10-03 [user] Mission accomplished - standing by for orders
|
|
12
|
+
2025-10-04 [admin] System shutdown imminent
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
timestamp: 2025-09-25T00:00:00Z,
|
|
3
|
+
actor: "admin",
|
|
4
|
+
message: "Security breach detected in main database",
|
|
5
|
+
}
|
|
6
|
+
{
|
|
7
|
+
timestamp: 2025-09-30T00:00:00Z,
|
|
8
|
+
actor: "admin",
|
|
9
|
+
message: "Emergency protocols activated",
|
|
10
|
+
}
|
|
11
|
+
{
|
|
12
|
+
timestamp: 2025-10-04T00:00:00Z,
|
|
13
|
+
actor: "admin",
|
|
14
|
+
message: "System shutdown imminent",
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Example Satellite Project
|
|
2
|
+
|
|
3
|
+
This companion project demonstrates how a satellite can reuse runners and
|
|
4
|
+
fixtures from the root `example-project` while adding its own customizations.
|
|
5
|
+
|
|
6
|
+
## Layout
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
example-satellite/
|
|
10
|
+
├── fixtures.py
|
|
11
|
+
└── tests/
|
|
12
|
+
├── hex/reuse.{xxd,txt}
|
|
13
|
+
└── satellite/marker.{sh,txt}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- `fixtures.py` registers the `satellite_marker` fixture that the shell test
|
|
17
|
+
consumes.
|
|
18
|
+
- `tests/hex/reuse.xxd` exercises the `xxd` runner exported by the root project;
|
|
19
|
+
no additional runners are needed in the satellite.
|
|
20
|
+
- `tests/satellite/marker.sh` verifies that the local fixture is loaded when the
|
|
21
|
+
satellite participates in a multi-project run.
|
|
22
|
+
|
|
23
|
+
Run the example together with the main project:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
uvx tenzir-test --root example-project example-satellite
|
|
27
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Fixtures defined by the example satellite project."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterator
|
|
6
|
+
|
|
7
|
+
from tenzir_test import fixture
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@fixture(name="satellite_marker")
|
|
11
|
+
def satellite_marker_fixture() -> Iterator[dict[str, str]]:
|
|
12
|
+
"""Expose a marker so tests can assert fixture inheritance works."""
|
|
13
|
+
|
|
14
|
+
yield {"SATELLITE_MARKER": "example-satellite"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hello world
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Satellite runner reuse!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
satellite fixture: example-satellite
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tenzir-test"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.13.1"
|
|
4
4
|
description = "Reusable test execution framework extracted from the Tenzir repository."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -34,7 +34,6 @@ Documentation = "https://docs.tenzir.com"
|
|
|
34
34
|
|
|
35
35
|
[project.scripts]
|
|
36
36
|
tenzir-test = "tenzir_test.cli:main"
|
|
37
|
-
check-release = "tenzir_test.checks:main"
|
|
38
37
|
|
|
39
38
|
[build-system]
|
|
40
39
|
requires = ["hatchling>=1.25.0"]
|
|
@@ -48,14 +47,17 @@ packages = ["src/tenzir_test"]
|
|
|
48
47
|
|
|
49
48
|
[tool.hatch.build.targets.sdist]
|
|
50
49
|
include = [
|
|
51
|
-
"/src/**/*",
|
|
52
|
-
"/tests",
|
|
53
|
-
"/example-project",
|
|
54
|
-
"/scripts",
|
|
55
|
-
"/README.md",
|
|
56
|
-
"/CHANGELOG.md",
|
|
57
50
|
"/LICENSE",
|
|
51
|
+
"/README.md",
|
|
52
|
+
"/changelog",
|
|
53
|
+
"/example-library",
|
|
54
|
+
"/example-package",
|
|
55
|
+
"/example-project",
|
|
56
|
+
"/example-satellite",
|
|
58
57
|
"/pyproject.toml",
|
|
58
|
+
"/scripts",
|
|
59
|
+
"/src/**/*",
|
|
60
|
+
"/tests",
|
|
59
61
|
]
|
|
60
62
|
exclude = [
|
|
61
63
|
"*.pyc",
|