Skip to content
Permalink
Browse files

add ran ratio vs skipped. adjust math. (#431)

  • Loading branch information...
MykolaGolubyev committed Sep 28, 2019
1 parent b0d75e0 commit a08ed07933ca79f8822c0dda32a6e2b19c5a2571
@@ -155,16 +155,26 @@ class Report {
function expandSummary(summary) {
return {
...summary,
totalRan: calculateTotalRan(),
totalWithProblems: calculateTotalWithProblems(),
percentagePassed: calculatePercentagePassed()
percentagePassed: calculatePercentagePassed(),
percentageRan: calculatePercentageRan()
}

function calculateTotalWithProblems() {
return summary.failed + summary.errored + summary.skipped
return summary.failed + summary.errored
}

function calculateTotalRan() {
return summary.total - summary.skipped
}

function calculatePercentagePassed() {
return 100 - ((calculateTotalWithProblems() / summary.total) * 100) | 0
return 100 - ((calculateTotalWithProblems() / calculateTotalRan()) * 100) | 0
}

function calculatePercentageRan() {
return (calculateTotalRan() / summary.total) * 100 | 0
}
}

@@ -21,6 +21,7 @@ import HttpOperationCoverageSummary from './overal-info/HttpOperationCoverageSum
import TestsOverallTiming from './overal-info/TestsOverallTiming'

import TestsSuccessRatio from './overal-info/TestsSuccessRatio'
import TestsRanRatio from './overal-info/TestsRanRatio'

import './OverallInfo.css'

@@ -29,8 +30,9 @@ export default function OverallInfo({report, onSwitchToHttpCalls, onSwitchToSkip
<div className="overall-info">
<TestsOverallTiming report={report}/>
<TestsSuccessRatio report={report}/>
<HttpCallsTiming report={report} onSwitchToHttpCalls={onSwitchToHttpCalls}/>
<HttpOperationCoverageSummary report={report} onSwitchToSkippedHttpCalls={onSwitchToSkippedHttpCalls}/>
<TestsRanRatio report={report}/>
<HttpCallsTiming report={report} onSwitchToHttpCalls={onSwitchToHttpCalls}/>
</div>
)
}
@@ -0,0 +1,30 @@
/*
* Copyright 2019 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React from 'react'

import CardList from '../../widgets/CardList'
import CardLabelAndNumber from '../../widgets/CardLabelAndNumber'

export default function TestsRanRatio({report}) {
return (
<CardList label="Tests run ratio">
<CardLabelAndNumber label="Ran" number={report.summary.percentageRan} unit="%"/>
<CardLabelAndNumber label="Tests total" number={report.summary.total}/>
<CardLabelAndNumber label="Skipped" number={report.summary.skipped}/>
</CardList>
)
}
@@ -23,7 +23,7 @@ export default function TestsSuccessRatio({report}) {
return (
<CardList label="Tests success ratio">
<CardLabelAndNumber label="Passed" number={report.summary.percentagePassed} unit="%"/>
<CardLabelAndNumber label="Passed total" number={report.summary.total}/>
<CardLabelAndNumber label="Passed total" number={report.summary.passed}/>
<CardLabelAndNumber label="Total with Problems" number={report.summary.totalWithProblems}/>
</CardList>
)

Some generated files are not rendered by default. Learn more.

0 comments on commit a08ed07

Please sign in to comment.
You can’t perform that action at this time.