Skip to content

Commit

Permalink
Merge pull request #219 from contentstack/fix/slack-notification-envs
Browse files Browse the repository at this point in the history
update notification with time stamp
  • Loading branch information
harshithad0703 authored Nov 19, 2024
2 parents 9cb1f00 + f5f7543 commit f930c9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sanity-report-dev11.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand All @@ -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>`,
};
Expand Down

0 comments on commit f930c9a

Please sign in to comment.