Skip to content

Commit

Permalink
Merge pull request #215 from contentstack/fix/slack-notification
Browse files Browse the repository at this point in the history
updated to provide report link and indentation
  • Loading branch information
harshithad0703 authored Nov 18, 2024
2 parents 85d7c4a + f232876 commit ad05d1f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sanity-report-dev11.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ const resultMessage =
? `:white_check_mark: Success (${passedTests} / ${totalTests} Passed)`
: `:x: Failure (${passedTests} / ${totalTests} Passed)`;

const pipelineName = process.env.GOCD_PIPELINE_NAME;
const buildNumber = process.env.GOCD_PIPELINE_LABEL;
const goCdServer = process.env.GOCD_SERVER;

const reportUrl = `http://${goCdServer}/go/files/${pipelineName}/${buildNumber}/sanity/1/sanity/test-results/mochawesome-report/sanity-report.html`;

const slackMessage = {
text: `
*Dev11, CMA SDK Full Sanity*
Result: ${resultMessage}
Failed Tests: ${failedTests}
View Report: <file://${process.cwd()}/mochawesome-report/sanity-report.html>
`,
text: `Dev11, CMA SDK Full Sanity
*Result:* ${resultMessage}
*Failed Tests:* ${failedTests}
<${reportUrl}|View Report>`,
};

const slackWebhookUrl = process.env.SLACK_WEBHOOK_URL;
Expand Down

0 comments on commit ad05d1f

Please sign in to comment.