allure-report-publisher 5.0.0-alpha.0
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/LICENSE.txt +21 -0
- package/README.md +253 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +5 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/commands/upload/index.d.ts +31 -0
- package/dist/commands/upload/index.js +198 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/allure/config.d.ts +8 -0
- package/dist/lib/allure/config.js +125 -0
- package/dist/lib/allure/report-generator.d.ts +11 -0
- package/dist/lib/allure/report-generator.js +43 -0
- package/dist/lib/ci/info/base.d.ts +6 -0
- package/dist/lib/ci/info/base.js +4 -0
- package/dist/lib/ci/info/github.d.ts +9 -0
- package/dist/lib/ci/info/github.js +21 -0
- package/dist/lib/ci/info/gitlab.d.ts +17 -0
- package/dist/lib/ci/info/gitlab.js +47 -0
- package/dist/lib/uploader/base.d.ts +40 -0
- package/dist/lib/uploader/base.js +101 -0
- package/dist/lib/uploader/s3.d.ts +17 -0
- package/dist/lib/uploader/s3.js +113 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/ci.d.ts +5 -0
- package/dist/utils/ci.js +13 -0
- package/dist/utils/config.d.ts +17 -0
- package/dist/utils/config.js +43 -0
- package/dist/utils/glob.d.ts +4 -0
- package/dist/utils/glob.js +35 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.js +51 -0
- package/dist/utils/spinner.d.ts +4 -0
- package/dist/utils/spinner.js +28 -0
- package/dist/utils/uploader.d.ts +11 -0
- package/dist/utils/uploader.js +19 -0
- package/oclif.manifest.json +237 -0
- package/package.json +82 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { config } from './config.js';
|
|
4
|
+
import { logger } from './logger.js';
|
|
5
|
+
function flushDebug() {
|
|
6
|
+
if (config.debug)
|
|
7
|
+
logger.flushDebug();
|
|
8
|
+
}
|
|
9
|
+
export async function spin(action, message, options = {}) {
|
|
10
|
+
const spinner = ora(message).start();
|
|
11
|
+
try {
|
|
12
|
+
const result = await action;
|
|
13
|
+
spinner.succeed(`${message} ... ${chalk.green('done')}`);
|
|
14
|
+
flushDebug();
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (options.ignoreError) {
|
|
19
|
+
spinner.warn(`${message} ... ${chalk.yellow('failed')}`);
|
|
20
|
+
logger.warn(error.message);
|
|
21
|
+
flushDebug();
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
spinner.fail(`${message} ... ${chalk.red('failed')}`);
|
|
25
|
+
flushDebug();
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseUploader } from '../lib/uploader/base.js';
|
|
2
|
+
export declare function getUploader(type: string, opts: {
|
|
3
|
+
bucket: string;
|
|
4
|
+
copyLatest: boolean;
|
|
5
|
+
parallel: number;
|
|
6
|
+
historyPath: string;
|
|
7
|
+
output: string;
|
|
8
|
+
plugins: string[];
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
prefix?: string;
|
|
11
|
+
}): BaseUploader;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { S3Uploader } from '../lib/uploader/s3.js';
|
|
2
|
+
export function getUploader(type, opts) {
|
|
3
|
+
switch (type) {
|
|
4
|
+
case 's3': {
|
|
5
|
+
return new S3Uploader(opts);
|
|
6
|
+
}
|
|
7
|
+
// case 'gcs': {
|
|
8
|
+
// const {GCSUploader} = require('./gcs.js')
|
|
9
|
+
// return new GCSUploader(opts)
|
|
10
|
+
// }
|
|
11
|
+
// case 'gitlab-artifacts': {
|
|
12
|
+
// const {GitLabArtifactsUploader} = require('./gitlab-artifacts.js')
|
|
13
|
+
// return new GitLabArtifactsUploader(opts)
|
|
14
|
+
// }
|
|
15
|
+
default: {
|
|
16
|
+
throw new Error(`Unsupported uploader type: ${type}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"upload": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {
|
|
6
|
+
"type": {
|
|
7
|
+
"description": "Cloud storage provider type",
|
|
8
|
+
"name": "type",
|
|
9
|
+
"options": [
|
|
10
|
+
"s3",
|
|
11
|
+
"gcs",
|
|
12
|
+
"gitlab-artifacts"
|
|
13
|
+
],
|
|
14
|
+
"required": true
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"description": "Generate and upload allure report to cloud storage",
|
|
18
|
+
"examples": [
|
|
19
|
+
"<%= config.bin %> <%= command.id %> s3 --results-glob=\"path/to/allure-results\" --bucket=my-bucket",
|
|
20
|
+
"<%= config.bin %> <%= command.id %> gcs --results-glob=\"paths/to/**/allure-results\" --bucket=my-bucket --prefix=my-project/prs",
|
|
21
|
+
"<%= config.bin %> <%= command.id %> gitlab-artifacts --results-glob=\"paths/to/**/allure-results\"",
|
|
22
|
+
"<%= config.bin %> <%= command.id %> s3 --results-glob=\"path/to/allure-results\" --bucket=my-bucket --update-pr=comment --summary=behaviors"
|
|
23
|
+
],
|
|
24
|
+
"flags": {
|
|
25
|
+
"baseUrl": {
|
|
26
|
+
"aliases": [
|
|
27
|
+
"base-url"
|
|
28
|
+
],
|
|
29
|
+
"description": "Custom base URL for report links",
|
|
30
|
+
"env": "ALLURE_BASE_URL",
|
|
31
|
+
"name": "baseUrl",
|
|
32
|
+
"hasDynamicHelp": false,
|
|
33
|
+
"multiple": false,
|
|
34
|
+
"type": "option"
|
|
35
|
+
},
|
|
36
|
+
"resultsGlob": {
|
|
37
|
+
"aliases": [
|
|
38
|
+
"results-glob"
|
|
39
|
+
],
|
|
40
|
+
"char": "r",
|
|
41
|
+
"description": "Glob pattern for allure results directories",
|
|
42
|
+
"env": "ALLURE_RESULTS_GLOB",
|
|
43
|
+
"name": "resultsGlob",
|
|
44
|
+
"default": "./**/allure-results",
|
|
45
|
+
"hasDynamicHelp": false,
|
|
46
|
+
"multiple": false,
|
|
47
|
+
"type": "option"
|
|
48
|
+
},
|
|
49
|
+
"bucket": {
|
|
50
|
+
"char": "b",
|
|
51
|
+
"description": "Cloud storage bucket name (required for s3/gcs)",
|
|
52
|
+
"env": "ALLURE_BUCKET",
|
|
53
|
+
"name": "bucket",
|
|
54
|
+
"hasDynamicHelp": false,
|
|
55
|
+
"multiple": false,
|
|
56
|
+
"type": "option"
|
|
57
|
+
},
|
|
58
|
+
"prefix": {
|
|
59
|
+
"char": "p",
|
|
60
|
+
"description": "Prefix for report path in cloud storage (ignored for gitlab-artifacts)",
|
|
61
|
+
"env": "ALLURE_PREFIX",
|
|
62
|
+
"name": "prefix",
|
|
63
|
+
"hasDynamicHelp": false,
|
|
64
|
+
"multiple": false,
|
|
65
|
+
"type": "option"
|
|
66
|
+
},
|
|
67
|
+
"config": {
|
|
68
|
+
"char": "c",
|
|
69
|
+
"description": "The path to allure config file (only .json or .yaml are supported)",
|
|
70
|
+
"env": "ALLURE_CONFIG_PATH",
|
|
71
|
+
"name": "config",
|
|
72
|
+
"hasDynamicHelp": false,
|
|
73
|
+
"multiple": false,
|
|
74
|
+
"type": "option"
|
|
75
|
+
},
|
|
76
|
+
"reportName": {
|
|
77
|
+
"aliases": [
|
|
78
|
+
"report-name"
|
|
79
|
+
],
|
|
80
|
+
"description": "Custom report name in Allure report (ignored with config-path)",
|
|
81
|
+
"env": "ALLURE_REPORT_NAME",
|
|
82
|
+
"name": "reportName",
|
|
83
|
+
"hasDynamicHelp": false,
|
|
84
|
+
"multiple": false,
|
|
85
|
+
"type": "option"
|
|
86
|
+
},
|
|
87
|
+
"ciReportTitle": {
|
|
88
|
+
"aliases": [
|
|
89
|
+
"ci-report-title"
|
|
90
|
+
],
|
|
91
|
+
"description": "Title for PR comment/description section",
|
|
92
|
+
"env": "ALLURE_CI_REPORT_TITLE",
|
|
93
|
+
"name": "ciReportTitle",
|
|
94
|
+
"default": "Allure Report",
|
|
95
|
+
"hasDynamicHelp": false,
|
|
96
|
+
"multiple": false,
|
|
97
|
+
"type": "option"
|
|
98
|
+
},
|
|
99
|
+
"summary": {
|
|
100
|
+
"description": "Add test summary table to PR",
|
|
101
|
+
"env": "ALLURE_SUMMARY",
|
|
102
|
+
"name": "summary",
|
|
103
|
+
"default": "total",
|
|
104
|
+
"hasDynamicHelp": false,
|
|
105
|
+
"multiple": false,
|
|
106
|
+
"options": [
|
|
107
|
+
"behaviors",
|
|
108
|
+
"suites",
|
|
109
|
+
"packages",
|
|
110
|
+
"total"
|
|
111
|
+
],
|
|
112
|
+
"type": "option"
|
|
113
|
+
},
|
|
114
|
+
"summaryTableType": {
|
|
115
|
+
"aliases": [
|
|
116
|
+
"summary-table-type"
|
|
117
|
+
],
|
|
118
|
+
"description": "Summary table format",
|
|
119
|
+
"env": "ALLURE_SUMMARY_TABLE_TYPE",
|
|
120
|
+
"name": "summaryTableType",
|
|
121
|
+
"default": "ascii",
|
|
122
|
+
"hasDynamicHelp": false,
|
|
123
|
+
"multiple": false,
|
|
124
|
+
"options": [
|
|
125
|
+
"ascii",
|
|
126
|
+
"markdown"
|
|
127
|
+
],
|
|
128
|
+
"type": "option"
|
|
129
|
+
},
|
|
130
|
+
"updatePr": {
|
|
131
|
+
"aliases": [
|
|
132
|
+
"update-pr"
|
|
133
|
+
],
|
|
134
|
+
"description": "Update PR with report URL (comment/description/actions)",
|
|
135
|
+
"env": "ALLURE_UPDATE_PR",
|
|
136
|
+
"name": "updatePr",
|
|
137
|
+
"hasDynamicHelp": false,
|
|
138
|
+
"multiple": false,
|
|
139
|
+
"options": [
|
|
140
|
+
"comment",
|
|
141
|
+
"description",
|
|
142
|
+
"actions"
|
|
143
|
+
],
|
|
144
|
+
"type": "option"
|
|
145
|
+
},
|
|
146
|
+
"collapseSummary": {
|
|
147
|
+
"aliases": [
|
|
148
|
+
"collapse-summary"
|
|
149
|
+
],
|
|
150
|
+
"description": "Create collapsible summary section in PR",
|
|
151
|
+
"env": "ALLURE_COLLAPSE_SUMMARY",
|
|
152
|
+
"name": "collapseSummary",
|
|
153
|
+
"allowNo": false,
|
|
154
|
+
"type": "boolean"
|
|
155
|
+
},
|
|
156
|
+
"color": {
|
|
157
|
+
"description": "Force color output",
|
|
158
|
+
"env": "ALLURE_COLOR",
|
|
159
|
+
"name": "color",
|
|
160
|
+
"allowNo": true,
|
|
161
|
+
"type": "boolean"
|
|
162
|
+
},
|
|
163
|
+
"copyLatest": {
|
|
164
|
+
"aliases": [
|
|
165
|
+
"copy-latest"
|
|
166
|
+
],
|
|
167
|
+
"description": "Keep copy of latest run report at base prefix (ignored for gitlab-artifacts)",
|
|
168
|
+
"env": "ALLURE_COPY_LATEST",
|
|
169
|
+
"name": "copyLatest",
|
|
170
|
+
"allowNo": false,
|
|
171
|
+
"type": "boolean"
|
|
172
|
+
},
|
|
173
|
+
"debug": {
|
|
174
|
+
"description": "Print debug log output",
|
|
175
|
+
"env": "ALLURE_DEBUG",
|
|
176
|
+
"name": "debug",
|
|
177
|
+
"allowNo": false,
|
|
178
|
+
"type": "boolean"
|
|
179
|
+
},
|
|
180
|
+
"flakyWarningStatus": {
|
|
181
|
+
"aliases": [
|
|
182
|
+
"flaky-warning-status"
|
|
183
|
+
],
|
|
184
|
+
"description": "Mark run with ! status if flaky tests found",
|
|
185
|
+
"env": "ALLURE_FLAKY_WARNING_STATUS",
|
|
186
|
+
"name": "flakyWarningStatus",
|
|
187
|
+
"allowNo": false,
|
|
188
|
+
"type": "boolean"
|
|
189
|
+
},
|
|
190
|
+
"ignoreMissingResults": {
|
|
191
|
+
"aliases": [
|
|
192
|
+
"ignore-missing-results"
|
|
193
|
+
],
|
|
194
|
+
"description": "Ignore missing allure results",
|
|
195
|
+
"env": "ALLURE_IGNORE_MISSING_RESULTS",
|
|
196
|
+
"name": "ignoreMissingResults",
|
|
197
|
+
"allowNo": false,
|
|
198
|
+
"type": "boolean"
|
|
199
|
+
},
|
|
200
|
+
"output": {
|
|
201
|
+
"char": "o",
|
|
202
|
+
"description": "Output directory for generated report (default: temp dir for cloud, \"allure-report\" for gitlab-artifacts)",
|
|
203
|
+
"env": "ALLURE_OUTPUT",
|
|
204
|
+
"name": "output",
|
|
205
|
+
"hasDynamicHelp": false,
|
|
206
|
+
"multiple": false,
|
|
207
|
+
"type": "option"
|
|
208
|
+
},
|
|
209
|
+
"parallel": {
|
|
210
|
+
"description": "Number of parallel threads for upload",
|
|
211
|
+
"env": "ALLURE_PARALLEL",
|
|
212
|
+
"name": "parallel",
|
|
213
|
+
"default": 8,
|
|
214
|
+
"hasDynamicHelp": false,
|
|
215
|
+
"multiple": false,
|
|
216
|
+
"type": "option"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"hasDynamicHelp": false,
|
|
220
|
+
"hiddenAliases": [],
|
|
221
|
+
"id": "upload",
|
|
222
|
+
"pluginAlias": "allure-report-publisher",
|
|
223
|
+
"pluginName": "allure-report-publisher",
|
|
224
|
+
"pluginType": "core",
|
|
225
|
+
"strict": true,
|
|
226
|
+
"enableJsonFlag": false,
|
|
227
|
+
"isESM": true,
|
|
228
|
+
"relativePath": [
|
|
229
|
+
"dist",
|
|
230
|
+
"commands",
|
|
231
|
+
"upload",
|
|
232
|
+
"index.js"
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"version": "5.0.0-alpha.0"
|
|
237
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "allure-report-publisher",
|
|
3
|
+
"description": "Publish allure 3 reports to cloud storage providers",
|
|
4
|
+
"version": "5.0.0-alpha.0",
|
|
5
|
+
"author": "Andrejs Cunskis",
|
|
6
|
+
"bin": {
|
|
7
|
+
"allure-report-publisher": "bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"bugs": "https://github.com/andrcuns/allure-report-publisher/issues",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@aws-sdk/client-s3": "^3.0.0",
|
|
12
|
+
"@gitbeaker/rest": "^43.8.0",
|
|
13
|
+
"@oclif/core": "^4",
|
|
14
|
+
"allure": "^3.0.0",
|
|
15
|
+
"chalk": "^5.0.0",
|
|
16
|
+
"cli-table3": "^0.6.0",
|
|
17
|
+
"glob": "^13.0.0",
|
|
18
|
+
"mime-types": "^3.0.0",
|
|
19
|
+
"nano-spawn": "^2.0.0",
|
|
20
|
+
"ora": "^9.0.0",
|
|
21
|
+
"p-all": "^5.0.1",
|
|
22
|
+
"yaml": "^2.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@eslint/compat": "^2.0.0",
|
|
26
|
+
"@oclif/prettier-config": "^0.2.1",
|
|
27
|
+
"@oclif/test": "^4.1.15",
|
|
28
|
+
"@types/chai": "^5.2.3",
|
|
29
|
+
"@types/mime-types": "^3.0.1",
|
|
30
|
+
"@types/mocha": "^10.0.10",
|
|
31
|
+
"@types/node": "^25.0.3",
|
|
32
|
+
"allure-mocha": "^3.4.3",
|
|
33
|
+
"chai": "^6.2.2",
|
|
34
|
+
"eslint": "^9.39.2",
|
|
35
|
+
"eslint-config-oclif": "^6.0.128",
|
|
36
|
+
"eslint-config-prettier": "^10.1.8",
|
|
37
|
+
"mocha": "^11.7.5",
|
|
38
|
+
"oclif": "^4.22.61",
|
|
39
|
+
"shx": "^0.4.0",
|
|
40
|
+
"tsx": "^4.21.0",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22.0.0"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"./bin",
|
|
48
|
+
"./dist",
|
|
49
|
+
"./oclif.manifest.json"
|
|
50
|
+
],
|
|
51
|
+
"homepage": "https://github.com/andrcuns/allure-report-publisher",
|
|
52
|
+
"keywords": [
|
|
53
|
+
"oclif",
|
|
54
|
+
"allure",
|
|
55
|
+
"test-report"
|
|
56
|
+
],
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"main": "dist/index.js",
|
|
59
|
+
"type": "module",
|
|
60
|
+
"oclif": {
|
|
61
|
+
"bin": "allure-report-publisher",
|
|
62
|
+
"dirname": "allure-report-publisher",
|
|
63
|
+
"commands": "./dist/commands",
|
|
64
|
+
"plugins": [],
|
|
65
|
+
"topicSeparator": " ",
|
|
66
|
+
"topics": {}
|
|
67
|
+
},
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "git+https://github.com/andrcuns/allure-report-publisher.git"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
74
|
+
"cleanBuild": "shx rm -rf dist && shx rm -f tsconfig.tsbuildinfo && tsc -b",
|
|
75
|
+
"lint": "eslint",
|
|
76
|
+
"prepack": "oclif manifest && oclif readme",
|
|
77
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
78
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
79
|
+
"version": "oclif readme && git add README.md"
|
|
80
|
+
},
|
|
81
|
+
"types": "dist/index.d.ts"
|
|
82
|
+
}
|