Skip to content

Commit 2eb578a

Browse files
Feat/file report (#174)
1 parent 78f2a03 commit 2eb578a

File tree

22 files changed

+455
-18
lines changed

22 files changed

+455
-18
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
with:
4343
report-path: './ctrf/*.json'
4444
pull-request-report: true
45+
annotate: false
4546
env:
4647
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4748
if: always()
@@ -300,6 +301,25 @@ jobs:
300301
env:
301302
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
302303
if: always()
304+
file-reports-test:
305+
needs: build-and-test
306+
runs-on: ubuntu-latest
307+
steps:
308+
- name: Checkout code
309+
uses: actions/checkout@v4
310+
- name: Install dependencies
311+
run: npm install
312+
- name: Modify reports
313+
run: npm run modify-reports
314+
- name: File Reports Test
315+
uses: ./
316+
with:
317+
report-path: './ctrf-reports/*.json'
318+
file-report: true
319+
annotate: false
320+
env:
321+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
322+
if: always()
303323
npx-cli-test:
304324
runs-on: ubuntu-latest
305325
needs: build-and-test
@@ -313,4 +333,4 @@ jobs:
313333
- name: Modify reports
314334
run: npm run modify-reports
315335
- name: Default tables
316-
run: node dist/core/cli.js ctrf-reports/ctrf-report.json --title "Default tables" --annotate false
336+
run: node dist/core/cli.js ctrf-reports/ctrf-report.json --title "Default tables" --annotate false

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ There are several inputs available
140140
skipped-report: false
141141
suite-folded-report: false
142142
suite-list-report: false
143+
file-report: false
143144
pull-request-report: false
144145
commit-report: false
145146
custom-report: false
@@ -157,13 +158,13 @@ There are several inputs available
157158
on-fail-only: false # Add a pull request comment only if tests fail. Default is false
158159
exit-on-fail: false # Exit the workflow with a failure status if any tests fail. Default is false
159160
use-suite-name: false # Prefix test names with the suite name for better grouping. Default is false
161+
collapse-large-reports: false # Collapse large reports (test-table and test-list) for better readability. Default is false
160162
update-comment: false # Update existing Pull Request comment. Default is false
161163
overwrite-comment: false # Overwrite existing Pull Request comment. Default is false
162164
always-latest-comment: false # Create a new comment if the existing comment is not the latest in the thread. Default is false
163165
comment-tag: false # Tag to match Pull Request comment
164166
write-ctrf-to-file: 'ctrf/ctrf-report.json' # Path to write the internal processed CTRF report for future processing. Default no write
165167
upload-artifact: true # Upload to workflow artifact the processed CTRF report for future processing. Default false
166-
comment-tag: '' # Tag to match Pull Request comment
167168
168169
# Advanced Options
169170
artifact-name: 'ctrf-report' # Name of the artifact containing test reports. Default is ctrf-report

__tests__/ctrf/report-preparation.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ function createSingleReportInputs(): Inputs {
574574
customReport: false,
575575
insightsReport: false,
576576
slowestReport: false,
577+
fileReport: false,
577578
communityReport: false,
578579
communityReportName: '',
579580
artifactName: '',

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ inputs:
7878
description: 'Include the suite list report.'
7979
required: false
8080
default: false
81+
file-report:
82+
description: 'Include the file report showing tests grouped by file path.'
83+
required: false
84+
default: false
8185
insights-report:
8286
description:
8387
'Include the insights report showing test metrics and statistics.'

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

ctrf-reports/ctrf-report.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@
9595
}
9696
]
9797
}
98-
}
98+
}

dist/index.js

Lines changed: 63 additions & 5 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/file-table.hbs

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

dist/reports/flaky-table.hbs

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

0 commit comments

Comments
 (0)