Skip to content

Commit 839fd64

Browse files
committed
Display N/A and Infinity in Duration column
related: runtimes/backlog/issues/1692 Signed-off-by: Lan Xia <Lan_Xia@ca.ibm.com>
1 parent bcfa367 commit 839fd64

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

test-result-summary-client/src/Build/AllTestsInfo.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,19 @@ const Build = () => {
105105
let testResult = [];
106106
if (builds[0].tests !== undefined) {
107107
testResult = builds[0].tests.map((test) => {
108+
let duration = test.duration;
109+
if (!duration) {
110+
if (!test.startTime) {
111+
duration = null;
112+
} else {
113+
duration = Infinity;
114+
}
115+
}
108116
const ret = {
109117
key: test._id,
110118
sortName: test.testName,
111119
testName: test.testName,
112-
duration: test.duration,
120+
duration,
113121
machine: builds[0].machine,
114122
sortMachine: builds[0].machine,
115123
buildName: buildData[0].buildName,

test-result-summary-client/src/Build/Duration.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export default function renderDuration(ms) {
22
if (ms === null) {
33
return 'N/A';
4+
} else if (ms === Infinity) {
5+
return ms;
46
}
57
const milliseconds = parseInt(ms % 1000, 10);
68
const seconds = parseInt((ms / 1000) % 60, 10);

0 commit comments

Comments
 (0)