diff --git a/.github/workflows/regression-report.yml b/.github/workflows/regression-report.yml index 7b69e2680c6..0abafc74642 100644 --- a/.github/workflows/regression-report.yml +++ b/.github/workflows/regression-report.yml @@ -148,8 +148,9 @@ jobs: const MAX_REPORT = 60000; let report = fs.readFileSync(path, 'utf8'); if (report.length > MAX_REPORT) { - const [head, ...blocks] = report.split('
\n'); - let kept = head; + // The first
block is the table, which is always kept. + const [head, table, ...blocks] = report.split('
\n'); + let kept = head + '
\n' + table; let shown = 0; for (const block of blocks) { if (kept.length + block.length > MAX_REPORT) break; diff --git a/acceptance/regression_test.go b/acceptance/regression_test.go index c37ad214c4e..bcae5a96a84 100644 --- a/acceptance/regression_test.go +++ b/acceptance/regression_test.go @@ -226,8 +226,10 @@ func renderRegressionReport(selected string, columns []regrColumn) string { var b strings.Builder b.WriteString("## Regression test report\n\n") fmt.Fprintf(&b, "%s\n\n", selected) - fmt.Fprintf(&b, "%d tests: %s\n\n", len(tests), formatCounts(countByCategory(tests, branch, refs))) + // The table has a row per test variant, often hundreds, so it is collapsed. The workflow + // that posts the report always keeps this first
block when it trims the comment. + fmt.Fprintf(&b, "
\n%d tests: %s\n\n", len(tests), formatCounts(countByCategory(tests, branch, refs))) b.WriteString("| test | " + strings.Join(columnTitles(columns), " | ") + " |\n") b.WriteString("|---|" + strings.Repeat("---|", len(columns)) + "\n") for _, test := range tests { @@ -237,7 +239,7 @@ func renderRegressionReport(selected string, columns []regrColumn) string { } fmt.Fprintf(&b, "| %s | %s |\n", test, strings.Join(marks, " | ")) } - b.WriteString("\n") + b.WriteString("\n
\n\n") for _, test := range tests { renderDetails(&b, test, columns) diff --git a/acceptance/regression_unit_test.go b/acceptance/regression_unit_test.go index 8a5900ce10c..4583e04d2b2 100644 --- a/acceptance/regression_unit_test.go +++ b/acceptance/regression_unit_test.go @@ -62,8 +62,9 @@ func TestRenderRegressionReport(t *testing.T) { }} report := renderRegressionReport("Selected 2", []regrColumn{branch, main}) - assert.Contains(t, report, "| test | branch | main (abc) |") + assert.Contains(t, report, "
\n2 tests: regression=1 unreleased=0 coverage=0 failing=1\n\n| test | branch | main (abc) |") assert.Contains(t, report, "| TestAccept/bundle/a | ❌ | ❌ |") + assert.Contains(t, report, "| TestAccept/bundle/inv/DMS=true/INPUT_CONFIG=x.yml.tmpl | ✅ | ➖ |\n\n
\n") assert.Contains(t, report, "**main (abc):**\n````\nmain failure\n````") assert.Contains(t, report, "failing=1") }