tenzir-test 0.13.1__py3-none-any.whl → 0.14.0__py3-none-any.whl
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/run.py +43 -13
- {tenzir_test-0.13.1.dist-info → tenzir_test-0.14.0.dist-info}/METADATA +1 -1
- {tenzir_test-0.13.1.dist-info → tenzir_test-0.14.0.dist-info}/RECORD +6 -6
- {tenzir_test-0.13.1.dist-info → tenzir_test-0.14.0.dist-info}/WHEEL +0 -0
- {tenzir_test-0.13.1.dist-info → tenzir_test-0.14.0.dist-info}/entry_points.txt +0 -0
- {tenzir_test-0.13.1.dist-info → tenzir_test-0.14.0.dist-info}/licenses/LICENSE +0 -0
tenzir_test/run.py
CHANGED
|
@@ -1641,20 +1641,12 @@ def _iter_project_test_directories(root: Path) -> Iterator[Path]:
|
|
|
1641
1641
|
|
|
1642
1642
|
|
|
1643
1643
|
def _is_inputs_path(path: Path) -> bool:
|
|
1644
|
-
"""Return True when the path lives under
|
|
1644
|
+
"""Return True when the path lives under any inputs directory."""
|
|
1645
1645
|
try:
|
|
1646
1646
|
parts = path.relative_to(ROOT).parts
|
|
1647
1647
|
except ValueError:
|
|
1648
1648
|
parts = path.parts
|
|
1649
|
-
|
|
1650
|
-
for index, part in enumerate(parts):
|
|
1651
|
-
if part != "inputs":
|
|
1652
|
-
continue
|
|
1653
|
-
if index == 0:
|
|
1654
|
-
return True
|
|
1655
|
-
if index > 0 and parts[index - 1] == "tests":
|
|
1656
|
-
return True
|
|
1657
|
-
return False
|
|
1649
|
+
return "inputs" in parts
|
|
1658
1650
|
|
|
1659
1651
|
|
|
1660
1652
|
def _refresh_registry() -> None:
|
|
@@ -1687,6 +1679,25 @@ def _resolve_inputs_dir(root: Path) -> Path:
|
|
|
1687
1679
|
return direct
|
|
1688
1680
|
|
|
1689
1681
|
|
|
1682
|
+
def _find_nearest_inputs_dir(test: Path, root: Path) -> Path | None:
|
|
1683
|
+
"""Walk up from test directory to find nearest inputs/ directory.
|
|
1684
|
+
|
|
1685
|
+
Returns the nearest inputs/ directory between the test and root,
|
|
1686
|
+
or None if no inputs/ directory exists in that range.
|
|
1687
|
+
"""
|
|
1688
|
+
current = test.parent
|
|
1689
|
+
root_resolved = root.resolve()
|
|
1690
|
+
while True:
|
|
1691
|
+
candidate = current / "inputs"
|
|
1692
|
+
if candidate.is_dir():
|
|
1693
|
+
return candidate
|
|
1694
|
+
# Stop when we reach or pass the root
|
|
1695
|
+
if current.resolve() == root_resolved or current == current.parent:
|
|
1696
|
+
break
|
|
1697
|
+
current = current.parent
|
|
1698
|
+
return None
|
|
1699
|
+
|
|
1700
|
+
|
|
1690
1701
|
def _looks_like_project_root(path: Path) -> bool:
|
|
1691
1702
|
"""Return True when the path or one of its parents resembles a project root."""
|
|
1692
1703
|
|
|
@@ -1818,13 +1829,22 @@ def get_test_env_and_config_args(
|
|
|
1818
1829
|
config_args = [f"--config={config_file}"] if config_file.exists() else []
|
|
1819
1830
|
env = os.environ.copy()
|
|
1820
1831
|
if inputs is None:
|
|
1821
|
-
|
|
1832
|
+
# Try nearest inputs/ directory first, fall back to project-level
|
|
1833
|
+
nearest = _find_nearest_inputs_dir(test, ROOT)
|
|
1834
|
+
if nearest is not None:
|
|
1835
|
+
inputs_path = str(nearest.resolve())
|
|
1836
|
+
else:
|
|
1837
|
+
inputs_path = str(_resolve_inputs_dir(ROOT).resolve())
|
|
1822
1838
|
else:
|
|
1823
1839
|
candidate = Path(os.fspath(inputs))
|
|
1824
1840
|
if not candidate.is_absolute():
|
|
1825
1841
|
candidate = test.parent / candidate
|
|
1826
1842
|
inputs_path = str(candidate.resolve())
|
|
1827
1843
|
env["TENZIR_INPUTS"] = inputs_path
|
|
1844
|
+
# Check for inline input file (.input extension)
|
|
1845
|
+
inline_input = test.with_suffix(".input")
|
|
1846
|
+
if inline_input.is_file():
|
|
1847
|
+
env["TENZIR_INPUT"] = str(inline_input.resolve())
|
|
1828
1848
|
if config_file.exists():
|
|
1829
1849
|
env.setdefault("TENZIR_CONFIG", str(config_file))
|
|
1830
1850
|
if node_config_file.exists():
|
|
@@ -2853,7 +2873,12 @@ def run_simple_test(
|
|
|
2853
2873
|
env["TENZIR_PACKAGE_ROOT"] = str(package_root)
|
|
2854
2874
|
package_tests_root = package_root / "tests"
|
|
2855
2875
|
if inputs_override is None:
|
|
2856
|
-
|
|
2876
|
+
# Try nearest inputs/ directory, fall back to package-level
|
|
2877
|
+
nearest = _find_nearest_inputs_dir(test, package_root)
|
|
2878
|
+
if nearest is not None:
|
|
2879
|
+
env["TENZIR_INPUTS"] = str(nearest.resolve())
|
|
2880
|
+
else:
|
|
2881
|
+
env["TENZIR_INPUTS"] = str(package_tests_root / "inputs")
|
|
2857
2882
|
package_dir_candidates.append(str(package_root))
|
|
2858
2883
|
package_dir_candidates.extend(additional_package_dirs)
|
|
2859
2884
|
for cli_path in _get_cli_packages():
|
|
@@ -3128,7 +3153,12 @@ class Worker:
|
|
|
3128
3153
|
if package_root is not None:
|
|
3129
3154
|
env["TENZIR_PACKAGE_ROOT"] = str(package_root)
|
|
3130
3155
|
if inputs_override is None:
|
|
3131
|
-
|
|
3156
|
+
# Try nearest inputs/ directory, fall back to package-level
|
|
3157
|
+
nearest = _find_nearest_inputs_dir(primary_test, package_root)
|
|
3158
|
+
if nearest is not None:
|
|
3159
|
+
env["TENZIR_INPUTS"] = str(nearest.resolve())
|
|
3160
|
+
else:
|
|
3161
|
+
env["TENZIR_INPUTS"] = str((package_root / "tests" / "inputs"))
|
|
3132
3162
|
package_dir_candidates.append(str(package_root))
|
|
3133
3163
|
package_dir_candidates.extend(additional_package_dirs)
|
|
3134
3164
|
for cli_path in _get_cli_packages():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tenzir-test
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.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
|
|
@@ -4,7 +4,7 @@ tenzir_test/cli.py,sha256=JJNCaF-vZSql6kvPGG4JwO9Z8XIwQWe_5bKuBiuGjLE,6553
|
|
|
4
4
|
tenzir_test/config.py,sha256=bVuMJlEvevZxCmvzTJ4bs4SkYLNGZtxcCDYhtC-0sp8,1697
|
|
5
5
|
tenzir_test/packages.py,sha256=cTCQdGjCS1XmuKyiwh0ew-z9tHn6J-xZ6nvBP-hU8bc,948
|
|
6
6
|
tenzir_test/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
tenzir_test/run.py,sha256=
|
|
7
|
+
tenzir_test/run.py,sha256=1DcxoN0r6fYlAQAHH8xe4zOPPUeo3IW89xffazUkJbs,131845
|
|
8
8
|
tenzir_test/engine/__init__.py,sha256=5APwy90YDm7rmL_qCZfToAcfbQthcZ8yV2_ExXKqaqE,110
|
|
9
9
|
tenzir_test/engine/operations.py,sha256=OCYjuMHyMAaay4s08u2Sl7oE-PmgeXumylp7R8GYIH4,950
|
|
10
10
|
tenzir_test/engine/registry.py,sha256=LXCr6TGlv1sR1m1eboTk7SrbS2IVErc3PqUuHxGA2xk,594
|
|
@@ -21,8 +21,8 @@ tenzir_test/runners/runner.py,sha256=LtlD8huQOSmD7RyYDnKeCuI4Y6vhxGXMKsHA2qgfWN0
|
|
|
21
21
|
tenzir_test/runners/shell_runner.py,sha256=OuofgHeZN2FaO6xRI3uyqstLBymc6rmWC4HAnSn91AE,6068
|
|
22
22
|
tenzir_test/runners/tenzir_runner.py,sha256=464FFYS_mh6l-ehccc-S8cIUO1MxdapwQL5X3PmMkMI,1006
|
|
23
23
|
tenzir_test/runners/tql_runner.py,sha256=2ZLMf3TIKwcOvaOFrVvvhzK-EcWmGOUZxKkbSoByyQA,248
|
|
24
|
-
tenzir_test-0.
|
|
25
|
-
tenzir_test-0.
|
|
26
|
-
tenzir_test-0.
|
|
27
|
-
tenzir_test-0.
|
|
28
|
-
tenzir_test-0.
|
|
24
|
+
tenzir_test-0.14.0.dist-info/METADATA,sha256=EJ_Mx0170X9a9qvzeCdtt7sRwoYmBF26vor7NJWYUgE,3066
|
|
25
|
+
tenzir_test-0.14.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
26
|
+
tenzir_test-0.14.0.dist-info/entry_points.txt,sha256=l8DJgiEVrjScdTTo613cZ3PKodOmqrUVIbz-3awfV8w,53
|
|
27
|
+
tenzir_test-0.14.0.dist-info/licenses/LICENSE,sha256=ajMbpcBiSTXI8Rr4t17pvowV-On8DktghfZKxY_A22Q,10750
|
|
28
|
+
tenzir_test-0.14.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|