Skip to content

Commit 99b0874

Browse files
fix report generation
1 parent 6f2b8bf commit 99b0874

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

.github/workflows/unit-tests.yml

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,41 +51,42 @@ jobs:
5151
5252
New-Item -ItemType Directory -Path "docs" -Force | Out-Null
5353
54-
$reportLines = @(
55-
"# Unit Test Report",
56-
"",
57-
"**Run Date**: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss UTC')",
58-
"**Branch**: ${{ github.ref_name }}",
59-
"**Commit**: ${{ github.sha }}",
60-
"",
61-
"## Summary",
62-
"",
63-
"| Metric | Count |",
64-
"|--------|-------|",
65-
"| Total Tests | $total |",
66-
"| ✅ Passed | $passed |",
67-
"| ❌ Failed | $failed |",
68-
"| Duration | $duration |",
69-
"",
70-
"## Test Categories",
71-
"",
72-
"- Lexer Tests",
73-
"- Filtering Tests",
74-
"- Storage Tests",
75-
"- Index Tests (BTree, Hash)",
76-
"- Mutation Tests",
77-
"- Parsing Tests",
78-
"",
79-
"## Status",
80-
"",
81-
if ($failed -eq 0) { "✅ **All tests passing**" } else { "❌ **Tests failed**" },
82-
"",
83-
"---",
84-
"",
85-
"[View Full Test Results](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
86-
)
54+
$status = if ($failed -eq 0) { "✅ **All tests passing**" } else { "❌ **Tests failed**" }
55+
$runDate = Get-Date -Format 'yyyy-MM-dd HH:mm:ss UTC'
56+
$repoUrl = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
57+
58+
$report = "# Unit Test Report`n"
59+
$report += "`n"
60+
$report += "**Run Date**: $runDate`n"
61+
$report += "**Branch**: ${{ github.ref_name }}`n"
62+
$report += "**Commit**: ${{ github.sha }}`n"
63+
$report += "`n"
64+
$report += "## Summary`n"
65+
$report += "`n"
66+
$report += "| Metric | Count |`n"
67+
$report += "|--------|-------|`n"
68+
$report += "| Total Tests | $total |`n"
69+
$report += "| ✅ Passed | $passed |`n"
70+
$report += "| ❌ Failed | $failed |`n"
71+
$report += "| Duration | $duration |`n"
72+
$report += "`n"
73+
$report += "## Test Categories`n"
74+
$report += "`n"
75+
$report += "- Lexer Tests`n"
76+
$report += "- Filtering Tests`n"
77+
$report += "- Storage Tests`n"
78+
$report += "- Index Tests (BTree, Hash)`n"
79+
$report += "- Mutation Tests`n"
80+
$report += "- Parsing Tests`n"
81+
$report += "`n"
82+
$report += "## Status`n"
83+
$report += "`n"
84+
$report += "$status`n"
85+
$report += "`n"
86+
$report += "---`n"
87+
$report += "`n"
88+
$report += "[View Full Test Results]($repoUrl)`n"
8789
88-
$report = $reportLines -join "`n"
8990
$report | Out-File -FilePath "docs/unit-test-report.md" -Encoding UTF8 -Force
9091
9192
Write-Host "Report saved to docs/unit-test-report.md"

0 commit comments

Comments
 (0)