apify-test-tools 0.5.6 → 0.5.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/bin/main.ts +10 -6
- package/bin/slack.ts +18 -14
- package/bin/test-report.ts +17 -15
- package/dist/bin/main.js +10 -6
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/slack.d.ts +3 -1
- package/dist/bin/slack.d.ts.map +1 -1
- package/dist/bin/slack.js +15 -15
- package/dist/bin/slack.js.map +1 -1
- package/dist/bin/test-report.d.ts +3 -3
- package/dist/bin/test-report.d.ts.map +1 -1
- package/dist/bin/test-report.js +10 -10
- package/dist/bin/test-report.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -54
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
<!-- git-cliff-unreleased-start -->
|
|
6
|
+
## 0.5.7 - **not yet released**
|
|
7
|
+
|
|
8
|
+
### 🚀 Features
|
|
9
|
+
|
|
10
|
+
- Make slack notification explictly opt in ([#60](https://github.com/apify/apify-test-tools/pull/60)) ([32fda72](https://github.com/apify/apify-test-tools/commit/32fda72726896d90c7a1444977b87e4aa8e8d247)) by [@ruocco-l](https://github.com/ruocco-l), closes [#55](https://github.com/apify/apify-test-tools/issues/55)
|
|
11
|
+
|
|
12
|
+
### Debug
|
|
13
|
+
|
|
14
|
+
- Bump version to test beta release ([1322d31](https://github.com/apify/apify-test-tools/commit/1322d31873b6d43e16a68e97bdc358752f813f79)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<!-- git-cliff-unreleased-end -->
|
|
18
|
+
# Changelog
|
|
19
|
+
|
|
3
20
|
## 0.5.5
|
|
4
21
|
|
|
5
22
|
fix: disable logs from actor.call
|
|
@@ -71,4 +88,4 @@ feat: feat: add maxRetriesPerRequest test
|
|
|
71
88
|
### Cli
|
|
72
89
|
|
|
73
90
|
- fix: parsing commits
|
|
74
|
-
- feat: add `--workspace` cli option
|
|
91
|
+
- feat: add `--workspace` cli option
|
package/bin/main.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { runBuilds } from './build.js';
|
|
|
9
9
|
import { getChangedFiles, getCommits } from './git.js';
|
|
10
10
|
import { getPushData } from './github.js';
|
|
11
11
|
import { notifyToSlack } from './slack.js';
|
|
12
|
-
import {
|
|
12
|
+
import { reportTestResults } from './test-report.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Middlewares to be run before every command execution
|
|
@@ -78,11 +78,11 @@ await yargs()
|
|
|
78
78
|
(args) =>
|
|
79
79
|
args
|
|
80
80
|
.option('report-file', { type: 'string', demandOption: true })
|
|
81
|
+
.option('report-slack-channel', { type: 'string' })
|
|
81
82
|
.option('job-url', { type: 'string' })
|
|
82
|
-
.option('workflow-name', { type: 'string' })
|
|
83
|
-
.option('repository', { type: 'string' }),
|
|
83
|
+
.option('workflow-name', { type: 'string' }),
|
|
84
84
|
async (args) => {
|
|
85
|
-
await
|
|
85
|
+
await reportTestResults(args);
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
.command(
|
|
@@ -119,7 +119,9 @@ await yargs()
|
|
|
119
119
|
(args) =>
|
|
120
120
|
args
|
|
121
121
|
.option('push-event-path', { type: 'string', demandOption: true })
|
|
122
|
-
.option('dry-run', { type: 'boolean', default: false })
|
|
122
|
+
.option('dry-run', { type: 'boolean', default: false })
|
|
123
|
+
.option('report-slack-channel', { type: 'string' })
|
|
124
|
+
.option('release-slack-channel', { type: 'string' }),
|
|
123
125
|
async (args) => {
|
|
124
126
|
const { branch, changedFiles, repoUrl, commits, changelog, repository, author } = await getPushData(
|
|
125
127
|
args.pushEventPath
|
|
@@ -131,7 +133,7 @@ await yargs()
|
|
|
131
133
|
actorConfigs,
|
|
132
134
|
isLatest,
|
|
133
135
|
});
|
|
134
|
-
const { dryRun } = args;
|
|
136
|
+
const { dryRun, reportSlackChannel, releaseSlackChannel } = args;
|
|
135
137
|
const builds = await runBuilds({
|
|
136
138
|
isLatest,
|
|
137
139
|
repoUrl,
|
|
@@ -149,6 +151,8 @@ await yargs()
|
|
|
149
151
|
repository,
|
|
150
152
|
dryRun,
|
|
151
153
|
author,
|
|
154
|
+
reportSlackChannel,
|
|
155
|
+
releaseSlackChannel,
|
|
152
156
|
});
|
|
153
157
|
}
|
|
154
158
|
)
|
package/bin/slack.ts
CHANGED
|
@@ -9,6 +9,8 @@ type NotifyToSlackOptions = {
|
|
|
9
9
|
commits: Commit[];
|
|
10
10
|
dryRun: boolean;
|
|
11
11
|
author: string;
|
|
12
|
+
releaseSlackChannel?: string;
|
|
13
|
+
reportSlackChannel?: string;
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
export const notifyToSlack = async ({
|
|
@@ -18,6 +20,8 @@ export const notifyToSlack = async ({
|
|
|
18
20
|
repository,
|
|
19
21
|
dryRun,
|
|
20
22
|
author,
|
|
23
|
+
releaseSlackChannel,
|
|
24
|
+
reportSlackChannel,
|
|
21
25
|
}: NotifyToSlackOptions) => {
|
|
22
26
|
const slack = new WebClient(getEnvVar('SLACK_TOKEN_RELEASES_BOT'));
|
|
23
27
|
|
|
@@ -28,15 +32,14 @@ export const notifyToSlack = async ({
|
|
|
28
32
|
let shortMessage = `${repository} --- New release (by ${author}):\n\n`;
|
|
29
33
|
|
|
30
34
|
// This one is just for broader public that only cares about public facing changes
|
|
31
|
-
if (changelog) {
|
|
32
|
-
console.error(`=========================================`);
|
|
35
|
+
if (changelog && releaseSlackChannel) {
|
|
33
36
|
shortMessage += `**Additions to the changelog**:\n\n${changelog}\n`;
|
|
34
|
-
|
|
35
|
-
console.error(`**Sending slack message to channel**: ${
|
|
37
|
+
console.error(`=========================================`);
|
|
38
|
+
console.error(`**Sending slack message to channel**: ${releaseSlackChannel}.\n\n${shortMessage}`);
|
|
36
39
|
console.error(`=========================================`);
|
|
37
40
|
if (!dryRun) {
|
|
38
41
|
await slack.chat.postMessage({
|
|
39
|
-
channel,
|
|
42
|
+
channel: releaseSlackChannel,
|
|
40
43
|
text: shortMessage,
|
|
41
44
|
});
|
|
42
45
|
}
|
|
@@ -49,15 +52,16 @@ export const notifyToSlack = async ({
|
|
|
49
52
|
const longMessage = `${shortMessage}\n**Commit list**:\n${commitsMessage}\n\n${changedFilesMessage}`;
|
|
50
53
|
|
|
51
54
|
// This one is for devs and project managers that need to know more details
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if (reportSlackChannel) {
|
|
56
|
+
console.error(`=========================================`);
|
|
57
|
+
console.error(`Sending slack message to channel: ${reportSlackChannel}.\n\n${longMessage}`);
|
|
58
|
+
console.error(`=========================================`);
|
|
59
|
+
if (!dryRun) {
|
|
60
|
+
await slack.chat.postMessage({
|
|
61
|
+
text: longMessage,
|
|
62
|
+
channel: reportSlackChannel,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
67
|
|
package/bin/test-report.ts
CHANGED
|
@@ -2,21 +2,21 @@ import fs from 'fs/promises';
|
|
|
2
2
|
import { sendSlackMessage } from './slack.js';
|
|
3
3
|
import { getEnvVar } from './utils.js';
|
|
4
4
|
|
|
5
|
-
interface
|
|
5
|
+
interface ReportTestResultsOptions {
|
|
6
6
|
reportFile: string
|
|
7
7
|
dryRun: boolean
|
|
8
|
+
reportSlackChannel?: string
|
|
8
9
|
jobUrl?: string
|
|
9
|
-
repository?: string
|
|
10
10
|
workflowName?: string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const reportTestResults = async ({
|
|
14
14
|
dryRun,
|
|
15
|
+
reportSlackChannel,
|
|
15
16
|
reportFile: jsonResultsPath,
|
|
16
17
|
jobUrl,
|
|
17
18
|
workflowName,
|
|
18
|
-
|
|
19
|
-
}: ReportTestRestulsOptions) => {
|
|
19
|
+
}: ReportTestResultsOptions) => {
|
|
20
20
|
const results: JsonTestResults = JSON.parse((await fs.readFile(jsonResultsPath)).toString());
|
|
21
21
|
const passed: JsonAssertionResult[] = [];
|
|
22
22
|
const failed: JsonAssertionResult[] = [];
|
|
@@ -65,6 +65,11 @@ export const reportTestRestuls = async ({
|
|
|
65
65
|
console.error();
|
|
66
66
|
console.error(`PASSED: ${passed.length}, FAILED: ${failed.length}`);
|
|
67
67
|
console.error();
|
|
68
|
+
|
|
69
|
+
if (!reportSlackChannel) {
|
|
70
|
+
console.error(`Skipping slack notification. If you want to enable it, add --report-slack-channel flag and make sure SLACK_TOKEN_TESTS_BOT env variable is set.`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
68
73
|
|
|
69
74
|
if (failedAssertions.length === 0) {
|
|
70
75
|
return;
|
|
@@ -73,24 +78,21 @@ export const reportTestRestuls = async ({
|
|
|
73
78
|
// TODO: add slack profiles
|
|
74
79
|
const total = failed.length + passed.length;
|
|
75
80
|
const jobLink = jobUrl ? ` Check <${jobUrl}|the job>.` : '';
|
|
76
|
-
let slackMessage = `\`${workflowName ?? '-'}
|
|
81
|
+
let slackMessage = `\`${workflowName ?? '-'}\``;
|
|
77
82
|
slackMessage += `: has ${failedAssertions.length} failed assertions. Failing test suites: ${failed.length}/${total}.${jobLink}`;
|
|
78
83
|
slackMessage += `\n\n${failedAssertions[0].message} --- <${failedAssertions[0].runLink}|${failedAssertions[0].actorName}>`;
|
|
79
84
|
const blocks = failedAssertions.slice(1).map(({ message, runLink, actorName }) => `• ${message} --- <${runLink}|${actorName}>`);
|
|
80
85
|
|
|
81
|
-
if (!repository) {
|
|
82
|
-
console.error(`Repository not provided, not sending slack notification`);
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// remove repository-owner part
|
|
87
|
-
const channel = `#notif-${repository.replace(/[^/]+\//, '')}`;
|
|
88
|
-
console.error(`Sending a notification to slack channel ${channel}`);
|
|
89
86
|
console.error('SLACK:', slackMessage);
|
|
90
87
|
console.error('\tblocks:', blocks.join('\n\t\t'));
|
|
88
|
+
|
|
89
|
+
if (!reportSlackChannel) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
91
93
|
if (!dryRun) {
|
|
92
94
|
const slackToken = getEnvVar('SLACK_TOKEN_TESTS_BOT');
|
|
93
|
-
await sendSlackMessage(
|
|
95
|
+
await sendSlackMessage(reportSlackChannel, slackMessage, blocks, slackToken);
|
|
94
96
|
}
|
|
95
97
|
};
|
|
96
98
|
|
package/dist/bin/main.js
CHANGED
|
@@ -7,7 +7,7 @@ import { runBuilds } from './build.js';
|
|
|
7
7
|
import { getChangedFiles, getCommits } from './git.js';
|
|
8
8
|
import { getPushData } from './github.js';
|
|
9
9
|
import { notifyToSlack } from './slack.js';
|
|
10
|
-
import {
|
|
10
|
+
import { reportTestResults } from './test-report.js';
|
|
11
11
|
/**
|
|
12
12
|
* Middlewares to be run before every command execution
|
|
13
13
|
*/
|
|
@@ -64,10 +64,10 @@ await yargs()
|
|
|
64
64
|
})
|
|
65
65
|
.command('report-tests', '', (args) => args
|
|
66
66
|
.option('report-file', { type: 'string', demandOption: true })
|
|
67
|
+
.option('report-slack-channel', { type: 'string' })
|
|
67
68
|
.option('job-url', { type: 'string' })
|
|
68
|
-
.option('workflow-name', { type: 'string' })
|
|
69
|
-
|
|
70
|
-
await reportTestRestuls(args);
|
|
69
|
+
.option('workflow-name', { type: 'string' }), async (args) => {
|
|
70
|
+
await reportTestResults(args);
|
|
71
71
|
})
|
|
72
72
|
.command('build', '', (args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }), async (args) => {
|
|
73
73
|
const commits = getCommits(args);
|
|
@@ -90,7 +90,9 @@ await yargs()
|
|
|
90
90
|
})
|
|
91
91
|
.command('release', '', (args) => args
|
|
92
92
|
.option('push-event-path', { type: 'string', demandOption: true })
|
|
93
|
-
.option('dry-run', { type: 'boolean', default: false })
|
|
93
|
+
.option('dry-run', { type: 'boolean', default: false })
|
|
94
|
+
.option('report-slack-channel', { type: 'string' })
|
|
95
|
+
.option('release-slack-channel', { type: 'string' }), async (args) => {
|
|
94
96
|
const { branch, changedFiles, repoUrl, commits, changelog, repository, author } = await getPushData(args.pushEventPath);
|
|
95
97
|
const isLatest = true;
|
|
96
98
|
const actorConfigs = await getRepoActors();
|
|
@@ -99,7 +101,7 @@ await yargs()
|
|
|
99
101
|
actorConfigs,
|
|
100
102
|
isLatest,
|
|
101
103
|
});
|
|
102
|
-
const { dryRun } = args;
|
|
104
|
+
const { dryRun, reportSlackChannel, releaseSlackChannel } = args;
|
|
103
105
|
const builds = await runBuilds({
|
|
104
106
|
isLatest,
|
|
105
107
|
repoUrl,
|
|
@@ -116,6 +118,8 @@ await yargs()
|
|
|
116
118
|
repository,
|
|
117
119
|
dryRun,
|
|
118
120
|
author,
|
|
121
|
+
reportSlackChannel,
|
|
122
|
+
releaseSlackChannel,
|
|
119
123
|
});
|
|
120
124
|
})
|
|
121
125
|
.strictCommands()
|
package/dist/bin/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../bin/main.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OA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C9B,YAAY;QACZ,QAAQ;KACX,CAAC,CAAC;IACH,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;IACjE,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC;QAC3B,QAAQ;QACR,OAAO;QACP,YAAY,EAAE,aAAa;QAC3B,MAAM;QACN,MAAM;KACT,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtC,4BAA4B;IAC5B,MAAM,aAAa,CAAC;QAChB,YAAY;QACZ,OAAO;QACP,SAAS;QACT,UAAU;QACV,MAAM;QACN,MAAM;QACN,kBAAkB;QAClB,mBAAmB;KACtB,CAAC,CAAC;AACP,CAAC,CACJ;KACA,cAAc,EAAE;KAChB,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAC;KACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
package/dist/bin/slack.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ type NotifyToSlackOptions = {
|
|
|
6
6
|
commits: Commit[];
|
|
7
7
|
dryRun: boolean;
|
|
8
8
|
author: string;
|
|
9
|
+
releaseSlackChannel?: string;
|
|
10
|
+
reportSlackChannel?: string;
|
|
9
11
|
};
|
|
10
|
-
export declare const notifyToSlack: ({ changedFiles, commits, changelog, repository, dryRun, author, }: NotifyToSlackOptions) => Promise<void>;
|
|
12
|
+
export declare const notifyToSlack: ({ changedFiles, commits, changelog, repository, dryRun, author, releaseSlackChannel, reportSlackChannel, }: NotifyToSlackOptions) => Promise<void>;
|
|
11
13
|
export declare const sendSlackMessage: (channel: string, text: string, blocks: string[], token: string) => Promise<void>;
|
|
12
14
|
export {};
|
|
13
15
|
//# sourceMappingURL=slack.d.ts.map
|
package/dist/bin/slack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,KAAK,oBAAoB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,KAAK,oBAAoB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,4GASjC,oBAAoB,kBAyCtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,SAAS,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE,OAAO,MAAM,kBAUpG,CAAC"}
|
package/dist/bin/slack.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { WebClient } from '@slack/web-api';
|
|
2
2
|
import { getEnvVar } from './utils.js';
|
|
3
|
-
export const notifyToSlack = async ({ changedFiles, commits, changelog, repository, dryRun, author, }) => {
|
|
3
|
+
export const notifyToSlack = async ({ changedFiles, commits, changelog, repository, dryRun, author, releaseSlackChannel, reportSlackChannel, }) => {
|
|
4
4
|
const slack = new WebClient(getEnvVar('SLACK_TOKEN_RELEASES_BOT'));
|
|
5
5
|
if (!changelog) {
|
|
6
6
|
console.warn('No new changelog entries found, did you forget to update it?');
|
|
7
7
|
}
|
|
8
8
|
let shortMessage = `${repository} --- New release (by ${author}):\n\n`;
|
|
9
9
|
// This one is just for broader public that only cares about public facing changes
|
|
10
|
-
if (changelog) {
|
|
11
|
-
console.error(`=========================================`);
|
|
10
|
+
if (changelog && releaseSlackChannel) {
|
|
12
11
|
shortMessage += `**Additions to the changelog**:\n\n${changelog}\n`;
|
|
13
|
-
|
|
14
|
-
console.error(`**Sending slack message to channel**: ${
|
|
12
|
+
console.error(`=========================================`);
|
|
13
|
+
console.error(`**Sending slack message to channel**: ${releaseSlackChannel}.\n\n${shortMessage}`);
|
|
15
14
|
console.error(`=========================================`);
|
|
16
15
|
if (!dryRun) {
|
|
17
16
|
await slack.chat.postMessage({
|
|
18
|
-
channel,
|
|
17
|
+
channel: releaseSlackChannel,
|
|
19
18
|
text: shortMessage,
|
|
20
19
|
});
|
|
21
20
|
}
|
|
@@ -26,15 +25,16 @@ export const notifyToSlack = async ({ changedFiles, commits, changelog, reposito
|
|
|
26
25
|
const changedFilesMessage = `**Files changed**: ${changedFiles.join(', ')}`;
|
|
27
26
|
const longMessage = `${shortMessage}\n**Commit list**:\n${commitsMessage}\n\n${changedFilesMessage}`;
|
|
28
27
|
// This one is for devs and project managers that need to know more details
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
if (reportSlackChannel) {
|
|
29
|
+
console.error(`=========================================`);
|
|
30
|
+
console.error(`Sending slack message to channel: ${reportSlackChannel}.\n\n${longMessage}`);
|
|
31
|
+
console.error(`=========================================`);
|
|
32
|
+
if (!dryRun) {
|
|
33
|
+
await slack.chat.postMessage({
|
|
34
|
+
text: longMessage,
|
|
35
|
+
channel: reportSlackChannel,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
export const sendSlackMessage = async (channel, text, blocks, token) => {
|
package/dist/bin/slack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.js","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"slack.js","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAavC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,EAChC,YAAY,EACZ,OAAO,EACP,SAAS,EACT,UAAU,EACV,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,kBAAkB,GACC,EAAE,EAAE;IACvB,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAEnE,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IACjF,CAAC;IAED,IAAI,YAAY,GAAG,GAAG,UAAU,wBAAwB,MAAM,QAAQ,CAAC;IAEvE,kFAAkF;IAClF,IAAI,SAAS,IAAI,mBAAmB,EAAE,CAAC;QACnC,YAAY,IAAI,sCAAsC,SAAS,IAAI,CAAC;QACpE,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC3D,OAAO,CAAC,KAAK,CAAC,yCAAyC,mBAAmB,QAAQ,YAAY,EAAE,CAAC,CAAC;QAClG,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,KAAK,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I,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1B,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;YACzB,OAAO;YACP,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;SACtF,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface ReportTestResultsOptions {
|
|
2
2
|
reportFile: string;
|
|
3
3
|
dryRun: boolean;
|
|
4
|
+
reportSlackChannel?: string;
|
|
4
5
|
jobUrl?: string;
|
|
5
|
-
repository?: string;
|
|
6
6
|
workflowName?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const reportTestResults: ({ dryRun, reportSlackChannel, reportFile: jsonResultsPath, jobUrl, workflowName, }: ReportTestResultsOptions) => Promise<void>;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=test-report.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-report.d.ts","sourceRoot":"","sources":["../../bin/test-report.ts"],"names":[],"mappings":"AAIA,UAAU,wBAAwB;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,
|
|
1
|
+
{"version":3,"file":"test-report.d.ts","sourceRoot":"","sources":["../../bin/test-report.ts"],"names":[],"mappings":"AAIA,UAAU,wBAAwB;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,iBAAiB,GAAU,oFAMrC,wBAAwB,kBA8E1B,CAAC"}
|
package/dist/bin/test-report.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import { sendSlackMessage } from './slack.js';
|
|
3
3
|
import { getEnvVar } from './utils.js';
|
|
4
|
-
export const
|
|
4
|
+
export const reportTestResults = async ({ dryRun, reportSlackChannel, reportFile: jsonResultsPath, jobUrl, workflowName, }) => {
|
|
5
5
|
const results = JSON.parse((await fs.readFile(jsonResultsPath)).toString());
|
|
6
6
|
const passed = [];
|
|
7
7
|
const failed = [];
|
|
@@ -47,28 +47,28 @@ export const reportTestRestuls = async ({ dryRun, reportFile: jsonResultsPath, j
|
|
|
47
47
|
console.error();
|
|
48
48
|
console.error(`PASSED: ${passed.length}, FAILED: ${failed.length}`);
|
|
49
49
|
console.error();
|
|
50
|
+
if (!reportSlackChannel) {
|
|
51
|
+
console.error(`Skipping slack notification. If you want to enable it, add --report-slack-channel flag and make sure SLACK_TOKEN_TESTS_BOT env variable is set.`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
50
54
|
if (failedAssertions.length === 0) {
|
|
51
55
|
return;
|
|
52
56
|
}
|
|
53
57
|
// TODO: add slack profiles
|
|
54
58
|
const total = failed.length + passed.length;
|
|
55
59
|
const jobLink = jobUrl ? ` Check <${jobUrl}|the job>.` : '';
|
|
56
|
-
let slackMessage = `\`${workflowName ?? '-'}
|
|
60
|
+
let slackMessage = `\`${workflowName ?? '-'}\``;
|
|
57
61
|
slackMessage += `: has ${failedAssertions.length} failed assertions. Failing test suites: ${failed.length}/${total}.${jobLink}`;
|
|
58
62
|
slackMessage += `\n\n${failedAssertions[0].message} --- <${failedAssertions[0].runLink}|${failedAssertions[0].actorName}>`;
|
|
59
63
|
const blocks = failedAssertions.slice(1).map(({ message, runLink, actorName }) => `• ${message} --- <${runLink}|${actorName}>`);
|
|
60
|
-
if (!repository) {
|
|
61
|
-
console.error(`Repository not provided, not sending slack notification`);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
// remove repository-owner part
|
|
65
|
-
const channel = `#notif-${repository.replace(/[^/]+\//, '')}`;
|
|
66
|
-
console.error(`Sending a notification to slack channel ${channel}`);
|
|
67
64
|
console.error('SLACK:', slackMessage);
|
|
68
65
|
console.error('\tblocks:', blocks.join('\n\t\t'));
|
|
66
|
+
if (!reportSlackChannel) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
69
|
if (!dryRun) {
|
|
70
70
|
const slackToken = getEnvVar('SLACK_TOKEN_TESTS_BOT');
|
|
71
|
-
await sendSlackMessage(
|
|
71
|
+
await sendSlackMessage(reportSlackChannel, slackMessage, blocks, slackToken);
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
//# sourceMappingURL=test-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-report.js","sourceRoot":"","sources":["../../bin/test-report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAUvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACpC,MAAM,EACN,UAAU,EAAE,eAAe,EAC3B,MAAM,EACN,YAAY,
|
|
1
|
+
{"version":3,"file":"test-report.js","sourceRoot":"","sources":["../../bin/test-report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAUvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACpC,MAAM,EACN,kBAAkB,EAClB,UAAU,EAAE,eAAe,EAC3B,MAAM,EACN,YAAY,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