@allurereport/plugin-jira 3.20.1 → 3.22.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/dist/helpers.d.ts +0 -1
- package/dist/helpers.js +0 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +10 -20
- package/dist/types.d.ts +0 -4
- package/package.json +12 -7
package/dist/helpers.d.ts
CHANGED
|
@@ -4,5 +4,4 @@ export declare const isJiraIssueKey: (issue: string) => boolean;
|
|
|
4
4
|
export declare const findJiraLink: (tr: TestResult) => import("@allurereport/core-api").TestLink | undefined;
|
|
5
5
|
export declare const prepareTestResults: (trs: TestResult[], environmentNames?: ReadonlyMap<string, string>) => ForgePluginTestResult[];
|
|
6
6
|
export declare const trimName: (name: string) => string;
|
|
7
|
-
export declare const trimParameters: (p: string) => string;
|
|
8
7
|
export declare const trimCiInfoLabel: (label: string) => string;
|
package/dist/helpers.js
CHANGED
|
@@ -82,5 +82,4 @@ const trimStrMax = (str, maxLength = 255) => {
|
|
|
82
82
|
return `${trimmed.replace(/\.+$/, "")}...`;
|
|
83
83
|
};
|
|
84
84
|
export const trimName = (name) => trimStrMax(name, 255);
|
|
85
|
-
export const trimParameters = (p) => trimStrMax(p, 120);
|
|
86
85
|
export const trimCiInfoLabel = (label) => trimStrMax(label, 120);
|
package/dist/plugin.d.ts
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -4,7 +4,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _JiraPlugin_instances, _JiraPlugin_pluginName, _JiraPlugin_pluginOptions_get, _JiraPlugin_verifyOptions, _JiraPlugin_requestForgeApp, _JiraPlugin_uploadResults, _JiraPlugin_getReportStatus, _JiraPlugin_getStatisticByEnv, _JiraPlugin_getCiInfo, _JiraPlugin_getReportDate, _JiraPlugin_uploadReport, _JiraPlugin_uploadAll;
|
|
7
|
-
import { DEFAULT_ENVIRONMENT,
|
|
7
|
+
import { DEFAULT_ENVIRONMENT, statusesList } from "@allurereport/core-api";
|
|
8
|
+
import { resolveReportStatus } from "@allurereport/plugin-api";
|
|
8
9
|
import axios, { isAxiosError } from "axios";
|
|
9
10
|
import { isJiraIssueKey, prepareTestResults, trimCiInfoLabel, trimName } from "./helpers.js";
|
|
10
11
|
const TRUE_VALUES = ["true", "1"];
|
|
@@ -94,25 +95,14 @@ _JiraPlugin_pluginName = new WeakMap(), _JiraPlugin_instances = new WeakSet(), _
|
|
|
94
95
|
await __classPrivateFieldGet(this, _JiraPlugin_instances, "m", _JiraPlugin_requestForgeApp).call(this, { operation: "upload-results", payload });
|
|
95
96
|
}, _JiraPlugin_getReportStatus = async function _JiraPlugin_getReportStatus(store, statistic) {
|
|
96
97
|
const globalErrors = await store.allGlobalErrors();
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
const worstStatus = getWorstStatus(statusesList
|
|
107
|
-
.map((status) => {
|
|
108
|
-
const value = statistic[status] ?? 0;
|
|
109
|
-
return value > 0 ? status : undefined;
|
|
110
|
-
})
|
|
111
|
-
.filter((status) => status !== undefined)) ?? "passed";
|
|
112
|
-
if (worstStatus === "passed") {
|
|
113
|
-
return "passed";
|
|
114
|
-
}
|
|
115
|
-
return "failed";
|
|
98
|
+
const exitCode = await store.globalExitCode();
|
|
99
|
+
const testStatuses = statusesList.filter((status) => (statistic[status] ?? 0) > 0);
|
|
100
|
+
const status = resolveReportStatus({
|
|
101
|
+
globalErrorsCount: globalErrors.length,
|
|
102
|
+
exitCode,
|
|
103
|
+
testStatuses,
|
|
104
|
+
});
|
|
105
|
+
return status === "passed" ? "passed" : "failed";
|
|
116
106
|
}, _JiraPlugin_getStatisticByEnv = async function _JiraPlugin_getStatisticByEnv(store) {
|
|
117
107
|
const statisticByEnv = {};
|
|
118
108
|
const envs = await store.allEnvironmentIdentities();
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-jira",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "Allure Plugin to Report results to Jira",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -25,23 +25,28 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "run clean && tsc --project ./tsconfig.json",
|
|
27
27
|
"clean": "rimraf ./dist",
|
|
28
|
-
"test": "rimraf
|
|
29
|
-
"
|
|
30
|
-
"lint
|
|
28
|
+
"test": "rimraf out && vp test run",
|
|
29
|
+
"test:unit": "yarn test",
|
|
30
|
+
"lint": "vp lint --import-plugin src test features stories",
|
|
31
|
+
"lint:fix": "vp lint --import-plugin --fix src test features stories"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@allurereport/core-api": "3.
|
|
34
|
-
"@allurereport/plugin-api": "3.
|
|
34
|
+
"@allurereport/core-api": "3.22.0",
|
|
35
|
+
"@allurereport/plugin-api": "3.22.0",
|
|
35
36
|
"axios": "^1.20.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
39
|
+
"@allurereport/common-config": "3.22.0",
|
|
38
40
|
"@faker-js/faker": "^10.5.0",
|
|
39
41
|
"@types/node": "^20",
|
|
42
|
+
"@vitest/coverage-istanbul": "5.0.4",
|
|
40
43
|
"@vitest/runner": "^2",
|
|
41
44
|
"allure-js-commons": "^3",
|
|
42
45
|
"allure-vitest": "^3",
|
|
43
46
|
"rimraf": "^6",
|
|
44
47
|
"typescript": "^5",
|
|
45
|
-
"
|
|
48
|
+
"vite": "@voidzero-dev/vite-plus-core@1.2.0",
|
|
49
|
+
"vite-plus": "1.2.0",
|
|
50
|
+
"vitest": "5.0.4"
|
|
46
51
|
}
|
|
47
52
|
}
|