kpi: Support adding git-log info to the Run report.

This commit is contained in:
Ben Greear
2020-04-30 20:48:48 -07:00
parent c1512b48a4
commit 11e8362be9
5 changed files with 44 additions and 6 deletions

View File

@@ -339,7 +339,18 @@ then
mv $MY_TMPDIR/dut_console_log.txt $RSLTS_DIR/
fi
./lf_gui_report_summary.pl --title "TIP Test Bed Results" --dir $RSLTS_DIR < index_template.html > $RSLTS_DIR/index.html
RPT_ARGS=
if [ "_${NOTES_HTML}" == "_" ]
then
NOTES_HTML=NA
fi
if [ "_${GITLOG}" == "_" ]
then
GITLOG=NA
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
echo "Done with regression test."
echo "Results-Dir: $RSLTS_DIR"

View File

@@ -45,6 +45,9 @@
<!-- <tr><td>AP AUtomated Test</td><td>Daul Band Performance</td><td>PASS</td><td>86.44</td><td>Dual-Concurrent vs 90% of Sum: 435.68 Mbps / 558.84 Mbps Dual-Concurrent vs 90% of Sum: 598.17 Mbps / 630.11 Mbps</td></tr> -->
___TR_KPI___
</table>
<P>
___TESTBED_NOTES___
</div><!--end content-div -->
<div class='FooterStyle'><span class='Gradient'>Generated by Candela Technologies LANforge network testing tool.<br/>

View File

@@ -286,7 +286,7 @@ public class kpi {
mplot.append(", ");
}
plot.append("\'" + csv.getFname() + "\' using 1:2 with lines title \'" + csv.getName().replace("_", " ") + "\'");
mplot.append("\'" + csv.getFname() + "\' using 1:2 notitle");
mplot.append("\'" + csv.getFname() + "\' using 1:2 with lines notitle");
first = false;
}
@@ -358,7 +358,7 @@ public class kpi {
for (int i = 0; i<runs.size(); i++) {
Run run = runs.elementAt(i);
test_bed = run.getTestRig();
runs_rows.append("<tr><td><a href=\"" + run.getName() + "/index.html\">" + run.getName() + "</a></td><td>" + run.getDate()
runs_rows.append("<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.getDutModelNum() + "</td></tr>\n");

View File

@@ -22,6 +22,8 @@ use lib "./";
use Getopt::Long;
our $dir = "";
our $notes = "";
our $gitlog = "";
our $title = "Automated test results.";
@@ -30,10 +32,10 @@ our $title = "Automated test results.";
########################################################################
our $usage = <<"__EndOfUsage__";
$0 [ --dir directory-to-process ]
$0 [ --dir directory-to-process --notes testbed-notes-file.html --gitlog gitlog-output.txt ]
Example:
$0 --dir ~/tmp/results --title "My Title"
$0 --dir ~/tmp/results --title "My Title" --notes testbeds/my_testbed/testbed_notes.html --gitlog /tmp/gitlog.txt
__EndOfUsage__
my $i = 0;
@@ -42,6 +44,8 @@ my $show_help = 0;
GetOptions
(
'dir|d=s' => \$::dir,
'notes|n=s' => \$::notes,
'gitlog|g=s' => \$::gitlog,
'title|t=s' => \$::title,
'help|h' => \$show_help,
) || die("$::usage");
@@ -51,6 +55,23 @@ if ($show_help) {
exit 0;
}
my $testbed_notes = "";
if (-f "$notes") {
$testbed_notes .= "<b>Test Bed Notes.</b><br>\n";
$testbed_notes .= `cat $notes`;
}
if (-f "$gitlog") {
$testbed_notes .= "<P>\n";
$testbed_notes .= `cat $gitlog`;
$testbed_notes .= "<p>\n";
}
$testbed_notes .= "<p><b>Top lanforge-scripts commits.</b><br><pre>\n";
$testbed_notes .= `git log -n 8 --oneline`;
$testbed_notes .= "</pre>\n";
chdir($dir);
my @files = `ls`;
@@ -75,6 +96,8 @@ my $dut_tr = "";
my $kpi_tr = "";
my $tests_tr = "";
# TODO: Add git commit history for other repositories perhaps?
foreach my $line (@files) {
if ( -d $line) {
if ( -d "$line/logs") {
@@ -120,6 +143,7 @@ while (<>) {
$ln =~ s/___TR_DUT___/$dut_tr/g;
$ln =~ s/___TR_KPI___/$kpi_tr/g;
$ln =~ s/___TR_TESTS___/$tests_tr/g;
$ln =~ s/___TESTBED_NOTES___/$testbed_notes/g;
print "$ln\n";
}

View File

@@ -33,7 +33,7 @@
<h3>Individual 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">
<tr><th>Test Run</th><th>Date</th><th>DUT Hardware</th><th>DUT Sofware</th><th>DUT Model</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></tr>
___TEST_RUNS___
</table>
<P>