Skip to content

Commit 46c898c

Browse files
committed
improvement(TestDashboardTest): Add triage information to test
This commit adds extra information to test blocks on a TestDashboard, namely: * The amount of passed/failed nemesis is now reflected for SCT runs * The time taken is displayed under the test Fixes #597
1 parent b6c38ab commit 46c898c

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

argus/backend/plugins/sct/testrun.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class SCTTestRun(PluginModelBase):
155155
@classmethod
156156
def _stats_query(cls) -> str:
157157
return ("SELECT id, test_id, group_id, release_id, status, start_time, build_job_url, build_id, "
158-
f"assignee, end_time, investigation_status, heartbeat, scylla_version, cloud_setup, allocated_resources FROM {cls.table_name()} WHERE build_id IN ? PER PARTITION LIMIT 15")
158+
f"assignee, end_time, investigation_status, heartbeat, scylla_version, cloud_setup, allocated_resources, nemesis_data FROM {cls.table_name()} WHERE build_id IN ? PER PARTITION LIMIT 15")
159159

160160
@classmethod
161161
def load_test_run(cls, run_id: UUID) -> 'SCTTestRun':

argus/backend/service/stats.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ def collect(self, limited=False):
505505
"build_number": get_build_number(run["build_job_url"]),
506506
"build_job_name": run["build_id"],
507507
"start_time": run["start_time"],
508+
"end_time": run["end_time"],
509+
"nemesis_data": run.get("nemesis_data", []),
508510
"assignee": run["assignee"],
509511
"issues": [dict(issue.items()) for issue in self.parent_group.parent_release.issues[run["id"]]],
510512
"comments": [dict(comment.items()) for comment in self.parent_group.parent_release.comments[run["id"]]],

frontend/ReleaseDashboard/TestDashboardTest.svelte

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import { InvestigationStatusIcon, StatusBackgroundCSSClassMap, TestInvestigationStatus, TestInvestigationStatusStrings, TestStatus } from "../Common/TestStatus";
44
import { subUnderscores, titleCase } from "../Common/TextUtils";
55
import AssigneeList from "../WorkArea/AssigneeList.svelte";
6+
import humanizeDuration from "humanize-duration";
67
import { timestampToISODate } from "../Common/DateUtils";
78
import Fa from "svelte-fa";
8-
import { faBug, faComment } from "@fortawesome/free-solid-svg-icons";
9+
import { faBug, faComment, faSpider } from "@fortawesome/free-solid-svg-icons";
910
import { getAssigneesForTest, shouldFilterOutByUser } from "./TestDashboard.svelte";
1011
1112
let {
@@ -15,11 +16,15 @@
1516
clickedTests,
1617
doFilters
1718
} = $props();
19+
20+
let lastRun = testStats?.last_runs?.[0];
1821
const dispatch = createEventDispatcher();
1922
</script>
2023

2124
<!-- svelte-ignore a11y_click_events_have_key_events -->
2225
<div
26+
role="button"
27+
tabindex="-1"
2328
class:d-none={!doFilters(testStats)}
2429
class:status-block-active={testStats.start_time != 0}
2530
class:investigating={testStats?.investigation_status == TestInvestigationStatus.IN_PROGRESS}
@@ -31,7 +36,7 @@
3136
>
3237
<div
3338
class="{StatusBackgroundCSSClassMap[
34-
testStats.status
39+
testStats.status as keyof typeof StatusBackgroundCSSClassMap
3540
]} text-center text-light p-1 border-bottom"
3641
>
3742
{testStats.status == "unknown"
@@ -49,7 +54,12 @@
4954
</div>
5055
</div>
5156
<div class="d-flex flex-fill align-items-end justify-content-end p-1">
52-
<div class="p-1 me-auto">
57+
<div class="p-1 me-auto text-small">
58+
{#if (lastRun?.nemesis_data ?? []).length}
59+
<Fa icon={faSpider} /> {(lastRun?.nemesis_data ?? []).filter((n: {status: string}) => n.status == "failed").length} / {(lastRun?.nemesis_data ?? []).length}
60+
{/if}
61+
</div>
62+
<div class="p-1 me-2">
5363
{#if assigneeList.tests[testStats.test.id] || assigneeList.groups[groupStats.group.id] || testStats.last_runs?.[0]?.assignee}
5464
<AssigneeList
5565
smallImage={false}
@@ -66,13 +76,13 @@
6676
<div
6777
class="p-1"
6878
title="Investigation: {TestInvestigationStatusStrings[
69-
testStats.investigation_status
79+
testStats.investigation_status as keyof typeof TestInvestigationStatusStrings
7080
]}"
7181
>
7282
<Fa
7383
color="#000"
7484
icon={InvestigationStatusIcon[
75-
testStats.investigation_status
85+
testStats.investigation_status as keyof typeof InvestigationStatusIcon
7686
]}
7787
/>
7888
</div>
@@ -88,13 +98,18 @@
8898
</div>
8999
{/if}
90100
</div>
101+
{#if lastRun?.end_time && new Date(lastRun.end_time).getTime() > 1}
102+
<div class="border-top bg-light-two text-small text-center">
103+
took {humanizeDuration((new Date(lastRun.end_time).getTime() - new Date(lastRun.start_time).getTime()), { units: ["d", "h", "m"], largest: 1, round: true })}
104+
</div>
105+
{/if}
91106
</div>
92107

93108

94109
<style>
95110
.status-block {
96111
width: 178px;
97-
max-height: 160px;
112+
max-height: 220px;
98113
box-sizing: border-box;
99114
cursor: pointer;
100115
}

0 commit comments

Comments
 (0)