Skip to content

Commit

Permalink
Merge pull request #1122 from mikepenz/fix/1121
Browse files Browse the repository at this point in the history
Revert optimisation to skip processing of scucessful tests
  • Loading branch information
mikepenz authored Jun 22, 2024
2 parents eb1a2b2 + 2d70fb2 commit db71d41
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 41 deletions.
13 changes: 1 addition & 12 deletions __tests__/testParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,22 +443,11 @@ action.surefire.report.email.InvalidEmailAddressException: Invalid email address
])
})

it('should skip disabled tests when annotatePassed=false', async () => {
it('should parse disabled tests', async () => {
const {totalCount, skipped, annotations} = await parseFile('test_results/issues/testDisabled.xml', '*')
const filtered = annotations.filter(annotation => annotation.annotation_level !== 'notice')
const notice = annotations.filter(annotation => annotation.annotation_level === 'notice')

expect(totalCount).toBe(22)
expect(skipped).toBe(10)
expect(filtered.length).toBe(6)
expect(notice.length).toBe(0)
})

it('should parse disabled tests as notices when annotatePassed=true', async () => {
const {totalCount, skipped, annotations} = await parseFile('test_results/issues/testDisabled.xml', '*', true)
const filtered = annotations.filter(annotation => annotation.annotation_level !== 'notice')
const notice = annotations.filter(annotation => annotation.annotation_level === 'notice')

expect(totalCount).toBe(22)
expect(skipped).toBe(10)
expect(filtered).toStrictEqual([
Expand Down
35 changes: 13 additions & 22 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions src/testParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,6 @@ async function parseSuite(
skipped++
}

// If this won't be reported as a failure and processing all passed tests
// isn't enabled, then skip the rest of the processing.
if (annotationLevel !== 'failure' && !annotatePassed) {
continue
}

// in some definitions `failure` may be an array
const failures = testcase.failure
? Array.isArray(testcase.failure)
Expand Down

0 comments on commit db71d41

Please sign in to comment.