Skip to content

Commit d1aa139

Browse files
committed
add added and removed tests to report
1 parent 3981385 commit d1aa139

File tree

4 files changed

+15
-294
lines changed

4 files changed

+15
-294
lines changed

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

Lines changed: 0 additions & 274 deletions
Original file line numberDiff line numberDiff line change
@@ -56,278 +56,4 @@ jobs:
5656
annotate: false
5757
env:
5858
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
if: always()
60-
standard-reports-test:
61-
needs: build-and-test
62-
runs-on: ubuntu-latest
63-
steps:
64-
- name: Checkout code
65-
uses: actions/checkout@v4
66-
- name: Basic Test Report
67-
uses: ./
68-
with:
69-
report-path: './ctrf-reports/ctrf-report.json'
70-
summary-report: true
71-
annotate: false
72-
if: always()
73-
github-report-test:
74-
needs: build-and-test
75-
runs-on: ubuntu-latest
76-
steps:
77-
- name: Checkout code
78-
uses: actions/checkout@v4
79-
- name: Detailed Test Report
80-
uses: ./
81-
with:
82-
report-path: './ctrf-reports/ctrf-report.json'
83-
github-report: true
84-
annotate: false
85-
env:
86-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
if: always()
88-
detailed-reports-test:
89-
needs: build-and-test
90-
runs-on: ubuntu-latest
91-
steps:
92-
- name: Checkout code
93-
uses: actions/checkout@v4
94-
- name: Detailed Test Report
95-
uses: ./
96-
with:
97-
report-path: './ctrf-reports/ctrf-report.json'
98-
test-report: true
99-
test-list-report: true
100-
annotate: false
101-
env:
102-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103-
if: always()
104-
failed-reports-test:
105-
needs: build-and-test
106-
runs-on: ubuntu-latest
107-
steps:
108-
- name: Checkout code
109-
uses: actions/checkout@v4
110-
- name: Failed Test Reports
111-
uses: ./
112-
with:
113-
report-path: './ctrf-reports/ctrf-report.json'
114-
failed-report: true
115-
failed-folded-report: true
116-
annotate: false
117-
env:
118-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119-
if: always()
120-
flaky-reports-test:
121-
needs: build-and-test
122-
runs-on: ubuntu-latest
123-
steps:
124-
- name: Checkout code
125-
uses: actions/checkout@v4
126-
- name: Flaky Test Reports
127-
uses: ./
128-
with:
129-
report-path: './ctrf-reports/ctrf-report.json'
130-
flaky-report: true
131-
annotate: false
132-
env:
133-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134-
if: always()
135-
ai-reports-test:
136-
needs: build-and-test
137-
runs-on: ubuntu-latest
138-
steps:
139-
- name: Checkout code
140-
uses: actions/checkout@v4
141-
- name: AI Test Reports
142-
uses: ./
143-
with:
144-
report-path: './ctrf-reports/ctrf-report.json'
145-
ai-report: true
146-
annotate: false
147-
if: always()
148-
skipped-reports-test:
149-
needs: build-and-test
150-
runs-on: ubuntu-latest
151-
steps:
152-
- name: Checkout code
153-
uses: actions/checkout@v4
154-
- name: Skipped Test Reports
155-
uses: ./
156-
with:
157-
report-path: './ctrf-reports/ctrf-report.json'
158-
skipped-report: true
159-
annotate: false
160-
if: always()
161-
suite-reports-test:
162-
needs: build-and-test
163-
runs-on: ubuntu-latest
164-
steps:
165-
- name: Checkout code
166-
uses: actions/checkout@v4
167-
- name: Suite Test Reports
168-
uses: ./
169-
with:
170-
report-path: './ctrf-reports/ctrf-report.json'
171-
suite-list-report: true
172-
suite-folded-report: true
173-
annotate: false
174-
if: always()
175-
commit-reports-test:
176-
needs: build-and-test
177-
runs-on: ubuntu-latest
178-
steps:
179-
- name: Checkout code
180-
uses: actions/checkout@v4
181-
- name: Commit Test Reports
182-
uses: ./
183-
with:
184-
report-path: './ctrf-reports/ctrf-report.json'
185-
commit-report: true
186-
annotate: false
187-
if: always()
188-
custom-reports-test:
189-
needs: build-and-test
190-
runs-on: ubuntu-latest
191-
steps:
192-
- name: Checkout code
193-
uses: actions/checkout@v4
194-
- name: Custom Test Reports
195-
uses: ./
196-
with:
197-
report-path: './ctrf-reports/ctrf-report.json'
198-
custom-report: true
199-
template-path: './templates/custom-report.hbs'
200-
annotate: false
201-
if: always()
202-
community-reports-test:
203-
needs: build-and-test
204-
runs-on: ubuntu-latest
205-
steps:
206-
- name: Checkout code
207-
uses: actions/checkout@v4
208-
- name: Community Test Reports
209-
uses: ./
210-
with:
211-
report-path: './ctrf-reports/ctrf-report.json'
212-
community-report: true
213-
community-report-name: 'summary-short'
214-
annotate: false
215-
if: always()
216-
previous-reports-test:
217-
needs: build-and-test
218-
runs-on: ubuntu-latest
219-
steps:
220-
- name: Checkout code
221-
uses: actions/checkout@v4
222-
- name: Install dependencies
223-
run: npm install
224-
- name: Modify reports
225-
run: npm run modify-reports
226-
- name: Reports Requiring Previous
227-
uses: ./
228-
with:
229-
report-path: './ctrf-reports/*.json'
230-
previous-results-report: true
231-
flaky-rate-report: true
232-
fail-rate-report: true
233-
insights-report: true
234-
slowest-report: true
235-
annotate: false
236-
env:
237-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238-
if: always()
239-
report-order-test:
240-
needs: build-and-test
241-
runs-on: ubuntu-latest
242-
steps:
243-
- name: Checkout code
244-
uses: actions/checkout@v4
245-
- name: Install dependencies
246-
run: npm install
247-
- name: Modify reports
248-
run: npm run modify-reports
249-
- name: Custom Report Order
250-
uses: ./
251-
with:
252-
report-path: './ctrf-reports/*.json'
253-
summary-report: true
254-
failed-report: true
255-
flaky-report: true
256-
report-order: 'flaky-report,failed-report,summary-report'
257-
annotate: false
258-
env:
259-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
260-
if: always()
261-
collapse-large-reports-test:
262-
needs: build-and-test
263-
runs-on: ubuntu-latest
264-
steps:
265-
- name: Checkout code
266-
uses: actions/checkout@v4
267-
- name: Install dependencies
268-
run: npm install
269-
- name: Modify reports
270-
run: npm run modify-reports
271-
- name: Collapse Large Reports Test
272-
uses: ./
273-
with:
274-
report-path: './ctrf-reports/*.json'
275-
test-report: true
276-
test-list-report: true
277-
collapse-large-reports: true
278-
annotate: false
279-
env:
280-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
281-
if: always()
282-
junit-to-ctrf-test:
283-
needs: build-and-test
284-
runs-on: ubuntu-latest
285-
steps:
286-
- name: Checkout code
287-
uses: actions/checkout@v4
288-
- name: Install dependencies
289-
run: npm install
290-
- name: Modify reports
291-
run: npm run modify-reports
292-
- name: JUnit to CTRF integration test
293-
uses: ./
294-
with:
295-
report-path: './ctrf-reports/*.xml'
296-
integrations-config: |
297-
{
298-
"junit-to-ctrf": {
299-
"enabled": true,
300-
"action": "convert",
301-
"options": {
302-
"output": "./ctrf-reports/ctrf-report.json",
303-
"toolname": "junit-to-ctrf",
304-
"useSuiteName": false,
305-
"env": {
306-
"appName": "my-app"
307-
}
308-
}
309-
}
310-
}
311-
annotate: false
312-
env:
313-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
314-
if: always()
315-
file-reports-test:
316-
needs: build-and-test
317-
runs-on: ubuntu-latest
318-
steps:
319-
- name: Checkout code
320-
uses: actions/checkout@v4
321-
- name: Install dependencies
322-
run: npm install
323-
- name: Modify reports
324-
run: npm run modify-reports
325-
- name: File Reports Test
326-
uses: ./
327-
with:
328-
report-path: './ctrf-reports/*.json'
329-
file-report: true
330-
annotate: false
331-
env:
332-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33359
if: always()

