JENKINS-36336 - show list of fixed tests (#338)

This commit is contained in:
Keith Zantow 2016-07-19 15:36:09 -07:00 committed by GitHub
parent 8cdd41bef1
commit bafc4238fb
1 changed files with 30 additions and 15 deletions

View File

@ -7,23 +7,28 @@ import moment from 'moment';
const TestCaseResultRow = (props) => {
const t = props.testCase;
const duration = moment.duration(Number(t.duration), 'milliseconds').humanize();
const expandable = t.errorStackTrace;
let testDetails = !expandable ? null : (<div className="test-details">
<div className="test-detail-text" style={{ display: 'none' }}>
{duration}
</div>
<div className="test-console">
<h4>Error</h4>
<div className="error-message">
{t.errorDetails}
let testDetails = null;
if (t.errorStackTrace) {
testDetails = (
<div className="test-details">
<div className="test-detail-text" style={{ display: 'none' }}>
{duration}
</div>
<div className="test-console">
<h4>Error</h4>
<div className="error-message">
{t.errorDetails}
</div>
<h4>Output</h4>
<div className="stack-trace">
{t.errorStackTrace}
</div>
</div>
</div>
<h4>Output</h4>
<div className="stack-trace">
{t.errorStackTrace}
</div>
</div>
</div>);
);
}
let statusIndicator = null;
switch (t.status) {
@ -33,6 +38,7 @@ const TestCaseResultRow = (props) => {
case 'SKIPPED':
statusIndicator = StatusIndicator.validResultValues.unstable;
break;
case 'FIXED':
case 'PASSED':
statusIndicator = StatusIndicator.validResultValues.success;
break;
@ -71,6 +77,7 @@ export default class TestResult extends Component {
let passBlock = null;
let newFailureBlock = null;
let existingFailureBlock = null;
let fixedBlock = null;
let skippedBlock = null;
let summaryBlock = null;
summaryBlock = (
@ -124,6 +131,13 @@ export default class TestResult extends Component {
];
}
if (fixed.length > 0) {
fixedBlock = [
<h4>Fixed</h4>,
fixed.map((t, i) => <TestCaseResultRow key={i} testCase={t} />),
];
}
if (skipped.length > 0) {
skippedBlock = [
<h4>Skipped - {skipped.length}</h4>,
@ -135,6 +149,7 @@ export default class TestResult extends Component {
{summaryBlock}
{newFailureBlock}
{existingFailureBlock}
{fixedBlock}
{skippedBlock}
{passBlock}
</div>);