Skip to content

Commit 319aaf3

Browse files
committed
- rebase and update testcase with new inputs
- small adjustments to align with skipped behavior
1 parent eb88944 commit 319aaf3

File tree

4 files changed

+49
-30
lines changed

4 files changed

+49
-30
lines changed

__tests__/testParser.test.ts

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,17 +1270,19 @@ describe('parseTestReports', () => {
12701270
})
12711271

12721272
it('should parse retried tests', async () => {
1273-
const {checkName, summary, totalCount, skipped, failed, passed, retried, globalAnnotations} = await parseTestReports(
1274-
'checkName',
1275-
'summary',
1276-
'test_results/junit-server-test/report.xml',
1277-
'*',
1278-
true,
1279-
true,
1280-
[],
1281-
'{{SUITE_NAME}}/{{TEST_NAME}}',
1282-
'/'
1283-
)
1273+
const {checkName, summary, totalCount, skipped, failed, passed, retried, globalAnnotations} =
1274+
await parseTestReports(
1275+
'checkName',
1276+
'summary',
1277+
'test_results/junit-server-test/report.xml',
1278+
'*',
1279+
true,
1280+
true,
1281+
true,
1282+
[],
1283+
'{{SUITE_NAME}}/{{TEST_NAME}}',
1284+
'/'
1285+
)
12841286

12851287
expect(checkName).toBe('checkName')
12861288
expect(summary).toBe('summary')
@@ -1314,21 +1316,21 @@ describe('parseTestReports', () => {
13141316
start_column: 0,
13151317
start_line: 1,
13161318
status: 'skipped',
1317-
title: 'github.com/example/example/server/v8/channels/api4/TestCreateChannelBookmark',
1319+
title: 'github.com/example/example/server/v8/channels/api4/TestCreateChannelBookmark'
13181320
},
13191321
{
1320-
annotation_level: 'notice',
1321-
end_column: 0,
1322-
end_line: 1,
1323-
message: 'TestWebSocketUpgrade',
1324-
path: 'com/example/example/server/v8/channels/api4',
1325-
raw_details: '',
1326-
retries: 0,
1327-
start_column: 0,
1328-
start_line: 1,
1329-
status: 'success',
1330-
title: 'github.com/example/example/server/v8/channels/api4/TestWebSocketUpgrade',
1331-
}
1322+
annotation_level: 'notice',
1323+
end_column: 0,
1324+
end_line: 1,
1325+
message: 'TestWebSocketUpgrade',
1326+
path: 'com/example/example/server/v8/channels/api4',
1327+
raw_details: '',
1328+
retries: 0,
1329+
start_column: 0,
1330+
start_line: 1,
1331+
status: 'success',
1332+
title: 'github.com/example/example/server/v8/channels/api4/TestWebSocketUpgrade'
1333+
}
13321334
])
13331335
})
13341336

dist/index.js

Lines changed: 18 additions & 2 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/testParser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ async function parseSuite(
355355
childSuiteResults.push(childSuiteResult)
356356
totalCount += childSuiteResult.totalCount
357357
skippedCount += childSuiteResult.skippedCount
358+
retriedCount += childSuiteResult.retriedCount
358359
}
359360

360361
// skip out if we reached our annotations limit
@@ -424,7 +425,6 @@ async function parseTestCases(
424425
testcaseMap.set(key, testcase)
425426
retriedCount += 1
426427
core.debug(`Drop flaky test failure for (2): ${JSON.stringify(testcase)}`)
427-
core.debug(`Drop flaky test failure for (2): ${key}`)
428428
}
429429
} else {
430430
testcaseMap.set(key, testcase)
@@ -599,6 +599,7 @@ export async function parseTestReports(
599599
const testResults: ActualTestResult[] = []
600600
let totalCount = 0
601601
let skipped = 0
602+
let retried = 0
602603
let foundFiles = 0
603604
for await (const file of globber.globGenerator()) {
604605
foundFiles++
@@ -623,9 +624,10 @@ export async function parseTestReports(
623624
)
624625

625626
if (!testResult) continue
626-
const {totalCount: c, skippedCount: s} = testResult
627+
const {totalCount: c, skippedCount: s, retriedCount: r} = testResult
627628
totalCount += c
628629
skipped += s
630+
retried += r
629631
testResults.push(testResult)
630632

631633
if (annotationsLimit > 0 && globalAnnotations.length >= annotationsLimit) {
@@ -636,7 +638,6 @@ export async function parseTestReports(
636638
// get the count of passed and failed tests.
637639
const failed = globalAnnotations.filter(a => a.annotation_level === 'failure').length
638640
const passed = totalCount - failed - skipped
639-
const retried = globalAnnotations.filter(a => a.retries > 0).length
640641

641642
return {
642643
checkName,

0 commit comments

Comments
 (0)