Skip to content

Commit

Permalink
Merge pull request #1224 from mikepenz/feature/improve_nested_parsing
Browse files Browse the repository at this point in the history
Improve parsing logic for nested suites
  • Loading branch information
mikepenz authored Nov 3, 2024
2 parents a3f285b + c8cbb47 commit 5eb8e3e
Show file tree
Hide file tree
Showing 10 changed files with 501 additions and 300 deletions.
104 changes: 104 additions & 0 deletions __tests__/table.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import {parseTestReports} from '../src/testParser'
import {buildSummaryTables} from '../src/table'

/**
* Copyright Mike Penz
*/
jest.setTimeout(30000)

describe('buildSummaryTables', () => {
it('should build simple tables', async () => {
const testResult = await parseTestReports(
'checkName',
'summary',
'test_results/nested/multi-level.xml',
'*',
true,
true,
[],
'{{SUITE_NAME}}/{{TEST_NAME}}',
'/'
)

const [table, detailTable, flakyTable] = buildSummaryTables([testResult], true, true, true)

expect(table).toStrictEqual([
[
{
'data': '',
'header': true
},
{
'data': 'Tests',
'header': true
},
{
'data': 'Passed ✅',
'header': true
},
{
'data': 'Skipped ⏭️',
'header': true
},
{
'data': 'Failed ❌',
'header': true
}
],
[
'checkName',
'3 ran',
'3 passed',
'0 skipped',
'0 failed'
]
])
expect(detailTable).toStrictEqual([
[
{
'data': '',
'header': true
},
{
'data': 'Test',
'header': true
},
{
'data': 'Result',
'header': true
}
],
[
'checkName',
'XEP-0199: XMPP Ping/PingIntegrationTest.pingAsync (Normal)',
'✅ pass'
],
[
'checkName',
'XEP-0199: XMPP Ping/PingIntegrationTest.pingServer (Normal)',
'✅ pass'
],
[
'checkName',
'XEP-0045: Multi-User Chat/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.mucRoleTestForReceivingModerator (Normal)',
'✅ pass'
]
])
expect(flakyTable).toStrictEqual([
[
{
'data': '',
'header': true
},
{
'data': 'Test',
'header': true
},
{
'data': 'Retries',
'header': true
}
]
])
})
})
Loading

0 comments on commit 5eb8e3e

Please sign in to comment.