From 9008d2040840cedb59b8ab2d65180ff33e09d9f7 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 27 May 2020 06:41:43 -0700 Subject: [PATCH] kpi: Add historical graphs for pass/fail totals. Provides a nice way to check on overall results and test coverage. --- gui/kpi.java | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/gui/kpi.java b/gui/kpi.java index 6b611199..a1489e66 100644 --- a/gui/kpi.java +++ b/gui/kpi.java @@ -52,6 +52,8 @@ public class kpi { public static String HTML_COLOR_FAIL = "#f9c5c0"; public static String HTML_COLOR_WARNING = "#f8f6ad"; + public static String PF = "PASS-FAIL"; + public kpi() { priv_init(); } @@ -124,6 +126,9 @@ public class kpi { Vector test_namesv = new Vector(); Vector runs = new Vector(); + test_names.put(PF, PF); + test_namesv.add(PF); + try { DirectoryStream stream = Files.newDirectoryStream(Paths.get(dir)); for (Path file: stream) { @@ -220,6 +225,28 @@ public class kpi { runs.sort(new SortbyDate()); + // Create meta-test results for each run. + for (int i = 0; i test_id_links = new Hashtable(); @@ -344,8 +371,10 @@ public class kpi { String hk_str = hk; Run last = test_id_links.get(hk); - if (last != null) { - hk_str = "" + hk + ""; + if (!hk.equals(PF)) { + if (last != null) { + hk_str = "" + hk + ""; + } } StringBuffer change = new StringBuffer(); @@ -359,7 +388,7 @@ public class kpi { } } - String row_str = ("" + hk_str + "" + title + "" + String row_str = ("" + hk_str + "" + title + "" + change + "\n"); if (csv.getPriority() >= 100) { scores.append(row_str); @@ -462,11 +491,13 @@ public class kpi { String hk_str = hk; Run last = test_id_links.get(hk); - if (last != null) { - hk_str = "" + hk + ""; + if (!hk.equals(PF)) { + if (last != null) { + hk_str = "" + hk + ""; + } } - groups.append("" + hk_str + "" + title + "\n"); + groups.append("" + hk_str + "" + title + "\n"); } catch (Exception ee) { @@ -1070,6 +1101,13 @@ class Run { return ""; } + String getDutSerNum() { + Test t = getFirstTest(); + if (t != null) + return t.getDutSerialNum(); + return ""; + } + String getDutModelNum() { Test t = getFirstTest(); if (t != null)