Skip to content

Commit feae206

Browse files
committed
feat: enhance slowest tests report with additional details
1 parent 92ebbb8 commit feae206

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

dist/index.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reports/slowest-table.hbs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ctrf/enrichers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export function enrichReportSummary(
345345
)
346346
const slowestTest = findSlowestTestByP95(report.results.tests)
347347

348-
report.results.tests = calculateAndSortTestDurations(
348+
const slowestTests = calculateAndSortTestDurations(
349349
report.results.tests,
350350
previousReports
351351
)
@@ -362,7 +362,8 @@ export function enrichReportSummary(
362362
averageTestsPerRun,
363363
totalFlakyTests,
364364
totalFailures,
365-
slowestTest
365+
slowestTest,
366+
slowestTests
366367
}
367368
}
368369

src/github/core.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export function generateViews(inputs: Inputs, report: CtrfReport): void {
3636
inputs.commitReport ||
3737
inputs.customReport ||
3838
inputs.communityReport ||
39-
inputs.insightsReport
39+
inputs.insightsReport ||
40+
inputs.slowestReport
4041

4142
if (!isAnyReportEnabled) {
4243
core.info(

src/reports/slowest-table.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
| Test Name | Average Duration |
22
|-----------|-----------------|
3-
{{#each ctrf.results.tests}}
3+
{{#each ctrf.summary.extra.slowestTests}}
44
{{#if extra.avgDuration}}
55
| {{name}} | {{formatDuration 0 extra.avgDuration}} |
66
{{/if}}
77
{{/each}}
88

9-
<sub><i>Measured over {{ctrf.summary.extra.reportsUsed}} runs.</i></sub>
9+
*Measured over {{ctrf.summary.extra.reportsUsed}} runs.*

src/types/ctrf.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export interface EnhancedSummaryExtra extends Record<string, unknown> {
132132
name: string
133133
duration: number
134134
}
135+
slowestTests?: CtrfTest[]
135136
}
136137

137138
/**

0 commit comments

Comments
 (0)