[TESTMAN] Integrate into the new website design.

This commit is contained in:
Colin Finck 2020-03-08 09:20:56 +01:00
parent 713b99ef82
commit a4b430ae9f
6 changed files with 102 additions and 118 deletions

View File

@ -68,8 +68,8 @@
$table_summary .= '</th>';
$table_totals .= '<td>';
$table_totals .= sprintf('<div title="%s" class="box totaltests totals">%s <span class="diff">%s</span></div>', $testman_langres["totaltests"], $row["count"], GetDifference($row, $prev_row, "count"));
$table_totals .= sprintf('<div title="%s" class="box %s_failedtests totals">%d <span class="diff">%s</span></div>', $testman_langres["failedtests"], ($row["failures"] > 0 ? 'real' : 'zero'), $row["failures"], GetDifference($row, $prev_row, "failures"));
$table_totals .= sprintf('<div title="%s" class="testmanbox totaltests totals">%s <span class="diff">%s</span></div>', $testman_langres["totaltests"], $row["count"], GetDifference($row, $prev_row, "count"));
$table_totals .= sprintf('<div title="%s" class="testmanbox %s_failedtests totals">%d <span class="diff">%s</span></div>', $testman_langres["failedtests"], ($row["failures"] > 0 ? 'real' : 'zero'), $row["failures"], GetDifference($row, $prev_row, "failures"));
$table_totals .= sprintf('<div class="healthindicator" onmouseover="HealthIndicator_OnMouseOver()" onmouseout="HealthIndicator_OnMouseOut()"><img src="%s" alt="healthindicator"/></div>', $indicator->getImagePath());
$table_totals .= '</td>';
@ -79,7 +79,7 @@
{
$failed_reboots = ($key == 'reboots' && $row[$key] > MACHINE_REBOOTS_THRESHOLD) ? ' worse' : '';
$performance[$key] .= sprintf('<td><div title="%s" class="box performancetests%s">%s <span class="diff">%s</span></div></td>', $testman_langres[$key], $failed_reboots, $row[$key], GetDifference($row, $prev_row, $key, true));
$performance[$key] .= sprintf('<td><div title="%s" class="testmanbox performancetests%s">%s <span class="diff">%s</span></div></td>', $testman_langres[$key], $failed_reboots, $row[$key], GetDifference($row, $prev_row, $key, true));
}
// Get the test results for each column.
@ -87,7 +87,7 @@
$prev_row = $row;
}
foreach ($performance as $key => $perf_text)
$table_performance .= '<tr><td>' . $testman_langres[$key] . '</td>' . $perf_text . '</tr>';
@ -172,10 +172,10 @@
$class = 'todo';
}
$table_results .= sprintf('<div title="%s" class="box totaltests">%s <span class="diff">%s</span></div>', $testman_langres["totaltests"], GetTotalTestsString($row), GetDifference($row, $prev_row, "count"));
$table_results .= sprintf('<div title="%s" class="box %s_failedtests">%d <span class="diff">%s</span></div>', $testman_langres["failedtests"], $class, $row["failures"], GetDifference($row, $prev_row, "failures"));
$table_results .= sprintf('<div title="%s" class="box skippedtests">%d <span class="diff">%s</span></div>', $testman_langres["skippedtests"], $row["skipped"], GetDifference($row, $prev_row, "skipped"));
$table_results .= sprintf('<div title="%s" class="box timetest">%g </div>', $testman_langres["timetest"], $row["time"]);
$table_results .= sprintf('<div title="%s" class="testmanbox totaltests">%s <span class="diff">%s</span></div>', $testman_langres["totaltests"], GetTotalTestsString($row), GetDifference($row, $prev_row, "count"));
$table_results .= sprintf('<div title="%s" class="testmanbox %s_failedtests">%d <span class="diff">%s</span></div>', $testman_langres["failedtests"], $class, $row["failures"], GetDifference($row, $prev_row, "failures"));
$table_results .= sprintf('<div title="%s" class="testmanbox skippedtests">%d <span class="diff">%s</span></div>', $testman_langres["skippedtests"], $row["skipped"], GetDifference($row, $prev_row, "skipped"));
$table_results .= sprintf('<div title="%s" class="testmanbox timetest">%g </div>', $testman_langres["timetest"], $row["time"]);
}
else
{
@ -206,15 +206,15 @@
for ($i = 0; $i < $reader->getTestIDCount(); $i++)
{
$summary_count .= '<td>';
$summary_count .= sprintf('<div title="%s" class="box totaltests totals">%s <span class="diff">%s</span></div>', $testman_langres["totaltests"], $summary[$i]["total"], GetDifference($summary[$i], $summary[$i - 1], "total"));
$summary_count .= sprintf('<div title="%s" class="box difference better">%s%s</div>', $testman_langres["totaltests"].' '.$testman_langres["inc"], $summary[$i]["count_inc"] > 0 ? '+' : '', $summary[$i]["count_inc"]);
$summary_count .= sprintf('<div title="%s" class="box difference worse">%s%s</div>', $testman_langres["totaltests"].' '.$testman_langres["dec"], $summary[$i]["count_dec"] > 0 ? '+' : '', $summary[$i]["count_dec"]);
$summary_count .= sprintf('<div title="%s" class="testmanbox totaltests totals">%s <span class="diff">%s</span></div>', $testman_langres["totaltests"], $summary[$i]["total"], GetDifference($summary[$i], $summary[$i - 1], "total"));
$summary_count .= sprintf('<div title="%s" class="testmanbox difference better">%s%s</div>', $testman_langres["totaltests"].' '.$testman_langres["inc"], $summary[$i]["count_inc"] > 0 ? '+' : '', $summary[$i]["count_inc"]);
$summary_count .= sprintf('<div title="%s" class="testmanbox difference worse">%s%s</div>', $testman_langres["totaltests"].' '.$testman_langres["dec"], $summary[$i]["count_dec"] > 0 ? '+' : '', $summary[$i]["count_dec"]);
$summary_count .= '</td>';
$summary_failures .= '<td>';
$summary_failures .= sprintf('<div title="%s" class="box %s_failedtests totals">%d <span class="diff">%s</span></div>', $testman_langres["failedtests"], (($summary[$i]["failed"] > 0) ? 'real' : 'zero'), $summary[$i]["failed"], GetDifference($summary[$i], $summary[$i - 1], "failed"));
$summary_failures .= sprintf('<div title="%s" class="box difference better">%s%s</div>', $testman_langres["failedtests"].' '.$testman_langres["dec"], $summary[$i]["fail_dec"] > 0 ? '+' : '', $summary[$i]["fail_dec"]);
$summary_failures .= sprintf('<div title="%s" class="box difference worse">%s%s</div>', $testman_langres["failedtests"].' '.$testman_langres["inc"], $summary[$i]["fail_inc"] > 0 ? '+' : '', $summary[$i]["fail_inc"]);
$summary_failures .= sprintf('<div title="%s" class="testmanbox %s_failedtests totals">%d <span class="diff">%s</span></div>', $testman_langres["failedtests"], (($summary[$i]["failed"] > 0) ? 'real' : 'zero'), $summary[$i]["failed"], GetDifference($summary[$i], $summary[$i - 1], "failed"));
$summary_failures .= sprintf('<div title="%s" class="testmanbox difference better">%s%s</div>', $testman_langres["failedtests"].' '.$testman_langres["dec"], $summary[$i]["fail_dec"] > 0 ? '+' : '', $summary[$i]["fail_dec"]);
$summary_failures .= sprintf('<div title="%s" class="testmanbox difference worse">%s%s</div>', $testman_langres["failedtests"].' '.$testman_langres["inc"], $summary[$i]["fail_inc"] > 0 ? '+' : '', $summary[$i]["fail_inc"]);
$summary_failures .= '</td>';
}

View File

@ -3,10 +3,7 @@
<head>
<meta charset="utf-8">
<title><?php echo $testman_langres["compare_title"]; ?></title>
<link type="text/css" rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link type="text/css" rel="stylesheet" href="/sites/all/themes/Porto/vendor/bootstrap/css/bootstrap.css">
<link type="text/css" rel="stylesheet" href="/sites/all/themes/Porto/css/theme-elements.css">
<link type="text/css" rel="stylesheet" href="/sites/all/themes/Porto/css/theme.css">
<?php $rw->printHead(); ?>
<link rel="stylesheet" type="text/css" href="css/compare.css">
<script type="text/javascript">
var FilterableRows = Array(<?php echo $testman_filterable; ?>);
@ -18,7 +15,7 @@
<h2><?php echo $testman_langres["compare_title"]; ?></h2>
<div>
<?php echo $testman_controls ?>
<?php echo $testman_controls ?>
<button class="btn btn-default" onclick="window.open('export.php?f=csv&amp;ids=<?php echo $_GET["ids"]; ?>')">CSV</button>
<button class="btn btn-default" onclick="window.open('export.php?f=xml&amp;ids=<?php echo $_GET["ids"]; ?>')">XML</button>
</div><br>
@ -26,13 +23,13 @@
<div id="healthindicator_tooltip">
<div class="intro"><?php echo $testman_langres["healthindicator_intro"]; ?></div>
<div class="box crashedcanceledtests"></div>
<div class="testmanbox crashedcanceledtests"></div>
<div class="desc"><?php echo $testman_langres["healthindicator_test_crashedcanceled"]; ?></div>
<div class="box zero_failedtests"></div>
<div class="testmanbox zero_failedtests"></div>
<div class="desc"><?php echo $testman_langres["healthindicator_test_succeeded"]; ?></div>
<div class="box real_failedtests"></div>
<div class="testmanbox real_failedtests"></div>
<div class="desc"><?php echo $testman_langres["healthindicator_test_failed"]; ?></div>
<div class="outro"><?php echo $testman_langres["healthindicator_outro"]; ?></div>
@ -41,17 +38,17 @@
<div id="legend">
<div class="intro"><?php echo $testman_langres["legend"]; ?></div>
<div class="box totaltests"></div>
<div class="testmanbox totaltests"></div>
<div class="desc"><?php echo $testman_langres["totaltests"]; ?></div>
<div class="box zero_failedtests" style="border-right: none; margin: 0; width: 10px;"></div>
<div class="box real_failedtests" style="border-left: none; width: 9px;"></div>
<div class="testmanbox zero_failedtests" style="border-right: none; margin: 0; width: 10px;"></div>
<div class="testmanbox real_failedtests" style="border-left: none; width: 9px;"></div>
<div class="desc"><?php echo $testman_langres["failedtests"]; ?></div>
<div class="box skippedtests"></div>
<div class="testmanbox skippedtests"></div>
<div class="desc"><?php echo $testman_langres["skippedtests"]; ?></div>
<div class="box diff_legend"></div>
<div class="testmanbox diff_legend"></div>
<div class="desc"><?php echo $testman_langres["difference"]; ?></div>
</div>

View File

@ -31,13 +31,13 @@ body {
margin-bottom: 1em;
}
#healthindicator_tooltip .box, #legend .box {
#healthindicator_tooltip .testmanbox, #legend .testmanbox {
border: solid 1px #ddd;
height: 19px;
width: 19px;
}
#healthindicator_tooltip .box {
#healthindicator_tooltip .testmanbox {
clear: left;
float: left;
margin: 3px;
@ -144,7 +144,7 @@ body {
color: white;
}
#comparetable td, #comparetable td div.box, #comparetable td div.healthindicator {
#comparetable td, #comparetable td div.testmanbox, #comparetable td div.healthindicator {
border-right: solid 1px #BBBBBB;
border-bottom: solid 1px #BBBBBB;
padding: 3px;
@ -158,7 +158,7 @@ body {
text-align: center;
}
#comparetable td div.box {
#comparetable td div.testmanbox {
color: black;
float: left;
width: 95px;

