From f5f7543928175889b33007ada832cabfdbb6bd4a Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Tue, 19 Nov 2024 17:20:12 +0530 Subject: [PATCH] update notification with time stamp --- sanity-report-dev11.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sanity-report-dev11.js b/sanity-report-dev11.js index 4fae04cd..5a2c1753 100644 --- a/sanity-report-dev11.js +++ b/sanity-report-dev11.js @@ -13,6 +13,10 @@ const totalTests = mochawesomeReport.stats.tests; const passedTests = mochawesomeReport.stats.passes; const failedTests = mochawesomeReport.stats.failures; +let durationInSeconds = Math.floor(mochawesomeReport.stats.duration / 1000) +const durationInMinutes = Math.floor(durationInSeconds / 60) +durationInSeconds %= 60 + const resultMessage = passedTests === totalTests ? `:white_check_mark: Success (${passedTests} / ${totalTests} Passed)` @@ -26,7 +30,7 @@ const reportUrl = `http://${goCdServer}/go/files/${pipelineName}/${pipelineCount const slackMessage = { text: `Dev11, CMA SDK Full Sanity -*Result:* ${resultMessage} +*Result:* ${resultMessage}. ${durationInMinutes}m ${durationInSeconds}s *Failed Tests:* ${failedTests} <${reportUrl}|View Report>`, };