Skip to content

Commit 85f1375

Browse files
Lower failed test threshold to 173,986 and show example queries per failure category
Set `MAX_FAILED_TESTS` to 173,986 and add up to 5 example queries for each failure category in the SQLLogic HTML report. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bdc2d3e commit 85f1375

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

ci/jobs/sqllogic_test.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
temp_dir = f"{Utils.cwd()}/ci/tmp/"
1414

1515
MIN_TOTAL_TESTS = 5_939_581
16-
MAX_FAILED_TESTS = 201_707
16+
MAX_FAILED_TESTS = 173_986
1717

1818

1919
# Reuse the same ClickHouseBinary helper from sqltest_job.py
@@ -105,10 +105,15 @@ def load_stage_reports(out_dir, mode_name):
105105
return reports
106106

107107

108+
MAX_EXAMPLES_PER_CATEGORY = 5
109+
110+
108111
def classify_failures(report):
109112
"""Classify failed requests from a stage report by reason category.
110-
Returns sorted list of (count, category) tuples, descending by count."""
113+
Returns sorted list of (count, category, examples) tuples, descending by count.
114+
Each example is a query string (up to MAX_EXAMPLES_PER_CATEGORY per category)."""
111115
categories = {}
116+
examples = {}
112117
code_re = re.compile(r"Code: (\d+)")
113118

114119
for test_data in report.get("tests", {}).values():
@@ -140,7 +145,17 @@ def classify_failures(report):
140145

141146
categories[cat] = categories.get(cat, 0) + 1
142147

143-
return sorted(categories.items(), key=lambda x: -x[1])
148+
if cat not in examples:
149+
examples[cat] = []
150+
if len(examples[cat]) < MAX_EXAMPLES_PER_CATEGORY:
151+
query = req.get("request", "")
152+
if query:
153+
examples[cat].append(query)
154+
155+
return sorted(
156+
[(count, cat, examples.get(cat, [])) for cat, count in categories.items()],
157+
key=lambda x: -x[0],
158+
)
144159

145160

146161
def check_thresholds(complete_test_reports):
@@ -250,12 +265,22 @@ def color_tag(ratio):
250265
classified = classify_failures(report)
251266
if classified:
252267
f.write(f" Failure categories:\n")
253-
for cat, count in classified:
268+
for count, cat, cat_examples in classified:
254269
pct = 100.0 * count / fail if fail else 0
255270
f.write(
256271
f" <b style='color: red;'>{count:>9,}</b>"
257272
f" {pct:5.1f}% {html.escape(cat)}\n"
258273
)
274+
for example in cat_examples:
275+
truncated = example[:200]
276+
if len(example) > 200:
277+
truncated += "..."
278+
# Collapse multi-line queries to single line
279+
truncated = truncated.replace("\n", " ")
280+
f.write(
281+
f" <span style='color: gray;'>"
282+
f"{html.escape(truncated)}</span>\n"
283+
)
259284

260285
f.write("\n")
261286

0 commit comments

Comments
 (0)