Update app.py
Browse files
app.py
CHANGED
|
@@ -234,15 +234,21 @@ def _filter_records(repo: str, pr: str, sha: str) -> List[dict]:
|
|
| 234 |
def _generate_html_tables(record: dict) -> Tuple[str, str]:
|
| 235 |
"""Generate HTML tables with proper horizontal scrolling and full text display."""
|
| 236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
# By test table
|
| 238 |
by_test_html = """
|
| 239 |
-
<div style="overflow-x: auto; max-width: 100%; border: 2px solid #
|
| 240 |
<table style="width: 100%; border-collapse: collapse; font-family: monospace; font-size: 13px;">
|
| 241 |
<thead>
|
| 242 |
-
<tr style="background-color: #
|
| 243 |
-
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 400px; background-color: #
|
| 244 |
-
<th style="padding: 12px; text-align: center; white-space: nowrap; width: 80px; color: #
|
| 245 |
-
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 600px; color: #
|
| 246 |
</tr>
|
| 247 |
</thead>
|
| 248 |
<tbody>
|
|
@@ -253,19 +259,19 @@ def _generate_html_tables(record: dict) -> Tuple[str, str]:
|
|
| 253 |
count = test_info.get("count", 0)
|
| 254 |
errors = test_info.get("errors", {})
|
| 255 |
|
| 256 |
-
# Format errors with line breaks
|
| 257 |
error_lines = []
|
| 258 |
for err, cnt in errors.items():
|
| 259 |
-
error_lines.append(f"<div style='margin-bottom: 8px; color: #
|
| 260 |
error_html = "".join(error_lines)
|
| 261 |
|
| 262 |
-
row_bg = "#
|
| 263 |
|
| 264 |
by_test_html += f"""
|
| 265 |
-
<tr style="background-color: {row_bg}; border-bottom: 2px solid #
|
| 266 |
-
<td style="padding: 12px; white-space: nowrap; background-color: {row_bg}; color: #
|
| 267 |
-
<td style="padding: 12px; text-align: center; color: #
|
| 268 |
-
<td style="padding: 12px; white-space: normal; color: #
|
| 269 |
</tr>
|
| 270 |
"""
|
| 271 |
|
|
@@ -277,13 +283,13 @@ def _generate_html_tables(record: dict) -> Tuple[str, str]:
|
|
| 277 |
|
| 278 |
# By model table
|
| 279 |
by_model_html = """
|
| 280 |
-
<div style="overflow-x: auto; max-width: 100%; border: 2px solid #
|
| 281 |
<table style="width: 100%; border-collapse: collapse; font-family: monospace; font-size: 13px;">
|
| 282 |
<thead>
|
| 283 |
-
<tr style="background-color: #
|
| 284 |
-
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 150px; background-color: #
|
| 285 |
-
<th style="padding: 12px; text-align: center; white-space: nowrap; width: 80px; color: #
|
| 286 |
-
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 600px; color: #
|
| 287 |
</tr>
|
| 288 |
</thead>
|
| 289 |
<tbody>
|
|
@@ -294,19 +300,19 @@ def _generate_html_tables(record: dict) -> Tuple[str, str]:
|
|
| 294 |
count = model_info.get("count", 0)
|
| 295 |
errors = model_info.get("errors", {})
|
| 296 |
|
| 297 |
-
# Format errors with line breaks
|
| 298 |
error_lines = []
|
| 299 |
for err, cnt in errors.items():
|
| 300 |
-
error_lines.append(f"<div style='margin-bottom: 8px; color: #
|
| 301 |
error_html = "".join(error_lines)
|
| 302 |
|
| 303 |
-
row_bg = "#
|
| 304 |
|
| 305 |
by_model_html += f"""
|
| 306 |
-
<tr style="background-color: {row_bg}; border-bottom: 2px solid #
|
| 307 |
-
<td style="padding: 12px; white-space: nowrap; background-color: {row_bg}; color: #
|
| 308 |
-
<td style="padding: 12px; text-align: center; color: #
|
| 309 |
-
<td style="padding: 12px; white-space: normal; color: #
|
| 310 |
</tr>
|
| 311 |
"""
|
| 312 |
|
|
@@ -662,9 +668,9 @@ with gr.Blocks(title="CircleCI Test Results Viewer") as demo:
|
|
| 662 |
"""
|
| 663 |
---
|
| 664 |
|
| 665 |
-
**Data source:** [transformers-community/circleci-test-results](https://huggingface.co/datasets/transformers-community/circleci-test-results)
|
| 666 |
|
| 667 |
-
|
| 668 |
"""
|
| 669 |
)
|
| 670 |
|
|
|
|
| 234 |
def _generate_html_tables(record: dict) -> Tuple[str, str]:
|
| 235 |
"""Generate HTML tables with proper horizontal scrolling and full text display."""
|
| 236 |
|
| 237 |
+
# Warm color scheme: cream/beige background with dark brown/sepia text
|
| 238 |
+
# Background colors: cream (#FFF8E7), light beige (#FFF4E0)
|
| 239 |
+
# Text: dark brown (#3E2723)
|
| 240 |
+
# Accents: warm brown (#8D6E63), blue (#1976D2)
|
| 241 |
+
# Borders: medium brown (#A1887F)
|
| 242 |
+
|
| 243 |
# By test table
|
| 244 |
by_test_html = """
|
| 245 |
+
<div style="overflow-x: auto; max-width: 100%; border: 2px solid #8D6E63; border-radius: 8px; background-color: #FFF8E7;">
|
| 246 |
<table style="width: 100%; border-collapse: collapse; font-family: monospace; font-size: 13px;">
|
| 247 |
<thead>
|
| 248 |
+
<tr style="background-color: #FFE4B5; border-bottom: 2px solid #8D6E63;">
|
| 249 |
+
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 400px; background-color: #FFE4B5; color: #3E2723; border-right: 2px solid #A1887F;">Test</th>
|
| 250 |
+
<th style="padding: 12px; text-align: center; white-space: nowrap; width: 80px; color: #3E2723; border-right: 2px solid #A1887F;">Failures</th>
|
| 251 |
+
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 600px; color: #3E2723;">Full error(s)</th>
|
| 252 |
</tr>
|
| 253 |
</thead>
|
| 254 |
<tbody>
|
|
|
|
| 259 |
count = test_info.get("count", 0)
|
| 260 |
errors = test_info.get("errors", {})
|
| 261 |
|
| 262 |
+
# Format errors with line breaks
|
| 263 |
error_lines = []
|
| 264 |
for err, cnt in errors.items():
|
| 265 |
+
error_lines.append(f"<div style='margin-bottom: 8px; color: #3E2723;'><span style='color: #1976D2;'>{cnt}×</span> {err}</div>")
|
| 266 |
error_html = "".join(error_lines)
|
| 267 |
|
| 268 |
+
row_bg = "#FFF8E7" if idx % 2 == 0 else "#FFF4E0"
|
| 269 |
|
| 270 |
by_test_html += f"""
|
| 271 |
+
<tr style="background-color: {row_bg}; border-bottom: 2px solid #D7CCC8;">
|
| 272 |
+
<td style="padding: 12px; white-space: nowrap; background-color: {row_bg}; color: #3E2723; vertical-align: top; border-right: 2px solid #A1887F;">{test_name}</td>
|
| 273 |
+
<td style="padding: 12px; text-align: center; color: #3E2723; vertical-align: top; border-right: 2px solid #A1887F;">{count}</td>
|
| 274 |
+
<td style="padding: 12px; white-space: normal; color: #3E2723; vertical-align: top;">{error_html}</td>
|
| 275 |
</tr>
|
| 276 |
"""
|
| 277 |
|
|
|
|
| 283 |
|
| 284 |
# By model table
|
| 285 |
by_model_html = """
|
| 286 |
+
<div style="overflow-x: auto; max-width: 100%; border: 2px solid #8D6E63; border-radius: 8px; margin-top: 20px; background-color: #FFF8E7;">
|
| 287 |
<table style="width: 100%; border-collapse: collapse; font-family: monospace; font-size: 13px;">
|
| 288 |
<thead>
|
| 289 |
+
<tr style="background-color: #FFE4B5; border-bottom: 2px solid #8D6E63;">
|
| 290 |
+
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 150px; background-color: #FFE4B5; color: #3E2723; border-right: 2px solid #A1887F;">Model</th>
|
| 291 |
+
<th style="padding: 12px; text-align: center; white-space: nowrap; width: 80px; color: #3E2723; border-right: 2px solid #A1887F;">Failures</th>
|
| 292 |
+
<th style="padding: 12px; text-align: left; white-space: nowrap; min-width: 600px; color: #3E2723;">Full error(s)</th>
|
| 293 |
</tr>
|
| 294 |
</thead>
|
| 295 |
<tbody>
|
|
|
|
| 300 |
count = model_info.get("count", 0)
|
| 301 |
errors = model_info.get("errors", {})
|
| 302 |
|
| 303 |
+
# Format errors with line breaks
|
| 304 |
error_lines = []
|
| 305 |
for err, cnt in errors.items():
|
| 306 |
+
error_lines.append(f"<div style='margin-bottom: 8px; color: #3E2723;'><span style='color: #1976D2;'>{cnt}×</span> {err}</div>")
|
| 307 |
error_html = "".join(error_lines)
|
| 308 |
|
| 309 |
+
row_bg = "#FFF8E7" if idx % 2 == 0 else "#FFF4E0"
|
| 310 |
|
| 311 |
by_model_html += f"""
|
| 312 |
+
<tr style="background-color: {row_bg}; border-bottom: 2px solid #D7CCC8;">
|
| 313 |
+
<td style="padding: 12px; white-space: nowrap; background-color: {row_bg}; color: #3E2723; vertical-align: top; border-right: 2px solid #A1887F;">{model_name}</td>
|
| 314 |
+
<td style="padding: 12px; text-align: center; color: #3E2723; vertical-align: top; border-right: 2px solid #A1887F;">{count}</td>
|
| 315 |
+
<td style="padding: 12px; white-space: normal; color: #3E2723; vertical-align: top;">{error_html}</td>
|
| 316 |
</tr>
|
| 317 |
"""
|
| 318 |
|
|
|
|
| 668 |
"""
|
| 669 |
---
|
| 670 |
|
| 671 |
+
**Data source:** [https://huggingface.co/datasets/transformers-community/circleci-test-results](https://huggingface.co/datasets/transformers-community/circleci-test-results)
|
| 672 |
|
| 673 |
+
Files are organized as `pr-{PR}/sha-{COMMIT}/failure_summary.json`
|
| 674 |
"""
|
| 675 |
)
|
| 676 |
|