Skip to content

Commit 9dd22f3

Browse files
committed
Adjust test_index indexing
1 parent 1327eb7 commit 9dd22f3

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

planemo/commands/cmd_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"--test_index",
2525
type=int,
2626
multiple=True,
27-
help="Index(es) of specific test(s) to run (0-based). "
28-
"Can be specified multiple times (e.g., --test_index 0 --test_index 2) "
27+
help="Index(es) of specific test(s) to run (1-based). "
28+
"Can be specified multiple times (e.g., --test_index 1 --test_index 3) "
2929
"to run specific tests. If not specified, all tests are run.",
3030
default=(),
3131
)

planemo/engine/interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ def test(self, runnables, test_timeout):
8080

8181
# Filter test cases by specified indices if provided
8282
test_indices = self._kwds.get("test_index", ())
83+
if any(i < 1 for i in test_indices):
84+
raise ValueError("test_index must be 1-based (>= 1)")
8385
if test_indices:
84-
filtered_test_cases = [tc for i, tc in enumerate(test_cases) if i in test_indices]
86+
filtered_test_cases = [tc for i, tc in enumerate(test_cases, start=1) if i in test_indices]
8587
if filtered_test_cases:
8688
test_cases = filtered_test_cases
8789
else:

tests/test_cmd_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_test_index(self):
146146
test_command += [
147147
"--no_dependency_resolution",
148148
"--test_index",
149-
"0",
149+
"1",
150150
test_artifact,
151151
]
152152
self._check_exit_code(test_command, exit_code=0)

0 commit comments

Comments
 (0)