Skip to content

Commit dcb0850

Browse files
Feat/use ctrf commons (#182)
* feat: add ctrf commons * feat: add max previous runs to fetch
1 parent 073c731 commit dcb0850

File tree

25 files changed

+27417
-21336
lines changed

25 files changed

+27417
-21336
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ node_modules/
44
coverage/
55
templates/
66
scripts/
7-

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ For more advanced usage, there are several inputs available.
156156
previous-results-max: 10 # Maximum number of previous test results to display in the report. Default is 10
157157
fetch-previous-results: false # Always fetch previous workflow runs when using custom templates. Default is false
158158
max-workflow-runs-to-check: 400 # Maximum number of workflow runs to check for previous results. Default is 400
159+
max-previous-runs-to-fetch: 100 # Maximum number of previous runs to fetch and process for metrics and reports. Default is 100
159160
group-by: 'filePath' # Specify grouping for applicable reports (e.g., suite or file path). Default is filePath
160161
always-group-by: false # Force grouping by suite or file path for all reports. Default is false
161162
report-order: 'summary-report,failed-report,flaky-report,skipped-report,test-report' # Comma-separated list of report types to specify the order in which reports should be displayed

__tests__/ctrf/report-preparation.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,15 @@ describe('addFooterDisplayFlags', () => {
501501
})
502502
})
503503

504+
describe('Inputs with maxPreviousRunsToFetch', () => {
505+
it('should handle maxPreviousRunsToFetch parameter correctly', () => {
506+
const inputs = createSingleReportInputs()
507+
inputs.maxPreviousRunsToFetch = 50
508+
509+
expect(inputs.maxPreviousRunsToFetch).toBe(50)
510+
})
511+
})
512+
504513
function createMultipleReportsInputs(): Inputs {
505514
return {
506515
...createSingleReportInputs(),
@@ -586,6 +595,7 @@ function createSingleReportInputs(): Inputs {
586595
previousResultsMax: 0,
587596
metricsReportsMax: 0,
588597
maxWorkflowRunsToCheck: 0,
598+
maxPreviousRunsToFetch: 0,
589599
fetchPreviousResults: false,
590600
updateComment: false,
591601
overwriteComment: false,

action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,22 @@ inputs:
205205
'Maximum number of workflow runs to check for previous results.'
206206
required: false
207207
default: 400
208+
max-previous-runs-to-fetch:
209+
description:
210+
'Maximum number of previous runs to fetch and process for metrics and
211+
reports.'
212+
required: false
213+
default: 100
214+
baseline:
215+
description:
216+
'Baseline for metrics comparison. Number = previous n reports, string =
217+
reportId.'
218+
required: false
219+
default: 10
220+
baseline-report-path:
221+
description: 'Path to a specific CTRF report to use as a baseline.'
222+
required: false
223+
default: ''
208224
group-by:
209225
description: >
210226
Specify grouping for applicable reports (e.g., suite or file path).

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)