kpi: Add log errors to summary.

Count the crashes, WARNINGS, BUGS and other logging errors and propagate
counts to the summary pages.
This commit is contained in:
Ben Greear
2020-05-14 07:35:57 -07:00
parent 78c8185239
commit 14197d4d5b
3 changed files with 125 additions and 5 deletions

View File

@@ -355,7 +355,7 @@ then
GITLOG=NA GITLOG=NA
fi fi
./lf_gui_report_summary.pl --title "TIP Test Bed Results" --dir $RSLTS_DIR --gitlog $GITLOG --notes $NOTES_HTML < index_template.html > $RSLTS_DIR/index.html ./lf_gui_report_summary.pl --title "$TEST_RIG_ID: $DUT_SW_VER" --dir $RSLTS_DIR --gitlog $GITLOG --notes $NOTES_HTML < index_template.html > $RSLTS_DIR/index.html
echo "Done with regression test." echo "Done with regression test."
echo "Results-Dir: $RSLTS_DIR" echo "Results-Dir: $RSLTS_DIR"

View File

@@ -177,6 +177,21 @@ public class kpi {
else if (fname.startsWith("kpi-") && fname.endsWith(".png")) { else if (fname.startsWith("kpi-") && fname.endsWith(".png")) {
test.addKpiImage(fname); test.addKpiImage(fname);
} }
else if (fname.equals("logs")) {
File logs_csv = new File(f3.getAbsolutePath() + File.separator + "logs.csv");
if (logs_csv.exists()) {
try {
BufferedReader br = new BufferedReader(new FileReader(logs_csv));
String line;
while ((line = br.readLine()) != null) {
test.addLogCsv(line);
}
}
catch (Exception e) {
e.printStackTrace();
}
}
}
}// for all files in the test dir }// for all files in the test dir
} }
} }
@@ -468,10 +483,42 @@ public class kpi {
for (int i = 0; i<runs.size(); i++) { for (int i = 0; i<runs.size(); i++) {
Run run = runs.elementAt(i); Run run = runs.elementAt(i);
test_bed = run.getTestRig(); test_bed = run.getTestRig();
StringBuffer logs_str = new StringBuffer();
int logv = run.getLogBugs();
if (logv > 0) {
logs_str.append(redTd(logv + ""));
}
else {
logs_str.append(greenTd(logv + ""));
}
logv = run.getLogWarnings();
if (logv > 0) {
logs_str.append(redTd(logv + ""));
}
else {
logs_str.append(greenTd(logv + ""));
}
logv = run.getLogCrashes();
if (logv > 0) {
logs_str.append(redTd(logv + ""));
}
else {
logs_str.append(greenTd(logv + ""));
}
logv = run.getLogRestarting();
if (logv > 0) {
logs_str.append(redTd(logv + ""));
}
else {
logs_str.append(greenTd(logv + ""));
}
String row_text = ("<tr><td>" + i + "</td><td><a href=\"" + run.getName() + "/index.html\">" + run.getName() + "</a></td><td>" + run.getDate() String row_text = ("<tr><td>" + i + "</td><td><a href=\"" + run.getName() + "/index.html\">" + run.getName() + "</a></td><td>" + run.getDate()
+ "</td><td>" + run.getDutHwVer() + "</td><td>" + run.getDutSwVer() + "</td><td>" + run.getDutHwVer() + "</td><td>" + run.getDutSwVer()
+ "</td><td>" + run.getDutModelNum() + "</td>" + greenTd(run.getPass() + "") + redTd(run.getFail() + "") + "</tr>\n"); + "</td><td>" + run.getDutModelNum() + "</td>" + greenTd(run.getPass() + "") + redTd(run.getFail() + "") + logs_str + "</tr>\n");
if (i == (runs.size() - 1)) { if (i == (runs.size() - 1)) {
// Last run // Last run
int png_row_count = 0; int png_row_count = 0;
@@ -704,9 +751,15 @@ class Test {
Vector<Row> data = new Vector(); Vector<Row> data = new Vector();
Hashtable<String, String> descs = new Hashtable(); Hashtable<String, String> descs = new Hashtable();
Vector<String> kpi_images = new Vector(); Vector<String> kpi_images = new Vector();
Vector<String> log_csv = new Vector();
int pass = 0; int pass = 0;
int fail = 0; int fail = 0;
int log_bugs = 0;
int log_warnings = 0;
int log_crashes = 0;
int log_restarting = 0;
long date_ms = 0; long date_ms = 0;
public String date = "NA"; public String date = "NA";
public String test_rig = "NA"; public String test_rig = "NA";
@@ -719,6 +772,22 @@ class Test {
name = n; name = n;
} }
public int getLogBugs() {
return log_bugs;
}
public int getLogWarnings() {
return log_warnings;
}
public int getLogCrashes() {
return log_crashes;
}
public int getLogRestarting() {
return log_restarting;
}
public String toString() { public String toString() {
return "Name: " + name; return "Name: " + name;
} }
@@ -768,6 +837,25 @@ class Test {
return name; return name;
} }
void addLogCsv(String l) {
log_csv.add(l);
try {
StringTokenizer st = new StringTokenizer(l, "\t");
String tok = st.nextToken();
if (tok.equals("FILE")) {
// title, ignore rest of this title
return;
}
log_bugs += Long.valueOf(st.nextToken());
log_warnings += Long.valueOf(st.nextToken());
log_crashes += Long.valueOf(st.nextToken());
log_restarting += Long.valueOf(st.nextToken());
}
catch (Exception e) {
e.printStackTrace();
}
}
void addLine(String l) { void addLine(String l) {
if (titles == null) { if (titles == null) {
titles = new Vector(); titles = new Vector();
@@ -877,6 +965,38 @@ class Run {
return fail; return fail;
} }
int getLogBugs() {
int fail = 0;
for (Test t: testsv) {
fail += t.getLogBugs();
}
return fail;
}
int getLogWarnings() {
int fail = 0;
for (Test t: testsv) {
fail += t.getLogWarnings();
}
return fail;
}
int getLogCrashes() {
int fail = 0;
for (Test t: testsv) {
fail += t.getLogCrashes();
}
return fail;
}
int getLogRestarting() {
int fail = 0;
for (Test t: testsv) {
fail += t.getLogRestarting();
}
return fail;
}
Test getFirstTest() { Test getFirstTest() {
return testsv.elementAt(0); return testsv.elementAt(0);
} }

View File

@@ -25,7 +25,7 @@
<br> <br>
<h3>Latest test run details.</h3> <h3>Latest test run details.</h3>
<table border="1" cellpadding="6" cellspacing="0" style="border-top-color: gray; border-top-style: solid; border-top-width: 1px; border-right-color: gray; border-right-style: solid; border-right-width: 1px; border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: gray; border-left-style: solid; border-left-width: 1px"> <table border="1" cellpadding="6" cellspacing="0" style="border-top-color: gray; border-top-style: solid; border-top-width: 1px; border-right-color: gray; border-right-style: solid; border-right-width: 1px; border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: gray; border-left-style: solid; border-left-width: 1px">
<tr><th>Test ID</th><th>Test Run</th><th>Date</th><th>DUT Hardware</th><th>DUT Sofware</th><th>DUT Model</th><th>Pass</th><th>Fail</th></tr> <tr><th>Test ID</th><th>Test Run</th><th>Date</th><th>DUT Hardware</th><th>DUT Sofware</th><th>DUT Model</th><th>Pass</th><th>Fail</th><th>Log Bugs</th><th>Warnings</th><th>Crashes</th><th>Other</th></tr>
___LATEST_RUN___ ___LATEST_RUN___
</table> </table>
<table border=0> <table border=0>
@@ -49,7 +49,7 @@ ___LATEST_RUN_PNGS___
<h3>Individual Test Run Details for all data sets.</h3> <h3>Individual Test Run Details for all data sets.</h3>
<table border="1" cellpadding="6" cellspacing="0" style="border-top-color: gray; border-top-style: solid; border-top-width: 1px; border-right-color: gray; border-right-style: solid; border-right-width: 1px; border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: gray; border-left-style: solid; border-left-width: 1px"> <table border="1" cellpadding="6" cellspacing="0" style="border-top-color: gray; border-top-style: solid; border-top-width: 1px; border-right-color: gray; border-right-style: solid; border-right-width: 1px; border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: gray; border-left-style: solid; border-left-width: 1px">
<tr><th>Test ID</th><th>Test Run</th><th>Date</th><th>DUT Hardware</th><th>DUT Sofware</th><th>DUT Model</th><th>Pass</th><th>Fail</th></tr> <tr><th>Test ID</th><th>Test Run</th><th>Date</th><th>DUT Hardware</th><th>DUT Sofware</th><th>DUT Model</th><th>Pass</th><th>Fail</th><th>Log Bugs</th><th>Warnings</th><th>Crashes</th><th>Other</th></tr>
___TEST_RUNS___ ___TEST_RUNS___
</table> </table>
<P> <P>