Skip to content

Commit 6fc3e33

Browse files
authored
[CI]This PR fixes the printing error in the detail section and adds the .py suffix to the displayed test cases. (vllm-project#12921)
### For precise testing usage, it is recommended to add the .py suffix to test case files. ### This is not user-facing; it only means that when recommended test cases are displayed, they will include the .py file suffix. ### The recommended test case display includes .py suffix information. - vLLM version: v0.25.1 - vLLM main: vllm-project/vllm@fe784ff --------- Signed-off-by: shenhui-cli <shenhui85@126.com>
1 parent 251f21f commit 6fc3e33

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/scripts/test_selector.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,19 @@ def scan_test_cases(self) -> list[str]:
164164
def normalize_test_name(test_name: str) -> str:
165165
"""
166166
Convert test case directory name to standard script name format:
167-
- tests__e2e__... -> tests/e2e/...
168-
- tests__e2e__...--test_foo -> tests/e2e/...::test_foo
167+
- tests__e2e__... -> tests/e2e/... (file-level) -> tests/e2e/....py (with .py suffix)
168+
- tests__e2e__...--test_foo -> tests/e2e/...::test_foo (function-level, no .py suffix)
169169
- cpu-ut -> cpu-ut (unchanged)
170170
"""
171171
if test_name == "cpu-ut":
172172
return test_name
173-
# First convert -- to ::
173+
# First convert -- to :: (function-level test marker)
174174
result = test_name.replace("--", "::")
175175
# Then convert __ to /
176176
result = result.replace("__", "/")
177+
# If no :: (file-level test), add .py suffix
178+
if "::" not in result:
179+
result = result + ".py"
177180
return result
178181

179182
def get_covered_lines_from_file(self, cov_file: str, filename: str) -> set[int]:
@@ -936,7 +939,7 @@ def print_selection(
936939
print(f"\n{gran_detail_titles.get(expand_reason, 'Details')}:")
937940
for test_case, affected_detail, total_lines in selected[:10]:
938941
print(f"\n {test_case} ({total_lines} lines):")
939-
for filepath, lines in sorted(changed_files.items()):
942+
for filepath, lines in sorted(affected_detail.items()):
940943
line_str = self._format_line_range(sorted(lines))
941944
print(f" - {filepath}: {line_str}")
942945

0 commit comments

Comments
 (0)