Skip to content

Commit ad05d1f

Browse files
Merge pull request #215 from contentstack/fix/slack-notification
updated to provide report link and indentation
2 parents 85d7c4a + f232876 commit ad05d1f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

sanity-report-dev11.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ const resultMessage =
1818
? `:white_check_mark: Success (${passedTests} / ${totalTests} Passed)`
1919
: `:x: Failure (${passedTests} / ${totalTests} Passed)`;
2020

21+
const pipelineName = process.env.GOCD_PIPELINE_NAME;
22+
const buildNumber = process.env.GOCD_PIPELINE_LABEL;
23+
const goCdServer = process.env.GOCD_SERVER;
24+
25+
const reportUrl = `http://${goCdServer}/go/files/${pipelineName}/${buildNumber}/sanity/1/sanity/test-results/mochawesome-report/sanity-report.html`;
26+
2127
const slackMessage = {
22-
text: `
23-
*Dev11, CMA SDK Full Sanity*
24-
Result: ${resultMessage}
25-
Failed Tests: ${failedTests}
26-
View Report: <file://${process.cwd()}/mochawesome-report/sanity-report.html>
27-
`,
28+
text: `Dev11, CMA SDK Full Sanity
29+
*Result:* ${resultMessage}
30+
*Failed Tests:* ${failedTests}
31+
<${reportUrl}|View Report>`,
2832
};
2933

3034
const slackWebhookUrl = process.env.SLACK_WEBHOOK_URL;

0 commit comments

Comments
 (0)