allure 3.0.0-beta.3 → 3.0.0-beta.5
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/dist/commands/awesome.d.ts +1 -0
- package/dist/commands/awesome.js +13 -2
- package/dist/commands/classic.js +1 -0
- package/dist/commands/csv.js +1 -0
- package/dist/commands/generate.js +2 -2
- package/dist/commands/knownIssue.js +7 -3
- package/dist/commands/log.js +1 -0
- package/dist/commands/open.d.ts +1 -0
- package/dist/commands/open.js +9 -3
- package/dist/commands/qualityGate.d.ts +1 -0
- package/dist/commands/qualityGate.js +11 -5
- package/dist/commands/run.js +2 -2
- package/dist/commands/slack.js +1 -0
- package/dist/commands/testplan.js +1 -0
- package/dist/commands/watch.js +3 -3
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -3
- package/dist/utils/commands.d.ts +1 -1
- package/dist/utils/commands.js +4 -2
- package/dist/utils/process.d.ts +1 -1
- package/dist/utils/terminal.d.ts +1 -1
- package/package.json +13 -10
|
@@ -6,6 +6,7 @@ type AwesomeCommandOptions = {
|
|
|
6
6
|
singleFile?: boolean;
|
|
7
7
|
historyPath?: string;
|
|
8
8
|
knownIssues?: string;
|
|
9
|
+
groupBy?: string;
|
|
9
10
|
};
|
|
10
11
|
export declare const AwesomeCommandAction: (resultsDir: string, options: AwesomeCommandOptions) => Promise<void>;
|
|
11
12
|
export declare const AwesomeCommand: (cli: import("cac").CAC) => void;
|
package/dist/commands/awesome.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AllureReport, resolveConfig } from "@allurereport/core";
|
|
2
|
+
import * as console from "node:console";
|
|
2
3
|
import { createCommand } from "../utils/commands.js";
|
|
3
4
|
export const AwesomeCommandAction = async (resultsDir, options) => {
|
|
4
5
|
const before = new Date().getTime();
|
|
5
|
-
const { output, reportName: name, historyPath, knownIssues: knownIssuesPath, ...rest } = options;
|
|
6
|
+
const { output, reportName: name, historyPath, knownIssues: knownIssuesPath, groupBy, ...rest } = options;
|
|
6
7
|
const config = await resolveConfig({
|
|
7
8
|
output,
|
|
8
9
|
name,
|
|
@@ -10,7 +11,10 @@ export const AwesomeCommandAction = async (resultsDir, options) => {
|
|
|
10
11
|
knownIssuesPath,
|
|
11
12
|
plugins: {
|
|
12
13
|
"@allurereport/plugin-awesome": {
|
|
13
|
-
options:
|
|
14
|
+
options: {
|
|
15
|
+
...rest,
|
|
16
|
+
groupBy: groupBy?.split(","),
|
|
17
|
+
},
|
|
14
18
|
},
|
|
15
19
|
},
|
|
16
20
|
});
|
|
@@ -76,6 +80,13 @@ export const AwesomeCommand = createCommand({
|
|
|
76
80
|
description: "Path to the known issues file. Updates the file and quarantines failed tests when specified",
|
|
77
81
|
},
|
|
78
82
|
],
|
|
83
|
+
[
|
|
84
|
+
"--group-by, -g <string>",
|
|
85
|
+
{
|
|
86
|
+
description: "Group test results by labels. The labels should be separated by commas",
|
|
87
|
+
default: "parentSuite,suite,subSuite",
|
|
88
|
+
}
|
|
89
|
+
]
|
|
79
90
|
],
|
|
80
91
|
action: AwesomeCommandAction,
|
|
81
92
|
});
|
package/dist/commands/classic.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AllureReport, resolveConfig } from "@allurereport/core";
|
|
2
|
+
import * as console from "node:console";
|
|
2
3
|
import { createCommand } from "../utils/commands.js";
|
|
3
4
|
export const ClassicCommandAction = async (resultsDir, options) => {
|
|
4
5
|
const before = new Date().getTime();
|
package/dist/commands/csv.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AllureReport,
|
|
1
|
+
import { AllureReport, readConfig } from "@allurereport/core";
|
|
2
2
|
import { createCommand } from "../utils/commands.js";
|
|
3
3
|
export const GenerateCommandAction = async (resultsDir, options) => {
|
|
4
4
|
const { config: configPath, output, cwd, reportName } = options;
|
|
5
|
-
const config = await
|
|
5
|
+
const config = await readConfig(cwd, configPath, { name: reportName, output });
|
|
6
6
|
const allureReport = new AllureReport(config);
|
|
7
7
|
await allureReport.start();
|
|
8
8
|
await allureReport.readDirectory(resultsDir);
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { AllureReport,
|
|
1
|
+
import { AllureReport, resolveConfig, writeKnownIssues } from "@allurereport/core";
|
|
2
2
|
import console from "node:console";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { createCommand } from "../utils/commands.js";
|
|
5
5
|
export const KnownIssueCommandAction = async (resultsDir, options) => {
|
|
6
6
|
const { output = "known-issues.json" } = options;
|
|
7
|
-
const config = await
|
|
7
|
+
const config = await resolveConfig({
|
|
8
|
+
plugins: {},
|
|
9
|
+
});
|
|
8
10
|
const allureReport = new AllureReport(config);
|
|
9
|
-
|
|
11
|
+
await allureReport.start();
|
|
10
12
|
await allureReport.readDirectory(resultsDir);
|
|
13
|
+
await allureReport.done();
|
|
14
|
+
const targetPath = resolve(output);
|
|
11
15
|
await writeKnownIssues(allureReport.store, output);
|
|
12
16
|
console.log(`writing known-issues.json to ${targetPath}`);
|
|
13
17
|
};
|
package/dist/commands/log.js
CHANGED
package/dist/commands/open.d.ts
CHANGED
package/dist/commands/open.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readConfig } from "@allurereport/core";
|
|
2
2
|
import { serve } from "@allurereport/static-server";
|
|
3
3
|
import { createCommand } from "../utils/commands.js";
|
|
4
4
|
export const OpenCommandAction = async (reportDir, options) => {
|
|
5
|
-
const { config: configPath, port, live } = options;
|
|
6
|
-
const config = await
|
|
5
|
+
const { config: configPath, port, live, cwd } = options;
|
|
6
|
+
const config = await readConfig(cwd, configPath, { output: reportDir });
|
|
7
7
|
await serve({
|
|
8
8
|
port: port,
|
|
9
9
|
servePath: config.output,
|
|
@@ -34,6 +34,12 @@ export const OpenCommand = createCommand({
|
|
|
34
34
|
default: false,
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
|
+
[
|
|
38
|
+
"--cwd <cwd>",
|
|
39
|
+
{
|
|
40
|
+
description: "The working directory for the command to run (default: current working directory)",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
37
43
|
],
|
|
38
44
|
action: OpenCommandAction,
|
|
39
45
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AllureReport,
|
|
1
|
+
import { AllureReport, readConfig } from "@allurereport/core";
|
|
2
2
|
import console from "node:console";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { bold, red } from "yoctocolors";
|
|
5
5
|
import { createCommand } from "../utils/commands.js";
|
|
6
6
|
export const QualityGateCommandAction = async (resultsDir, options) => {
|
|
7
|
-
const cwd = options
|
|
8
|
-
const fullConfig = await
|
|
7
|
+
const { cwd, config: configPath } = options;
|
|
8
|
+
const fullConfig = await readConfig(cwd, configPath);
|
|
9
9
|
const allureReport = new AllureReport(fullConfig);
|
|
10
10
|
await allureReport.start();
|
|
11
11
|
await allureReport.readDirectory(resultsDir);
|
|
@@ -28,17 +28,23 @@ export const QualityGateCommandAction = async (resultsDir, options) => {
|
|
|
28
28
|
}
|
|
29
29
|
console.error(red(`⨯ ${bold(`${result.rule}${scope}`)}: expected ${result.expected}, actual ${result.actual}`));
|
|
30
30
|
}
|
|
31
|
-
console.error(red(
|
|
31
|
+
console.error(red("\nThe process has been exited with code 1"));
|
|
32
32
|
process.exit(allureReport.exitCode);
|
|
33
33
|
};
|
|
34
34
|
export const QualityGateCommand = createCommand({
|
|
35
35
|
name: "quality-gate <resultsDir>",
|
|
36
36
|
description: "Returns status code 1 if there any test failure above specified success rate",
|
|
37
37
|
options: [
|
|
38
|
+
[
|
|
39
|
+
"--config, -c <file>",
|
|
40
|
+
{
|
|
41
|
+
description: "The path Allure config file",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
38
44
|
[
|
|
39
45
|
"--cwd <cwd>",
|
|
40
46
|
{
|
|
41
|
-
description: "The working directory for the command to run (
|
|
47
|
+
description: "The working directory for the command to run (Default: current working directory)",
|
|
42
48
|
},
|
|
43
49
|
],
|
|
44
50
|
],
|
package/dist/commands/run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllureReport, isFileNotFoundError,
|
|
1
|
+
import { AllureReport, isFileNotFoundError, readConfig } from "@allurereport/core";
|
|
2
2
|
import { createTestPlan } from "@allurereport/core-api";
|
|
3
3
|
import { allureResultsDirectoriesWatcher, delayedFileProcessingWatcher, newFilesInDirectoryWatcher, } from "@allurereport/directory-watcher";
|
|
4
4
|
import AllureAwesome from "@allurereport/plugin-awesome";
|
|
@@ -70,7 +70,7 @@ export const RunCommandAction = async (options) => {
|
|
|
70
70
|
const cwd = await realpath(options.cwd ?? process.cwd());
|
|
71
71
|
console.log(`${command} ${commandArgs.join(" ")}`);
|
|
72
72
|
const { config: configPath, output, reportName, rerun: maxRerun = 0, silent = false } = options;
|
|
73
|
-
const config = await
|
|
73
|
+
const config = await readConfig(cwd, configPath, { output, name: reportName });
|
|
74
74
|
try {
|
|
75
75
|
await rm(config.output, { recursive: true });
|
|
76
76
|
}
|
package/dist/commands/slack.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AllureReport, resolveConfig } from "@allurereport/core";
|
|
2
|
+
import * as console from "node:console";
|
|
2
3
|
import { createCommand } from "../utils/commands.js";
|
|
3
4
|
export const SlackCommandAction = async (resultsDir, options) => {
|
|
4
5
|
const before = new Date().getTime();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AllureReport, resolveConfig } from "@allurereport/core";
|
|
2
|
+
import * as console from "node:console";
|
|
2
3
|
import { basename, dirname, resolve } from "node:path";
|
|
3
4
|
import { createCommand } from "../utils/commands.js";
|
|
4
5
|
export const TestPlanCommandAction = async (resultsDir, options) => {
|
package/dist/commands/watch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllureReport, isFileNotFoundError,
|
|
1
|
+
import { AllureReport, isFileNotFoundError, readConfig } from "@allurereport/core";
|
|
2
2
|
import { newFilesInDirectoryWatcher } from "@allurereport/directory-watcher";
|
|
3
3
|
import AllureAwesome from "@allurereport/plugin-awesome";
|
|
4
4
|
import ProgressPlugin from "@allurereport/plugin-progress";
|
|
@@ -17,7 +17,7 @@ export const WatchCommandAction = async (resultsDir, options) => {
|
|
|
17
17
|
console.log(`exit code ${code} (${after - before}ms)`);
|
|
18
18
|
});
|
|
19
19
|
const { config: configPath, output, cwd, reportName } = options;
|
|
20
|
-
const config = await
|
|
20
|
+
const config = await readConfig(cwd, configPath, { output, name: reportName });
|
|
21
21
|
try {
|
|
22
22
|
await rm(config.output, { recursive: true });
|
|
23
23
|
}
|
|
@@ -28,7 +28,7 @@ export const WatchCommandAction = async (resultsDir, options) => {
|
|
|
28
28
|
}
|
|
29
29
|
const server = await serve({
|
|
30
30
|
servePath: config.output,
|
|
31
|
-
port: options.port ? parseInt(options.port) : undefined,
|
|
31
|
+
port: options.port ? parseInt(options.port, 10) : undefined,
|
|
32
32
|
live: false,
|
|
33
33
|
open: false,
|
|
34
34
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { defineConfig };
|
|
1
|
+
export { defineConfig } from "@allurereport/plugin-api";
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { defineConfig } from "@allurereport/core";
|
|
2
1
|
import { cac } from "cac";
|
|
3
2
|
import console from "node:console";
|
|
4
3
|
import { readFileSync } from "node:fs";
|
|
5
4
|
import { cwd } from "node:process";
|
|
6
|
-
import {
|
|
5
|
+
import { AwesomeCommand, ClassicCommand, CsvCommand, GenerateCommand, HistoryCommand, KnownIssueCommand, LogCommand, OpenCommand, QualityGateCommand, RunCommand, SlackCommand, TestPlanCommand, WatchCommand, } from "./commands/index.js";
|
|
7
6
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
8
7
|
const cli = cac(pkg.name).usage(pkg.description).help().version(pkg.version);
|
|
9
8
|
const commands = [
|
|
@@ -30,4 +29,4 @@ cli.on("command:*", () => {
|
|
|
30
29
|
});
|
|
31
30
|
console.log(cwd());
|
|
32
31
|
cli.parse();
|
|
33
|
-
export { defineConfig };
|
|
32
|
+
export { defineConfig } from "@allurereport/plugin-api";
|
package/dist/utils/commands.d.ts
CHANGED
package/dist/utils/commands.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const createCommand = (payload) => {
|
|
2
|
-
if (!payload.name)
|
|
2
|
+
if (!payload.name) {
|
|
3
3
|
throw new Error("Command name is not provided!");
|
|
4
|
-
|
|
4
|
+
}
|
|
5
|
+
if (!payload.action) {
|
|
5
6
|
throw new Error("Command action is not provided!");
|
|
7
|
+
}
|
|
6
8
|
return (cli) => {
|
|
7
9
|
const command = cli.command(payload.name, payload.description);
|
|
8
10
|
payload?.options?.forEach(([name, parameters]) => {
|
package/dist/utils/process.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ChildProcess } from "node:child_process";
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
2
|
export declare const runProcess: (command: string, commandArgs: string[], cwd: string | undefined, environment: Record<string, string>, silent?: boolean) => ChildProcess;
|
|
3
3
|
export declare const terminationOf: (testProcess: ChildProcess) => Promise<number | null>;
|
package/dist/utils/terminal.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TestResult, TestStatus } from "@allurereport/core-api";
|
|
1
|
+
import type { TestResult, TestStatus } from "@allurereport/core-api";
|
|
2
2
|
export declare const status2color: (status: TestStatus) => import("yoctocolors").Format;
|
|
3
3
|
export declare const logTests: (testResults: TestResult[]) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.5",
|
|
4
4
|
"description": "Allure Commandline Tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -24,19 +24,22 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "run clean && tsc --project ./tsconfig.json",
|
|
26
26
|
"clean": "rimraf ./dist",
|
|
27
|
+
"eslint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
|
|
28
|
+
"eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}",
|
|
27
29
|
"start": "node ./cli.js",
|
|
28
30
|
"test": "vitest run"
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"@allurereport/core": "3.0.0-beta.
|
|
32
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
33
|
-
"@allurereport/directory-watcher": "3.0.0-beta.
|
|
34
|
-
"@allurereport/plugin-
|
|
35
|
-
"@allurereport/plugin-
|
|
36
|
-
"@allurereport/plugin-
|
|
37
|
-
"@allurereport/plugin-
|
|
38
|
-
"@allurereport/
|
|
39
|
-
"@allurereport/
|
|
33
|
+
"@allurereport/core": "3.0.0-beta.5",
|
|
34
|
+
"@allurereport/core-api": "3.0.0-beta.5",
|
|
35
|
+
"@allurereport/directory-watcher": "3.0.0-beta.5",
|
|
36
|
+
"@allurereport/plugin-api": "3.0.0-beta.5",
|
|
37
|
+
"@allurereport/plugin-awesome": "3.0.0-beta.5",
|
|
38
|
+
"@allurereport/plugin-progress": "3.0.0-beta.5",
|
|
39
|
+
"@allurereport/plugin-server-reload": "3.0.0-beta.5",
|
|
40
|
+
"@allurereport/plugin-slack": "3.0.0-beta.5",
|
|
41
|
+
"@allurereport/reader-api": "3.0.0-beta.5",
|
|
42
|
+
"@allurereport/static-server": "3.0.0-beta.5",
|
|
40
43
|
"cac": "^6.7.14",
|
|
41
44
|
"lodash.omit": "^4.5.0",
|
|
42
45
|
"yoctocolors": "^2.1.1"
|