Skip to content

Commit f95f450

Browse files
Merge pull request #249 from contentstack/fix/slack-notification-envs
update notification with time stamp
2 parents 1b3843a + 1b6b1ab commit f95f450

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sanity-report-dev11.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ const totalFail = $(".nav a:nth-child(4)")
2121
.trim()
2222
.replace("Total Fail", "");
2323

24+
const totalTime = $(".nav a:nth-child(1)")
25+
.text()
26+
.trim()
27+
.replace("Total Time", "");
28+
29+
const milliseconds = parseInt(totalTime.replace(/\D/g, ''), 10);
30+
const totalSeconds = Math.floor(milliseconds / 1000);
31+
const durationInMinutes = Math.floor(totalSeconds / 60);
32+
const durationInSeconds = totalSeconds % 60;
33+
2434
const passedTests = parseInt(totalPass, 10);
2535
const totalTests = parseInt(totalCount, 10);
2636

@@ -37,7 +47,7 @@ const reportUrl = `http://${goCdServer}/go/files/${pipelineName}/${pipelineCount
3747

3848
const slackMessage = {
3949
text: `Dev11, CDA SDK Full Sanity
40-
*Result:* ${resultMessage}
50+
*Result:* ${resultMessage}. ${durationInMinutes}m ${durationInSeconds}s
4151
*Failed Tests:* ${totalFail}
4252
<${reportUrl}|View Report>`,
4353
};

0 commit comments

Comments
 (0)