Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/regression-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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('<details>\n');
let kept = head;
// The first <details> block is the table, which is always kept.
const [head, table, ...blocks] = report.split('<details>\n');
let kept = head + '<details>\n' + table;
let shown = 0;
for (const block of blocks) {
if (kept.length + block.length > MAX_REPORT) break;
Expand Down
6 changes: 4 additions & 2 deletions acceptance/regression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <details> block when it trims the comment.
fmt.Fprintf(&b, "<details>\n<summary>%d tests: %s</summary>\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 {
Expand All @@ -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</details>\n\n")

for _, test := range tests {
renderDetails(&b, test, columns)
Expand Down
3 changes: 2 additions & 1 deletion acceptance/regression_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<details>\n<summary>2 tests: regression=1 unreleased=0 coverage=0 failing=1</summary>\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</details>\n")
assert.Contains(t, report, "**main (abc):**\n````\nmain failure\n````")
assert.Contains(t, report, "failing=1")
}
Expand Down
Loading