@testomatio/reporter 2.7.3-beta.3.allure → 2.7.3
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/README.md +2 -4
- package/lib/bin/cli.js +0 -28
- package/lib/junit-adapter/index.js +0 -4
- package/lib/pipe/html.js +6 -2
- package/lib/utils/utils.js +0 -9
- package/package.json +1 -1
- package/src/bin/cli.js +0 -35
- package/src/junit-adapter/index.js +0 -4
- package/src/pipe/html.js +4 -2
- package/src/utils/utils.js +0 -5
- package/lib/allureReader.d.ts +0 -65
- package/lib/allureReader.js +0 -456
- package/lib/junit-adapter/kotlin.d.ts +0 -5
- package/lib/junit-adapter/kotlin.js +0 -46
- package/src/allureReader.js +0 -532
- package/src/junit-adapter/kotlin.js +0 -48
package/README.md
CHANGED
|
@@ -69,7 +69,6 @@ yarn add @testomatio/reporter --dev
|
|
|
69
69
|
| [TestCafe](./docs/frameworks.md#testcafe) | [Detox](./docs/frameworks.md#detox) | [Codeception](https://github.com/testomatio/php-reporter) |
|
|
70
70
|
| [Newman (Postman)](./docs/frameworks.md#newman) | [JUnit](./docs/junit.md#junit) | [NUnit](./docs/junit.md#nunit) |
|
|
71
71
|
| [PyTest](./docs/junit.md#pytest) | [PHPUnit](./docs/junit.md#phpunit) | [Protractor](./docs/frameworks.md#protractor) |
|
|
72
|
-
| [Allure](./docs/allure.md) | | |
|
|
73
72
|
|
|
74
73
|
or **any [other via JUnit](./docs/junit.md)** report....
|
|
75
74
|
|
|
@@ -130,10 +129,9 @@ Bring this reporter on CI and never lose test results again!
|
|
|
130
129
|
- [CSV](./docs/pipes/csv.md)
|
|
131
130
|
- [HTML report](./docs/pipes/html.md)
|
|
132
131
|
- [Bitbucket](./docs/pipes/bitbucket.md)
|
|
133
|
-
- 📓 [JUnit Reports](./docs/junit.md)
|
|
134
|
-
- 🗄️ [Artifacts](./docs/artifacts.md)
|
|
135
|
-
- 🔬 [Allure Reports](./docs/allure.md)
|
|
136
132
|
- 🔗 [Linking Tests](./docs/linking-tests.md)
|
|
133
|
+
- 📓 [JUnit](./docs/junit.md)
|
|
134
|
+
- 🗄️ [Artifacts](./docs/artifacts.md)
|
|
137
135
|
- 🔂 [Workflows](./docs/workflows.md)
|
|
138
136
|
- 🖊️ [Logger](./docs/logger.md)
|
|
139
137
|
- 🪲 [Debug File Format](./docs/debug-file-format.md)
|
package/lib/bin/cli.js
CHANGED
|
@@ -10,7 +10,6 @@ const glob_1 = require("glob");
|
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const client_js_1 = __importDefault(require("../client.js"));
|
|
12
12
|
const xmlReader_js_1 = __importDefault(require("../xmlReader.js"));
|
|
13
|
-
const allureReader_js_1 = __importDefault(require("../allureReader.js"));
|
|
14
13
|
const constants_js_1 = require("../constants.js");
|
|
15
14
|
const utils_js_1 = require("../utils/utils.js");
|
|
16
15
|
const config_js_1 = require("../config.js");
|
|
@@ -238,33 +237,6 @@ program
|
|
|
238
237
|
if (timeoutTimer)
|
|
239
238
|
clearTimeout(timeoutTimer);
|
|
240
239
|
});
|
|
241
|
-
program
|
|
242
|
-
.command('allure')
|
|
243
|
-
.description('Parse Allure result files and upload to Testomat.io')
|
|
244
|
-
.argument('<pattern>', 'Allure result directory pattern')
|
|
245
|
-
.option('-d, --dir <dir>', 'Project directory')
|
|
246
|
-
.option('--timelimit <time>', 'default time limit in seconds to kill a stuck process')
|
|
247
|
-
.option('--with-package', 'Keep full package path in file names (default: strip package prefix)')
|
|
248
|
-
.action(async (pattern, opts) => {
|
|
249
|
-
const runReader = new allureReader_js_1.default({ withPackage: opts.withPackage });
|
|
250
|
-
let timeoutTimer;
|
|
251
|
-
if (opts.timelimit) {
|
|
252
|
-
timeoutTimer = setTimeout(() => {
|
|
253
|
-
console.log(`⚠️ Reached timeout of ${opts.timelimit}s. Exiting... (Exit code is 0 to not fail the pipeline)`);
|
|
254
|
-
process.exit(0);
|
|
255
|
-
}, parseInt(opts.timelimit, 10) * 1000);
|
|
256
|
-
}
|
|
257
|
-
try {
|
|
258
|
-
await runReader.parse(pattern);
|
|
259
|
-
await runReader.createRun();
|
|
260
|
-
await runReader.uploadData();
|
|
261
|
-
}
|
|
262
|
-
catch (err) {
|
|
263
|
-
console.log(constants_js_1.APP_PREFIX, 'Error uploading Allure results:', err);
|
|
264
|
-
}
|
|
265
|
-
if (timeoutTimer)
|
|
266
|
-
clearTimeout(timeoutTimer);
|
|
267
|
-
});
|
|
268
240
|
program
|
|
269
241
|
.command('upload-artifacts')
|
|
270
242
|
.description('Upload artifacts to Testomat.io')
|
|
@@ -9,7 +9,6 @@ const java_js_1 = __importDefault(require("./java.js"));
|
|
|
9
9
|
const python_js_1 = __importDefault(require("./python.js"));
|
|
10
10
|
const ruby_js_1 = __importDefault(require("./ruby.js"));
|
|
11
11
|
const csharp_js_1 = __importDefault(require("./csharp.js"));
|
|
12
|
-
const kotlin_js_1 = __importDefault(require("./kotlin.js"));
|
|
13
12
|
function AdapterFactory(lang, opts) {
|
|
14
13
|
if (lang === 'java') {
|
|
15
14
|
return new java_js_1.default(opts);
|
|
@@ -26,9 +25,6 @@ function AdapterFactory(lang, opts) {
|
|
|
26
25
|
if (lang === 'c#' || lang === 'csharp') {
|
|
27
26
|
return new csharp_js_1.default(opts);
|
|
28
27
|
}
|
|
29
|
-
if (lang === 'kotlin') {
|
|
30
|
-
return new kotlin_js_1.default(opts);
|
|
31
|
-
}
|
|
32
28
|
return new adapter_js_1.default(opts);
|
|
33
29
|
}
|
|
34
30
|
module.exports = AdapterFactory;
|
package/lib/pipe/html.js
CHANGED
|
@@ -180,8 +180,12 @@ class HtmlPipe {
|
|
|
180
180
|
...(test.meta?.attachments || []),
|
|
181
181
|
];
|
|
182
182
|
test.artifactsUploaded = allPossibleArtifacts.some(artifact => {
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
let link = artifact?.link || artifact?.path;
|
|
184
|
+
if (!link)
|
|
185
|
+
return false;
|
|
186
|
+
if (typeof link !== 'string')
|
|
187
|
+
link = String(link);
|
|
188
|
+
return link.startsWith('http://') || link.startsWith('https://');
|
|
185
189
|
});
|
|
186
190
|
normalizeRetries(test);
|
|
187
191
|
if (test.traces) {
|
package/lib/utils/utils.js
CHANGED
|
@@ -324,15 +324,6 @@ const fetchSourceCode = (contents, opts = {}) => {
|
|
|
324
324
|
if (lineIndex === -1)
|
|
325
325
|
lineIndex = lines.findIndex(l => l.includes(`${title}(`));
|
|
326
326
|
}
|
|
327
|
-
else if (opts.lang === 'kotlin') {
|
|
328
|
-
lineIndex = lines.findIndex(l => l.includes(`fun test${title}`));
|
|
329
|
-
if (lineIndex === -1)
|
|
330
|
-
lineIndex = lines.findIndex(l => l.includes(`@DisplayName("${title}`));
|
|
331
|
-
if (lineIndex === -1)
|
|
332
|
-
lineIndex = lines.findIndex(l => l.includes(`fun ${title}`));
|
|
333
|
-
if (lineIndex === -1)
|
|
334
|
-
lineIndex = lines.findIndex(l => l.includes(`${title}(`));
|
|
335
|
-
}
|
|
336
327
|
else if (opts.lang === 'csharp') {
|
|
337
328
|
// Find the method declaration line
|
|
338
329
|
let methodLineIndex = lines.findIndex(l => l.includes(`public void ${title}(`));
|
package/package.json
CHANGED
package/src/bin/cli.js
CHANGED
|
@@ -6,7 +6,6 @@ import { glob } from 'glob';
|
|
|
6
6
|
import createDebugMessages from 'debug';
|
|
7
7
|
import TestomatClient from '../client.js';
|
|
8
8
|
import XmlReader from '../xmlReader.js';
|
|
9
|
-
import AllureReader from '../allureReader.js';
|
|
10
9
|
import { APP_PREFIX, STATUS } from '../constants.js';
|
|
11
10
|
import { cleanLatestRunId, getPackageVersion, applyFilter } from '../utils/utils.js';
|
|
12
11
|
import { config } from '../config.js';
|
|
@@ -265,40 +264,6 @@ program
|
|
|
265
264
|
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
266
265
|
});
|
|
267
266
|
|
|
268
|
-
program
|
|
269
|
-
.command('allure')
|
|
270
|
-
.description('Parse Allure result files and upload to Testomat.io')
|
|
271
|
-
.argument('<pattern>', 'Allure result directory pattern')
|
|
272
|
-
.option('-d, --dir <dir>', 'Project directory')
|
|
273
|
-
.option('--timelimit <time>', 'default time limit in seconds to kill a stuck process')
|
|
274
|
-
.option('--with-package', 'Keep full package path in file names (default: strip package prefix)')
|
|
275
|
-
.action(async (pattern, opts) => {
|
|
276
|
-
const runReader = new AllureReader({ withPackage: opts.withPackage });
|
|
277
|
-
|
|
278
|
-
let timeoutTimer;
|
|
279
|
-
if (opts.timelimit) {
|
|
280
|
-
timeoutTimer = setTimeout(
|
|
281
|
-
() => {
|
|
282
|
-
console.log(
|
|
283
|
-
`⚠️ Reached timeout of ${opts.timelimit}s. Exiting... (Exit code is 0 to not fail the pipeline)`,
|
|
284
|
-
);
|
|
285
|
-
process.exit(0);
|
|
286
|
-
},
|
|
287
|
-
parseInt(opts.timelimit, 10) * 1000,
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
try {
|
|
292
|
-
await runReader.parse(pattern);
|
|
293
|
-
await runReader.createRun();
|
|
294
|
-
await runReader.uploadData();
|
|
295
|
-
} catch (err) {
|
|
296
|
-
console.log(APP_PREFIX, 'Error uploading Allure results:', err);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
300
|
-
});
|
|
301
|
-
|
|
302
267
|
program
|
|
303
268
|
.command('upload-artifacts')
|
|
304
269
|
.description('Upload artifacts to Testomat.io')
|
|
@@ -4,7 +4,6 @@ import JavaAdapter from './java.js';
|
|
|
4
4
|
import PythonAdapter from './python.js';
|
|
5
5
|
import RubyAdapter from './ruby.js';
|
|
6
6
|
import CSharpAdapter from './csharp.js';
|
|
7
|
-
import KotlinAdapter from './kotlin.js';
|
|
8
7
|
|
|
9
8
|
function AdapterFactory(lang, opts) {
|
|
10
9
|
if (lang === 'java') {
|
|
@@ -22,9 +21,6 @@ function AdapterFactory(lang, opts) {
|
|
|
22
21
|
if (lang === 'c#' || lang === 'csharp') {
|
|
23
22
|
return new CSharpAdapter(opts);
|
|
24
23
|
}
|
|
25
|
-
if (lang === 'kotlin') {
|
|
26
|
-
return new KotlinAdapter(opts);
|
|
27
|
-
}
|
|
28
24
|
|
|
29
25
|
return new Adapter(opts);
|
|
30
26
|
}
|
package/src/pipe/html.js
CHANGED
|
@@ -230,8 +230,10 @@ class HtmlPipe {
|
|
|
230
230
|
];
|
|
231
231
|
|
|
232
232
|
test.artifactsUploaded = allPossibleArtifacts.some(artifact => {
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
let link = artifact?.link || artifact?.path;
|
|
234
|
+
if (!link) return false;
|
|
235
|
+
if (typeof link !== 'string') link = String(link);
|
|
236
|
+
return link.startsWith('http://') || link.startsWith('https://');
|
|
235
237
|
});
|
|
236
238
|
|
|
237
239
|
normalizeRetries(test);
|
package/src/utils/utils.js
CHANGED
|
@@ -289,11 +289,6 @@ const fetchSourceCode = (contents, opts = {}) => {
|
|
|
289
289
|
if (lineIndex === -1) lineIndex = lines.findIndex(l => l.includes(`@DisplayName("${title}`));
|
|
290
290
|
if (lineIndex === -1) lineIndex = lines.findIndex(l => l.includes(`public void ${title}`));
|
|
291
291
|
if (lineIndex === -1) lineIndex = lines.findIndex(l => l.includes(`${title}(`));
|
|
292
|
-
} else if (opts.lang === 'kotlin') {
|
|
293
|
-
lineIndex = lines.findIndex(l => l.includes(`fun test${title}`));
|
|
294
|
-
if (lineIndex === -1) lineIndex = lines.findIndex(l => l.includes(`@DisplayName("${title}`));
|
|
295
|
-
if (lineIndex === -1) lineIndex = lines.findIndex(l => l.includes(`fun ${title}`));
|
|
296
|
-
if (lineIndex === -1) lineIndex = lines.findIndex(l => l.includes(`${title}(`));
|
|
297
292
|
} else if (opts.lang === 'csharp') {
|
|
298
293
|
// Find the method declaration line
|
|
299
294
|
let methodLineIndex = lines.findIndex(l => l.includes(`public void ${title}(`));
|
package/lib/allureReader.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export default AllureReader;
|
|
2
|
-
declare class AllureReader {
|
|
3
|
-
constructor(opts?: {});
|
|
4
|
-
requestParams: {
|
|
5
|
-
apiKey: any;
|
|
6
|
-
url: any;
|
|
7
|
-
title: string;
|
|
8
|
-
env: string;
|
|
9
|
-
group_title: string;
|
|
10
|
-
isBatchEnabled: boolean;
|
|
11
|
-
};
|
|
12
|
-
runId: any;
|
|
13
|
-
opts: {};
|
|
14
|
-
withPackage: any;
|
|
15
|
-
store: {};
|
|
16
|
-
pipesPromise: Promise<any[]>;
|
|
17
|
-
_tests: any[];
|
|
18
|
-
stats: {};
|
|
19
|
-
suites: {};
|
|
20
|
-
uploader: S3Uploader;
|
|
21
|
-
version: any;
|
|
22
|
-
set tests(value: any[]);
|
|
23
|
-
get tests(): any[];
|
|
24
|
-
createRun(): Promise<any[]>;
|
|
25
|
-
pipes: any;
|
|
26
|
-
parse(resultsPattern: any): {};
|
|
27
|
-
parseContainerFiles(containerFiles: any): void;
|
|
28
|
-
processAllureResult(result: any, resultsDir: any): {
|
|
29
|
-
rid: any;
|
|
30
|
-
title: any;
|
|
31
|
-
status: any;
|
|
32
|
-
suite_title: any;
|
|
33
|
-
file: string;
|
|
34
|
-
run_time: number;
|
|
35
|
-
steps: any;
|
|
36
|
-
message: any;
|
|
37
|
-
stack: any;
|
|
38
|
-
meta: {};
|
|
39
|
-
links: {
|
|
40
|
-
label: string;
|
|
41
|
-
}[];
|
|
42
|
-
artifacts: any[];
|
|
43
|
-
create: boolean;
|
|
44
|
-
overwrite: boolean;
|
|
45
|
-
};
|
|
46
|
-
mapStatus(status: any): any;
|
|
47
|
-
extractSuiteTitle(result: any): any;
|
|
48
|
-
stripNamespace(suiteName: any): any;
|
|
49
|
-
extractFile(result: any): string;
|
|
50
|
-
getFileExtension(result: any): any;
|
|
51
|
-
extractMeta(result: any): {};
|
|
52
|
-
extractLinks(result: any): {
|
|
53
|
-
label: string;
|
|
54
|
-
}[];
|
|
55
|
-
convertSteps(steps: any, depth?: number): any;
|
|
56
|
-
calculateRunTime(item: any): number;
|
|
57
|
-
convertParameters(parameters: any): {};
|
|
58
|
-
combineRetryAttempts(attempts: any): any;
|
|
59
|
-
calculateStats(): {};
|
|
60
|
-
fetchSourceCode(): void;
|
|
61
|
-
getLanguage(): any;
|
|
62
|
-
uploadArtifacts(): Promise<void>;
|
|
63
|
-
uploadData(): Promise<any[]>;
|
|
64
|
-
}
|
|
65
|
-
import { S3Uploader } from './uploader.js';
|