fix(c-dash): fix the name of infra and test in hover 51/41551/3
authorTibor Frank <[email protected]>
Tue, 10 Sep 2024 12:25:17 +0000 (12:25 +0000)
committerTibor Frank <[email protected]>
Wed, 11 Sep 2024 07:04:05 +0000 (07:04 +0000)
- in trending
- make it more flexible

Change-Id: Ic7b6f4f9413df420b14fc0681011e6c0bc46c57c
Signed-off-by: Tibor Frank <[email protected]>
csit.infra.dash/app/cdash/trending/graphs.py

index 7417fc1..816b28e 100644 (file)
@@ -237,10 +237,17 @@ def graph_trending(
                 hosts = f"<br>hosts: {', '.join(row['hosts'])}"
             except (KeyError, TypeError):
                 hosts = str()
+
+            for drv in C.DRIVERS:
+                if drv in name_lst:
+                    split_idx = name_lst.index(drv) + 1
+                    break
+            else:
+                split_idx = 5
             hover_itm = (
                 f"dut: {name_lst[0]}<br>"
-                f"infra: {'-'.join(name_lst[1:5])}<br>"
-                f"test: {'-'.join(name_lst[5:])}<br>"
+                f"infra: {'-'.join(name_lst[1:split_idx])}<br>"
+                f"test: {'-'.join(name_lst[split_idx:])}<br>"
                 f"date: {row['start_time'].strftime('%Y-%m-%d %H:%M:%S')}<br>"
                 f"{h_tput}{h_tput_trials}{h_band}{h_band_trials}{h_lat}"
                 f"{row['dut_type']}-ref: {row['dut_version']}<br>"