mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
slack username
This commit is contained in:
parent
7cb3970161
commit
52df78dda0
2 changed files with 9 additions and 5 deletions
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
|
|
@ -356,7 +356,9 @@ class TestReporter {
|
||||||
core.info(`Check run details: ${resp.data.details_url}`);
|
core.info(`Check run details: ${resp.data.details_url}`);
|
||||||
result.checkUrl = resp.data.html_url;
|
result.checkUrl = resp.data.html_url;
|
||||||
if (this.slackWebhook && this.context.branch === 'master') {
|
if (this.slackWebhook && this.context.branch === 'master') {
|
||||||
const webhook = new webhook_1.IncomingWebhook(this.slackWebhook);
|
const webhook = new webhook_1.IncomingWebhook(this.slackWebhook, {
|
||||||
|
username: name
|
||||||
|
});
|
||||||
const passed = results.reduce((sum, tr) => sum + tr.passed, 0);
|
const passed = results.reduce((sum, tr) => sum + tr.passed, 0);
|
||||||
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0);
|
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0);
|
||||||
const failed = results.reduce((sum, tr) => sum + tr.failed, 0);
|
const failed = results.reduce((sum, tr) => sum + tr.failed, 0);
|
||||||
|
|
@ -383,9 +385,9 @@ class TestReporter {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (failed <= 10) {
|
if (failed <= 10) {
|
||||||
tr.failedSuites.map((suite) => {
|
tr.failedSuites.map(suite => {
|
||||||
suite.failedGroups.map((group) => {
|
suite.failedGroups.map(group => {
|
||||||
group.failedTests.map((test) => {
|
group.failedTests.map(test => {
|
||||||
req.blocks.push({
|
req.blocks.push({
|
||||||
type: 'section',
|
type: 'section',
|
||||||
text: {
|
text: {
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,9 @@ class TestReporter {
|
||||||
result.checkUrl = resp.data.html_url
|
result.checkUrl = resp.data.html_url
|
||||||
|
|
||||||
if (this.slackWebhook && this.context.branch === 'master') {
|
if (this.slackWebhook && this.context.branch === 'master') {
|
||||||
const webhook = new IncomingWebhook(this.slackWebhook)
|
const webhook = new IncomingWebhook(this.slackWebhook, {
|
||||||
|
username: name
|
||||||
|
})
|
||||||
const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
|
const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
|
||||||
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
|
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
|
||||||
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
|
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue