Skip to content

Commit d6d1c31

Browse files
committed
Update
[ghstack-poisoned]
2 parents 51137cd + 4410ca1 commit d6d1c31

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

backends/test/suite/flows/vulkan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def _create_vulkan_flow_base(
2020
tester_factory=VulkanTester,
2121
quantize=quantize_stage_factory is not None,
2222
quantize_stage_factory=quantize_stage_factory,
23+
skip_patterns=["float16", "float64"], # Not supported in swiftshader
2324
)
2425

2526

backends/test/suite/generate_markdown_summary.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@
1212
#
1313

1414

15+
def escape_for_markdown(text: str) -> str:
16+
"""
17+
Modify a string to properly display in a markdown table cell.
18+
"""
19+
if not text:
20+
return text
21+
22+
# Replace newlines with <br /> tags
23+
escaped = text.replace('\n', '<br />')
24+
25+
# Escape backslashes.
26+
escaped = escaped.replace('\\', '\\\\')
27+
28+
# Escape pipe characters that would break table structure
29+
escaped = escaped.replace('|', '\\|')
30+
31+
return escaped
32+
33+
1534
def generate_markdown(csv_path: str, exit_code: int = 0): # noqa (C901)
1635
# Print warning if exit code is non-zero
1736
if exit_code != 0:
@@ -46,7 +65,7 @@ def generate_markdown(csv_path: str, exit_code: int = 0): # noqa (C901)
4665

4766
for row in data_rows:
4867
# Make a copy of the row to avoid modifying the original
49-
processed_row = row.copy()
68+
processed_row = [escape_for_markdown(cell) for cell in row]
5069

5170
# Count results and collect failed tests
5271
if result_column_index is not None and result_column_index < len(row):
@@ -96,7 +115,8 @@ def generate_markdown(csv_path: str, exit_code: int = 0): # noqa (C901)
96115
# Generate Failed Tests section
97116
print("# Failed Tests\n")
98117
if failed_tests:
99-
print("| " + " | ".join(header) + " |")
118+
escaped_header = [escape_for_markdown(col) for col in header]
119+
print("| " + " | ".join(escaped_header) + " |")
100120
print("|" + "|".join(["---"] * len(header)) + "|")
101121
for row in failed_tests:
102122
print("| " + " | ".join(row) + " |")

0 commit comments

Comments
 (0)