mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Merge pull request #84 from dcramer/improve-unit-spec-output
Revised unit display to resemble lint output
This commit is contained in:
commit
c3e1ab0751
3 changed files with 69 additions and 71 deletions
|
@ -231,7 +231,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'differential-revision-detail-css' =>
|
'differential-revision-detail-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/caa89172/rsrc/css/application/differential/revision-detail.css',
|
'uri' => '/res/33592453/rsrc/css/application/differential/revision-detail.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -487,7 +487,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-differential-feedback-preview' =>
|
'javelin-behavior-differential-feedback-preview' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/cb399257/rsrc/js/application/differential/behavior-comment-preview.js',
|
'uri' => '/res/89633315/rsrc/js/application/differential/behavior-comment-preview.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -653,7 +653,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-maniphest-transaction-preview' =>
|
'javelin-behavior-maniphest-transaction-preview' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/34e22038/rsrc/js/application/maniphest/behavior-transaction-preview.js',
|
'uri' => '/res/44e86555/rsrc/js/application/maniphest/behavior-transaction-preview.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -1678,7 +1678,7 @@ celerity_register_resource_map(array(
|
||||||
'uri' => '/res/pkg/2d40bd98/workflow.pkg.js',
|
'uri' => '/res/pkg/2d40bd98/workflow.pkg.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
),
|
),
|
||||||
'47284eef' =>
|
'3a0c5378' =>
|
||||||
array(
|
array(
|
||||||
'name' => 'differential.pkg.js',
|
'name' => 'differential.pkg.js',
|
||||||
'symbols' =>
|
'symbols' =>
|
||||||
|
@ -1689,26 +1689,9 @@ celerity_register_resource_map(array(
|
||||||
3 => 'javelin-behavior-differential-show-more',
|
3 => 'javelin-behavior-differential-show-more',
|
||||||
4 => 'javelin-behavior-differential-diff-radios',
|
4 => 'javelin-behavior-differential-diff-radios',
|
||||||
),
|
),
|
||||||
'uri' => '/res/pkg/47284eef/differential.pkg.js',
|
'uri' => '/res/pkg/3a0c5378/differential.pkg.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
),
|
),
|
||||||
'6ed92e8c' =>
|
|
||||||
array(
|
|
||||||
'name' => 'differential.pkg.css',
|
|
||||||
'symbols' =>
|
|
||||||
array(
|
|
||||||
0 => 'differential-core-view-css',
|
|
||||||
1 => 'differential-changeset-view-css',
|
|
||||||
2 => 'differential-revision-detail-css',
|
|
||||||
3 => 'differential-revision-history-css',
|
|
||||||
4 => 'differential-table-of-contents-css',
|
|
||||||
5 => 'differential-revision-comment-css',
|
|
||||||
6 => 'differential-revision-add-comment-css',
|
|
||||||
7 => 'differential-revision-comment-list-css',
|
|
||||||
),
|
|
||||||
'uri' => '/res/pkg/6ed92e8c/differential.pkg.css',
|
|
||||||
'type' => 'css',
|
|
||||||
),
|
|
||||||
'aa531d70' =>
|
'aa531d70' =>
|
||||||
array(
|
array(
|
||||||
'name' => 'core.pkg.css',
|
'name' => 'core.pkg.css',
|
||||||
|
@ -1733,6 +1716,23 @@ celerity_register_resource_map(array(
|
||||||
'uri' => '/res/pkg/aa531d70/core.pkg.css',
|
'uri' => '/res/pkg/aa531d70/core.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
|
'ba5d2cd9' =>
|
||||||
|
array(
|
||||||
|
'name' => 'differential.pkg.css',
|
||||||
|
'symbols' =>
|
||||||
|
array(
|
||||||
|
0 => 'differential-core-view-css',
|
||||||
|
1 => 'differential-changeset-view-css',
|
||||||
|
2 => 'differential-revision-detail-css',
|
||||||
|
3 => 'differential-revision-history-css',
|
||||||
|
4 => 'differential-table-of-contents-css',
|
||||||
|
5 => 'differential-revision-comment-css',
|
||||||
|
6 => 'differential-revision-add-comment-css',
|
||||||
|
7 => 'differential-revision-comment-list-css',
|
||||||
|
),
|
||||||
|
'uri' => '/res/pkg/ba5d2cd9/differential.pkg.css',
|
||||||
|
'type' => 'css',
|
||||||
|
),
|
||||||
'bbe7e6f7' =>
|
'bbe7e6f7' =>
|
||||||
array(
|
array(
|
||||||
'name' => 'typeahead.pkg.js',
|
'name' => 'typeahead.pkg.js',
|
||||||
|
@ -1761,23 +1761,23 @@ celerity_register_resource_map(array(
|
||||||
'aphront-table-view-css' => 'aa531d70',
|
'aphront-table-view-css' => 'aa531d70',
|
||||||
'aphront-tokenizer-control-css' => 'aa531d70',
|
'aphront-tokenizer-control-css' => 'aa531d70',
|
||||||
'aphront-typeahead-control-css' => 'aa531d70',
|
'aphront-typeahead-control-css' => 'aa531d70',
|
||||||
'differential-changeset-view-css' => '6ed92e8c',
|
'differential-changeset-view-css' => 'ba5d2cd9',
|
||||||
'differential-core-view-css' => '6ed92e8c',
|
'differential-core-view-css' => 'ba5d2cd9',
|
||||||
'differential-revision-add-comment-css' => '6ed92e8c',
|
'differential-revision-add-comment-css' => 'ba5d2cd9',
|
||||||
'differential-revision-comment-css' => '6ed92e8c',
|
'differential-revision-comment-css' => 'ba5d2cd9',
|
||||||
'differential-revision-comment-list-css' => '6ed92e8c',
|
'differential-revision-comment-list-css' => 'ba5d2cd9',
|
||||||
'differential-revision-detail-css' => '6ed92e8c',
|
'differential-revision-detail-css' => 'ba5d2cd9',
|
||||||
'differential-revision-history-css' => '6ed92e8c',
|
'differential-revision-history-css' => 'ba5d2cd9',
|
||||||
'differential-table-of-contents-css' => '6ed92e8c',
|
'differential-table-of-contents-css' => 'ba5d2cd9',
|
||||||
'diffusion-commit-view-css' => '03ef179e',
|
'diffusion-commit-view-css' => '03ef179e',
|
||||||
'javelin-behavior' => '22c00e0e',
|
'javelin-behavior' => '22c00e0e',
|
||||||
'javelin-behavior-aphront-basic-tokenizer' => 'bbe7e6f7',
|
'javelin-behavior-aphront-basic-tokenizer' => 'bbe7e6f7',
|
||||||
'javelin-behavior-aphront-form-disable-on-submit' => '2d40bd98',
|
'javelin-behavior-aphront-form-disable-on-submit' => '2d40bd98',
|
||||||
'javelin-behavior-differential-diff-radios' => '47284eef',
|
'javelin-behavior-differential-diff-radios' => '3a0c5378',
|
||||||
'javelin-behavior-differential-edit-inline-comments' => '47284eef',
|
'javelin-behavior-differential-edit-inline-comments' => '3a0c5378',
|
||||||
'javelin-behavior-differential-feedback-preview' => '47284eef',
|
'javelin-behavior-differential-feedback-preview' => '3a0c5378',
|
||||||
'javelin-behavior-differential-populate' => '47284eef',
|
'javelin-behavior-differential-populate' => '3a0c5378',
|
||||||
'javelin-behavior-differential-show-more' => '47284eef',
|
'javelin-behavior-differential-show-more' => '3a0c5378',
|
||||||
'javelin-behavior-phabricator-keyboard-shortcuts' => '2d40bd98',
|
'javelin-behavior-phabricator-keyboard-shortcuts' => '2d40bd98',
|
||||||
'javelin-behavior-workflow' => '2d40bd98',
|
'javelin-behavior-workflow' => '2d40bd98',
|
||||||
'javelin-dom' => '22c00e0e',
|
'javelin-dom' => '22c00e0e',
|
||||||
|
|
|
@ -44,37 +44,35 @@ final class DifferentialUnitFieldSpecification
|
||||||
if ($udata) {
|
if ($udata) {
|
||||||
$unit_messages = array();
|
$unit_messages = array();
|
||||||
foreach ($udata as $test) {
|
foreach ($udata as $test) {
|
||||||
$name = phutil_escape_html(idx($test, 'name'));
|
$name = idx($test, 'name');
|
||||||
$result = phutil_escape_html(idx($test, 'result'));
|
$result = idx($test, 'result');
|
||||||
|
|
||||||
if ($result != DifferentialUnitTestResult::RESULT_POSTPONED &&
|
if ($result != DifferentialUnitTestResult::RESULT_POSTPONED &&
|
||||||
$result != DifferentialUnitTestResult::RESULT_PASS) {
|
$result != DifferentialUnitTestResult::RESULT_PASS) {
|
||||||
$userdata = phutil_escape_html(idx($test, 'userdata'));
|
$userdata = phutil_utf8_shorten(idx($test, 'userdata'), 256);
|
||||||
if (strlen($userdata) > 256) {
|
$userdata = phutil_escape_html($userdata);
|
||||||
$userdata = substr($userdata, 0, 256).'...';
|
|
||||||
}
|
|
||||||
$userdata = str_replace("\n", '<br />', $userdata);
|
$userdata = str_replace("\n", '<br />', $userdata);
|
||||||
$unit_messages[] =
|
|
||||||
'<tr>'.
|
|
||||||
'<th>'.$name.'</th>'.
|
|
||||||
'<th class="unit-test-result">'.
|
|
||||||
'<div class="result-'.$result.'">'.
|
|
||||||
strtoupper($result).
|
|
||||||
'</div>'.
|
|
||||||
'</th>'.
|
|
||||||
'<td>'.$userdata.'</td>'.
|
|
||||||
'</tr>';
|
|
||||||
|
|
||||||
$utail =
|
$unit_messages[] =
|
||||||
'<div class="differential-unit-block">'.
|
'<li>'.
|
||||||
'<table class="differential-unit-table">'.
|
'<span class="unit-result-'.phutil_escape_html($result).'">'.
|
||||||
implode("\n", $unit_messages).
|
phutil_escape_html(ucwords($result)).
|
||||||
'</table>'.
|
'</span>'.
|
||||||
'</div>';
|
' '.
|
||||||
|
phutil_escape_html($name).
|
||||||
|
'<p>'.$userdata.'</p>'.
|
||||||
|
'</li>';
|
||||||
|
|
||||||
} else if ($result == DifferentialUnitTestResult::RESULT_POSTPONED) {
|
} else if ($result == DifferentialUnitTestResult::RESULT_POSTPONED) {
|
||||||
$postponed_count++;
|
$postponed_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$utail =
|
||||||
|
'<div class="differential-unit-block">'.
|
||||||
|
'<ul>'.
|
||||||
|
implode("\n", $unit_messages).
|
||||||
|
'</ul>'.
|
||||||
|
'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postponed_count > 0 &&
|
if ($postponed_count > 0 &&
|
||||||
|
|
|
@ -61,29 +61,29 @@
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.differential-unit-table th {
|
.differential-unit-block li {
|
||||||
white-space: nowrap;
|
margin-left: 1.5em;
|
||||||
padding: 4px 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.differential-unit-table th.unit-test-result {
|
.differential-unit-block li p {
|
||||||
|
margin-left: 1em;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.differential-unit-block .unit-test-result {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.differential-unit-table .result-fail {
|
.differential-unit-block .unit-result-fail {
|
||||||
background: #ff3333;
|
background: #ff3333;
|
||||||
padding: 4px 8px;
|
padding: 0 0.5em;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.differential-unit-table .result-unsound {
|
.differential-unit-block .unit-result-unsound {
|
||||||
background: #cc33cc;
|
background: #cc33cc;
|
||||||
padding: 4px 8px;
|
padding: 0 0.5em;
|
||||||
}
|
font-weight: bold;
|
||||||
|
|
||||||
.differential-unit-table td {
|
|
||||||
width: 100%;
|
|
||||||
padding: 4px 8px;
|
|
||||||
color: #666666;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.differential-keyboard-shortcuts {
|
.differential-keyboard-shortcuts {
|
||||||
|
|
Loading…
Reference in a new issue