Skip to content

Commit 2ef050d

Browse files
authored
Adjust frontend to display skipped tests (#597)
* Adjust frontend to display skipped tests * Display skipped tests according to the order * Fix compile errors and test logs access
1 parent 0d86eff commit 2ef050d

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

src/pages/TestLogs.vue

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,21 @@
150150
</td>
151151
<td class="text-center" width="15%">
152152
<q-chip
153-
:color="log.success ? 'green' : 'negative'"
153+
:color="
154+
log.skipped ? 'warning' : log.success ? 'green' : 'negative'
155+
"
154156
text-color="white"
155157
dense
156158
class="text-weight-bolder text-capitalize"
157159
square
158160
>
159-
{{ log.success ? 'done' : 'failed' }}
161+
{{
162+
log.skipped
163+
? 'skipped' // If skipped
164+
: log.success
165+
? 'done'
166+
: 'failed'
167+
}}
160168
</q-chip>
161169
</td>
162170
</tr>
@@ -184,11 +192,13 @@
184192
</template>
185193
</template>
186194
</tbody>
187-
<tr v-if="!tests || tests.length == 0">
188-
<td colspan="4" class="text-center text-blue-7">
189-
<h6>Nothing here yet</h6>
190-
</td>
191-
</tr>
195+
<tbody v-if="!tests || tests.length == 0">
196+
<tr>
197+
<td colspan="4" class="text-center text-blue-7">
198+
<h6>Nothing here yet</h6>
199+
</td>
200+
</tr>
201+
</tbody>
192202
</table>
193203
</div>
194204

@@ -224,6 +234,7 @@
224234
'system_info',
225235
'install_package',
226236
'tests',
237+
'package_integrity_tests',
227238
'third_party',
228239
'uninstall_package',
229240
'stop_environment',
@@ -298,6 +309,17 @@
298309
.filter((opt) => test.alts_response.result[opt])
299310
.forEach((opt) => {
300311
let res = {}
312+
if (test.alts_response.result.skipped_tests?.length > 0) {
313+
while (test.alts_response.result.skipped_tests.length > 0) {
314+
let res = {
315+
skipped: true,
316+
name: 'Skipped test',
317+
short_name:
318+
test.alts_response.result.skipped_tests.shift(),
319+
}
320+
parsed_test.result.push(res)
321+
}
322+
}
301323
if (['tests', 'third_party'].includes(opt)) {
302324
for (const item in test.alts_response.result[opt]) {
303325
res = {
@@ -333,6 +355,12 @@
333355
}
334356
}
335357
})
358+
parsed_test.result.sort((a, b) => {
359+
return (
360+
this.test_options.indexOf(a.short_name) -
361+
this.test_options.indexOf(b.short_name)
362+
)
363+
})
336364
this.tests.push(parsed_test)
337365
})
338366
})
@@ -362,12 +390,18 @@
362390
}
363391
},
364392
onView(log) {
365-
let logUrl = `${window.origin}/pulp/content/test_logs/build-${this.buildId}-test_log/${log.name}`
366-
this.selectedLog = log.name
367-
axios.get(logUrl).then((response) => {
368-
this.logText = response.data
393+
if (log.name === 'Skipped test') {
394+
this.logText =
395+
'This test was marked to be skipped specifically for this project and platform'
369396
this.$refs.openLogView.open()
370-
})
397+
} else {
398+
let logUrl = `${window.origin}/pulp/content/test_logs/build-${this.buildId}-test_log/${log.name}`
399+
this.selectedLog = log.name
400+
axios.get(logUrl).then((response) => {
401+
this.logText = response.data
402+
this.$refs.openLogView.open()
403+
})
404+
}
371405
},
372406
},
373407
components: {

0 commit comments

Comments
 (0)