dist/index.js

Lines changed: 6 additions & 9 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.

src/ctrf/core/src/methods/run-insights.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export interface SimplifiedTestData {
1111
name: string
1212
suite?: string[]
1313
filePath?: string
14+
line?: number
15+
tags?: string[]
1416
}
1517

1618
/**
@@ -720,7 +722,9 @@ function getTestsRemovedSinceBaseline(
720722
return removedTests.map(test => ({
721723
name: test.name,
722724
suite: test.suite,
723-
filePath: test.filePath
725+
filePath: test.filePath,
726+
line: test.line,
727+
tags: test.tags
724728
}))
725729
}
726730

@@ -753,7 +757,9 @@ function getTestsAddedSinceBaseline(
753757
return addedTests.map(test => ({
754758
name: test.name,
755759
suite: test.suite,
756-
filePath: test.filePath
760+
filePath: test.filePath,
761+
line: test.line,
762+
tags: test.tags
757763
}))
758764
}
759765

@@ -864,14 +870,6 @@ export function enrichReportWithInsights(
864870
baseline
865871
)
866872

867-
// Remove testsAdded and testsRemoved as they're not part of the official schema yet
868-
if (baselineInsights.extra?.testsAdded) {
869-
delete baselineInsights.extra.testsAdded
870-
}
871-
if (baselineInsights.extra?.testsRemoved) {
872-
delete baselineInsights.extra.testsRemoved
873-
}
874-
875873
return {
876874
...currentReportWithTestInsights,
877875
insights: baselineInsights

0 commit comments

Comments
 (0)