Skip to content

Commit 7b0efe6

Browse files
Report added removed tests (#245)
* add added and removed tests report
1 parent 3981385 commit 7b0efe6

File tree

18 files changed

+157
-32
lines changed

18 files changed

+157
-32
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ For more advanced usage, there are several inputs available.
121121
# Reports - Choose as many as you like. Default is false. Choosing none will use default reports.
122122
summary-report: true
123123
summary-delta-report: false
124+
tests-changed-report: false
124125
github-report: false
125126
test-report: false
126127
test-list-report: false

__tests__/ctrf/helpers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ describe('stripAnsi', () => {
111111
// @ts-expect-error Testing runtime error
112112
expect(() => stripAnsi({})).toThrow(TypeError)
113113
})
114-
})
114+
})

__tests__/ctrf/report-preparation.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ function createSingleReportInputs(): Inputs {
491491
collapseLargeReports: false,
492492
summaryReport: true, // Only 1 report enabled
493493
summaryDeltaReport: false,
494+
testsChangedReport: false,
494495
githubReport: false,
495496
testReport: false,
496497
testListReport: false,

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ inputs:
3030
description: 'Include the summary delta report.'
3131
required: false
3232
default: false
33+
tests-changed-report:
34+
description:
35+
'Include the tests changed report showing added and removed tests.'
36+
required: false
37+
default: false
3338
github-report:
3439
description: 'Include the GitHub report.'
3540
required: false

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 23 additions & 13 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/tests-changed-table.hbs

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

docs/report-showcase.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ execution.
77

88
- [Report Showcase](#report-showcase)
99
- [Summary Report](#summary-report)
10+
- [Summary Delta Report](#summary-delta-report)
1011
- [GitHub Report](#github-report)
1112
- [Test Report](#test-report)
1213
- [Test List Report](#test-list-report)
@@ -17,6 +18,7 @@ execution.
1718
- [Failed Folded Report](#failed-folded-report)
1819
- [Previous Results Report](#previous-results-report)
1920
- [Insights Report](#insights-report)
21+
- [Tests Changed Report](#tests-changed-report)
2022
- [Slowest Report](#slowest-report)
2123
- [AI Report](#ai-report)
2224
- [Skipped Report](#skipped-report)
@@ -80,8 +82,6 @@ Set the `summary-delta-report` input to true in your workflow configuration:
8082
| --- | --- | --- | --- | --- | --- | --- |
8183
| **58**    *↑2* | **58**    *±0* | **0**    *±0* | **0**    *±0* | **0**    *±0* | **0**    *±0* | **11.2s**    *↓2ms* |
8284

83-
84-
8585
## File Report
8686

8787
### Overview
@@ -711,6 +711,45 @@ Set the `insights-report` input to true in your workflow configuration:
711711

712712
<sub><i>Measured over 2 runs.</i></sub>
713713

714+
## Tests Changed Report
715+
716+
### Overview
717+
718+
Displays tests that have been added or removed compared to a baseline or previous run. This report helps track test suite evolution over time by showing exactly which tests are new and which have been removed. Each test is listed with its name and suite hierarchy, making it easy to identify changes in your test coverage.
719+
720+
Requires previous test results or a baseline for comparison.
721+
722+
### Usage
723+
724+
Set the `tests-changed-report` input to true in your workflow configuration:
725+
726+
```yaml
727+
- name: Publish Test Report
728+
uses: ctrf-io/github-test-reporter@v1
729+
with:
730+
report-path: './ctrf/*.json'
731+
tests-changed-report: true
732+
if: always()
733+
```
734+
735+
---
736+
737+
**3 new tests added, 1 removed**
738+
739+
### Added ➕
740+
741+
| **Name** | **Suite** |
742+
| --- | --- |
743+
| should handle async operations correctly | API Tests > Authentication |
744+
| should validate user input | API Tests > Validation |
745+
| should cache results properly | Performance Tests |
746+
747+
### Removed ➖
748+
749+
| **Name** | **Suite** |
750+
| --- | --- |
751+
| deprecated legacy test | Legacy Suite > Old Tests |
752+
714753
## Slowest Report
715754

716755
### Overview

src/core/inputs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function getCliInputs(args: Arguments): Inputs {
2020
collapseLargeReports: false,
2121
summaryReport: args._.includes('summary'),
2222
summaryDeltaReport: args._.includes('summary-delta'),
23+
testsChangedReport: args._.includes('tests-changed'),
2324
githubReport: args._.includes('github'),
2425
testReport: args._.includes('tests'),
2526
testListReport: args._.includes('test-list'),
@@ -105,6 +106,8 @@ export function getInputs(): Inputs {
105106
summaryReport: core.getInput('summary-report').toLowerCase() === 'true',
106107
summaryDeltaReport:
107108
core.getInput('summary-delta-report').toLowerCase() === 'true',
109+
testsChangedReport:
110+
core.getInput('tests-changed-report').toLowerCase() === 'true',
108111
testReport: core.getInput('test-report').toLowerCase() === 'true',
109112
testListReport: core.getInput('test-list-report').toLowerCase() === 'true',
110113
failedReport: core.getInput('failed-report').toLowerCase() === 'true',

0 commit comments

Comments
 (0)