tenzir-test 0.10.0__tar.gz → 0.12.0__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.10.0 → tenzir_test-0.12.0}/PKG-INFO +1 -1
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/pyproject.toml +1 -1
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/__init__.py +6 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/cli.py +35 -24
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/run.py +333 -71
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/custom_python_fixture_runner.py +5 -2
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/shell_runner.py +4 -2
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/tests/test_cli.py +61 -13
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/tests/test_run.py +130 -22
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/.gitignore +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/LICENSE +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/README.md +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/README.md +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/fixtures/README.md +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/fixtures/__init__.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/fixtures/http.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/fixtures/server.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/inputs/events.ndjson +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/runners/__init__.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/runners/xxd.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/context/01-context-create.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/context/01-context-create.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/context/02-context-update.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/context/02-context-update.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/context/03-context-inspect.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/context/03-context-inspect.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/context/test.yaml +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/fail.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/fail.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/hex/hello.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/hex/hello.xxd +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/http-fixture.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/http-fixture.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/lazy.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/lazy.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/node-fixture.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/node-fixture.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/executor-only/sum.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/executor-only/sum.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/executor-with-http-fixture/request.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/executor-with-http-fixture/request.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/executor-with-http-fixture/test.yaml +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/executor-with-node-fixture/context-manager.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/executor-with-node-fixture/context-manager.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/fixture-driving/manual_control.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/fixture-driving/manual_control.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/pure-python/flaky_coin.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/pure-python/flaky_coin.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/pure-python/hello_world.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/python/pure-python/hello_world.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/read-inputs.tql +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/read-inputs.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/shell/exit-code-test.sh +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/shell/exit-code-test.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/shell/http-fixture-check.sh +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/shell/http-fixture-check.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/shell/tmp-dir.sh +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/example-project/tests/shell/tmp-dir.txt +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/_python_runner.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/checks.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/config.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/engine/__init__.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/engine/operations.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/engine/registry.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/engine/state.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/engine/worker.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/fixtures/__init__.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/fixtures/node.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/packages.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/py.typed +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/__init__.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/_utils.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/diff_runner.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/ext_runner.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/runner.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/tenzir_runner.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/src/tenzir_test/runners/tql_runner.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/tests/test_config.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/tests/test_engine_operations.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/tests/test_python_runner.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/tests/test_run_config.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/tests/test_runner_registry.py +0 -0
- {tenzir_test-0.10.0 → tenzir_test-0.12.0}/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.12.0
|
|
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
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from importlib.metadata import PackageNotFoundError, version
|
|
4
4
|
|
|
5
5
|
from . import run
|
|
6
|
+
from .run import ExecutionResult, HarnessError, ProjectResult, ensure_settings, execute
|
|
6
7
|
from .config import Settings, discover_settings
|
|
7
8
|
from .fixtures import (
|
|
8
9
|
Executor,
|
|
@@ -32,9 +33,14 @@ __all__ = [
|
|
|
32
33
|
"fixtures",
|
|
33
34
|
"Settings",
|
|
34
35
|
"discover_settings",
|
|
36
|
+
"ensure_settings",
|
|
37
|
+
"execute",
|
|
35
38
|
"has",
|
|
36
39
|
"register",
|
|
37
40
|
"require",
|
|
41
|
+
"ExecutionResult",
|
|
42
|
+
"ProjectResult",
|
|
43
|
+
"HarnessError",
|
|
38
44
|
"run",
|
|
39
45
|
]
|
|
40
46
|
|
|
@@ -152,41 +152,49 @@ def cli(
|
|
|
152
152
|
jobs: int,
|
|
153
153
|
passthrough: bool,
|
|
154
154
|
all_projects: bool,
|
|
155
|
-
) ->
|
|
155
|
+
) -> int:
|
|
156
156
|
"""Execute tenzir-test scenarios."""
|
|
157
157
|
|
|
158
158
|
jobs_source = ctx.get_parameter_source("jobs")
|
|
159
159
|
jobs_overridden = jobs_source is not click.core.ParameterSource.DEFAULT
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
161
|
+
try:
|
|
162
|
+
result = runtime.run_cli(
|
|
163
|
+
root=root,
|
|
164
|
+
tenzir_binary=tenzir_binary,
|
|
165
|
+
tenzir_node_binary=tenzir_node_binary,
|
|
166
|
+
tests=list(tests),
|
|
167
|
+
update=update,
|
|
168
|
+
debug=debug,
|
|
169
|
+
purge=purge,
|
|
170
|
+
coverage=coverage,
|
|
171
|
+
coverage_source_dir=coverage_source_dir,
|
|
172
|
+
runner_summary=runner_summary,
|
|
173
|
+
fixture_summary=fixture_summary,
|
|
174
|
+
show_summary=show_summary,
|
|
175
|
+
show_diff_output=show_diff_output,
|
|
176
|
+
show_diff_stat=show_diff_stat,
|
|
177
|
+
keep_tmp_dirs=keep_tmp_dirs,
|
|
178
|
+
jobs=jobs,
|
|
179
|
+
passthrough=passthrough,
|
|
180
|
+
jobs_overridden=jobs_overridden,
|
|
181
|
+
all_projects=all_projects,
|
|
182
|
+
)
|
|
183
|
+
except runtime.HarnessError as exc:
|
|
184
|
+
if exc.show_message and exc.args:
|
|
185
|
+
raise click.ClickException(str(exc)) from exc
|
|
186
|
+
return exc.exit_code
|
|
187
|
+
return result.exit_code
|
|
182
188
|
|
|
183
189
|
|
|
184
190
|
def main(argv: Sequence[str] | None = None) -> int:
|
|
185
191
|
"""Run the Click command and translate Click exits to integer codes."""
|
|
186
192
|
|
|
187
193
|
command_main = getattr(cli, "main")
|
|
194
|
+
previous_color_mode = runtime.get_color_mode()
|
|
195
|
+
runtime.set_color_mode(runtime.ColorMode.AUTO)
|
|
188
196
|
try:
|
|
189
|
-
command_main(
|
|
197
|
+
result = command_main(
|
|
190
198
|
args=list(argv) if argv is not None else None,
|
|
191
199
|
standalone_mode=False,
|
|
192
200
|
)
|
|
@@ -198,7 +206,10 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
198
206
|
return _normalize_exit_code(exit_code)
|
|
199
207
|
except SystemExit as exc: # pragma: no cover - propagate runner exits
|
|
200
208
|
return _normalize_exit_code(exc.code)
|
|
201
|
-
|
|
209
|
+
else:
|
|
210
|
+
return _normalize_exit_code(result)
|
|
211
|
+
finally:
|
|
212
|
+
runtime.set_color_mode(previous_color_mode)
|
|
202
213
|
|
|
203
214
|
|
|
204
215
|
if __name__ == "__main__":
|