Skip to content

Commit 97744ec

Browse files
authored
Merge pull request #1318 from mikepenz/fix/1316
Include time in summary tables
2 parents 9ddb3ab + 1f0645c commit 97744ec

File tree

10 files changed

+315
-54
lines changed

10 files changed

+315
-54
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
| `verbose_summary` | Optional. Detail table will note if there were no test annotations for a test suite (Also applies to comment). Defaults to `true`. |
101101
| `skip_success_summary` | Optional. Skips the summary table if only successful tests were detected (Also applies to comment). Defaults to `false`. |
102102
| `include_empty_in_summary` | Optional. Include entries in summaries that have 0 count. Defaults to `true`. |
103+
| `include_time_in_summary` | Optional. Include spent time in summaries. Defaults to `false`. |
103104
| `simplified_summary` | Optional. Use icons instead of text to indicate status in summary. Defaults to `false`. |
104105
| `group_suite` | Optional. If enabled, will group the testcases by test suite in the `detailed_summary`. Defaults to `false`. |
105106
| `comment` | Optional. Enables a comment being added to the PR with the summary tables (Respects the summary configuration flags). Defaults to `false`. |

__tests__/table.test.ts

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ const NORMAL_TABLE = [
2727
{
2828
data: 'Failed',
2929
header: true
30+
},
31+
{
32+
data: 'Time ⏱',
33+
header: true
3034
}
3135
],
32-
['checkName', '3 ran', '3 passed', '0 skipped', '0 failed']
36+
['checkName', '3 ran', '3 passed', '0 skipped', '0 failed', '100ms']
3337
]
3438
const FLAKY_TABLE = [
3539
[
@@ -40,6 +44,10 @@ const FLAKY_TABLE = [
4044
{
4145
data: 'Retries',
4246
header: true
47+
},
48+
{
49+
data: 'Time ⏱',
50+
header: true
4351
}
4452
]
4553
]
@@ -71,17 +79,25 @@ describe('buildSummaryTables', () => {
7179
{
7280
data: 'Result',
7381
header: true
82+
},
83+
{
84+
data: 'Time ⏱',
85+
header: true
7486
}
7587
],
7688
[
7789
{
7890
data: '<strong>checkName</strong>',
79-
colspan: '2'
91+
colspan: '3'
8092
}
8193
],
82-
['ABC-0199: XMPP Ping/PingIntegrationTest.pingAsync (Normal)', '✅ passed'],
83-
['ABC-0199: XMPP Ping/PingIntegrationTest.pingServer (Normal)', '✅ passed'],
84-
['ABC-0045: Multi-User Chat/MultiUserIntegrationTest.mucRoleTestForReceivingModerator (Normal)', '✅ passed']
94+
['ABC-0199: XMPP Ping/PingIntegrationTest.pingAsync (Normal)', '✅ passed', '54ms'],
95+
['ABC-0199: XMPP Ping/PingIntegrationTest.pingServer (Normal)', '✅ passed', ''],
96+
[
97+
'ABC-0045: Multi-User Chat/MultiUserIntegrationTest.mucRoleTestForReceivingModerator (Normal)',
98+
'✅ passed',
99+
'46ms'
100+
]
85101
])
86102
expect(flakyTable).toStrictEqual(FLAKY_TABLE)
87103
})
@@ -132,29 +148,37 @@ describe('buildSummaryTables', () => {
132148
{
133149
data: 'Result',
134150
header: true
151+
},
152+
{
153+
data: 'Time ⏱',
154+
header: true
135155
}
136156
],
137157
[
138158
{
139159
data: '<strong>checkName</strong>',
140-
colspan: '2'
160+
colspan: '3'
141161
}
142162
],
143163
[
144164
{
145165
data: '<em>ABC-0199: XMPP Ping</em>',
146-
colspan: '2'
166+
colspan: '3'
147167
}
148168
],
149-
['ABC-0199: XMPP Ping/PingIntegrationTest.pingAsync (Normal)', '✅ passed'],
150-
['ABC-0199: XMPP Ping/PingIntegrationTest.pingServer (Normal)', '✅ passed'],
169+
['ABC-0199: XMPP Ping/PingIntegrationTest.pingAsync (Normal)', '✅ passed', '54ms'],
170+
['ABC-0199: XMPP Ping/PingIntegrationTest.pingServer (Normal)', '✅ passed', ''],
151171
[
152172
{
153173
data: '<em>ABC-0045: Multi-User Chat</em>',
154-
colspan: '2'
174+
colspan: '3'
155175
}
156176
],
157-
['ABC-0045: Multi-User Chat/MultiUserIntegrationTest.mucRoleTestForReceivingModerator (Normal)', '✅ passed']
177+
[
178+
'ABC-0045: Multi-User Chat/MultiUserIntegrationTest.mucRoleTestForReceivingModerator (Normal)',
179+
'✅ passed',
180+
'46ms'
181+
]
158182
])
159183
expect(flakyTable).toStrictEqual(FLAKY_TABLE)
160184
})

0 commit comments

Comments
 (0)