View File

@ -49,7 +49,7 @@
// Post-process the log for convenience.
$module_urls = array();
$search_urls = array("modules/rostests/winetests", "modules/rostests/apitests");
$pattern_core = "#^([a-z]*:?\()([a-zA-Z0-9\/_]+.[a-z]+):([0-9]+)(\))#m";
$pattern_test = "#^([a-zA-Z0-9_]+.[a-z]+):([0-9]+)(: )#m";
@ -71,7 +71,7 @@
function file_callback($matches)
{
global $row, $module_urls;
if (!isset($module_urls[$row["module"] . $matches[1]]))
{
$url_chunk = get_file_url($row["module"], $matches[1]);
@ -103,10 +103,7 @@
<head>
<meta charset="utf-8">
<title><?php echo $testman_langres["detail_title"]; ?></title>
<link type="text/css" rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link type="text/css" rel="stylesheet" href="/sites/all/themes/Porto/vendor/bootstrap/css/bootstrap.css">
<link type="text/css" rel="stylesheet" href="/sites/all/themes/Porto/css/theme-elements.css">
<link type="text/css" rel="stylesheet" href="/sites/all/themes/Porto/css/theme.css">
<?php $rw->printHead(); ?>
<link rel="stylesheet" type="text/css" href="css/detail.css">
</head>
<body>

View File

@ -13,6 +13,9 @@
require_once("lib/text_diff/Diff/Renderer/Html/SideBySide.php");
require_once("lib/text_diff/Diff/Renderer/Html/Inline.php");
require_once(ROOT_PATH . "rosweb/exceptions.php");
require_once(ROOT_PATH . "rosweb/rosweb.php");
$rw = new RosWeb();
// Functions
function GetRevision($test_id)
@ -33,7 +36,7 @@
return array($result["revision"], $result["module"], $result["test"], $result["suite_id"]);
}
function GetLog($test_id, $strip, $test)
{
global $dbh;
@ -58,7 +61,7 @@
$stripped[] = $value;
}
return $stripped;
}
else
@ -114,6 +117,7 @@
<html>
<head>
<meta charset="utf-8">
<?php $rw->printHead(); ?>
<link rel="stylesheet" type="text/css" href="css/diff.css">
<title><?php echo $title[0][0] . ' / ' . $title[1][0] . ' ' . $title[0][1]; ?></title>
</head>

View File

@ -1,9 +1,9 @@
<?php
/*
* PROJECT: ReactOS Testman
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Front Page for managing ReactOS Regression Test results over the web
* COPYRIGHT: Copyright 2008-2017 Colin Finck (colin@reactos.org)
* COPYRIGHT: Copyright 2008-2020 Colin Finck (colin@reactos.org)
* Copyright 2012-2013 Aleksey Bragin (aleksey@reactos.org)
*/
@ -57,98 +57,84 @@
<?php $rw->printHeader(); ?>
<div class="main" role="main">
<section class="page-top breadcrumb-wrap">
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="breadcrumbs">
<ul class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/testman">Testman</a></li>
</ul>
<div class="row" id="heading-breadcrumbs">
<div class="col-md-offset-1 col-md-10">
<div class="breadcrumbs">
<a href="/">home</a> / <a href="/testman">testman</a>
</div>
<h1><?php echo $testman_langres["index_title"]; ?></h1>
</div>
</div>
<section id="content" class="row">
<div class="col-md-10 col-md-offset-1">
<p class="lead center"><?php echo $testman_langres["index_intro"]; ?></p>
<hr>
<div class="form-horizontal">
<div class="form-group">
<label for="search_revision" class="col-sm-2 control-label"><?php echo $shared_langres["revision"]; ?></label>
<div class="col-sm-7">
<input class="form-control" type="text" id="search_revision" value="" size="50">
<?php printf($shared_langres["rangeinfo"], $rev, $rev_before, $rev); ?>
</div>
</div>
<div class="form-group">
<label for="search_source" class="col-sm-2 control-label"><?php echo $testman_langres["source"]; ?></label>
<div class="col-sm-7">
<div class="comboedit">
<select class="form-control" onchange="document.getElementById('search_source').value=this.value">
<option></option>
<?php
$stmt = $dbh->query("SELECT name FROM sources");
while (($source = $stmt->fetchColumn()) !== FALSE)
printf('<option value="%s">%s</option>', $source, $source);
?>
</select>
<div><input class="form-control" type="text" name="format" id="search_source" value=""></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2><?php echo $testman_langres["index_title"]; ?></h2>
<div class="form-group">
<label for="search_platform" class="col-sm-2 control-label"><?php echo $testman_langres["platform"]; ?></label>
<div class="col-sm-7">
<select class="form-control" id="search_platform" size="1">
<option></option>
<option value="reactos">ReactOS</option>
<option value="5.2">Windows Server 2003</option>
</select><br>
</div>
</div>
</div>
</section>
<div class="content">
<div class="container">
<p class="lead center"><?php echo $testman_langres["index_intro"]; ?></p>
<hr>
<div class="form-horizontal">
<div class="form-group">
<label for="search_revision" class="col-sm-2 control-label"><?php echo $shared_langres["revision"]; ?></label>
<div class="col-sm-7">
<input class="form-control" type="text" id="search_revision" value="" size="50">
<?php printf($shared_langres["rangeinfo"], $rev, $rev_before, $rev); ?>
</div>
</div>
<div class="form-group">
<label for="search_source" class="col-sm-2 control-label"><?php echo $testman_langres["source"]; ?></label>
<div class="col-sm-7">
<div class="comboedit">
<select class="form-control" onchange="document.getElementById('search_source').value=this.value">
<option></option>
<?php
$stmt = $dbh->query("SELECT name FROM sources");
while (($source = $stmt->fetchColumn()) !== FALSE)
printf('<option value="%s">%s</option>', $source, $source);
?>
</select>
<div><input class="form-control" type="text" name="format" id="search_source" value=""></div>
</div>
</div>
</div>
<div class="form-group">
<label for="search_platform" class="col-sm-2 control-label"><?php echo $testman_langres["platform"]; ?></label>
<div class="col-sm-7">
<select class="form-control" id="search_platform" size="1">
<option></option>
<option value="reactos">ReactOS</option>
<option value="5.2">Windows Server 2003</option>
</select><br>
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-1">
<button class="btn btn-primary" onclick="SearchButton_OnClick()"><i class="icon icon-search"></i> <?php echo $shared_langres["search_button"]; ?></button>
<i class="icon icon-cog icon-spin" id="ajax_loading_search"></i><br><br>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-1">
<button class="btn btn-primary" onclick="SearchButton_OnClick()"><i class="icon icon-search"></i> <?php echo $shared_langres["search_button"]; ?></button>
<i class="icon icon-cog icon-spin" id="ajax_loading_search"></i><br><br>
</div>
<div class="col-md-6">
<button class="btn btn-default" onclick="CompareFirstTwoButton_OnClick()"><?php echo $testman_langres["comparefirsttwo_button"]; ?></button>
<button class="btn btn-default" onclick="CompareSelectedButton_OnClick()"><?php echo $testman_langres["compareselected_button"]; ?></button>
</div>
<div class="col-md-2 checkbox">
<label><input type="checkbox" id="opennewwindow" onclick="OpenNewWindowCheckbox_OnClick(this)"> <?php echo $testman_langres["opennewwindow_checkbox"]; ?></label>
</div>
<div class="col-md-6">
<button class="btn btn-default" onclick="CompareFirstTwoButton_OnClick()"><?php echo $testman_langres["comparefirsttwo_button"]; ?></button>
<button class="btn btn-default" onclick="CompareSelectedButton_OnClick()"><?php echo $testman_langres["compareselected_button"]; ?></button>
</div>
<div id="searchtable">
<!-- Filled by the JavaScript -->
<div class="col-md-2 checkbox">
<label><input type="checkbox" id="opennewwindow" onclick="OpenNewWindowCheckbox_OnClick(this)"> <?php echo $testman_langres["opennewwindow_checkbox"]; ?></label>
</div>
</div>
<iframe id="comparepage_frame" frameborder="0" onload="ResizeIFrame()" scrolling="yes"></iframe>
</div>
<div id="searchtable">
<!-- Filled by the JavaScript -->
</div>
<iframe id="comparepage_frame" frameborder="0" onload="ResizeIFrame()" scrolling="yes"></iframe>
</div>
</div>
</section>
<?php $rw->printFooter(); ?>