@allurereport/plugin-allure2 3.0.0-beta.16 → 3.0.0-beta.18

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.
@@ -113,19 +113,29 @@ export const generateStaticFiles = async (payload) => {
113
113
  reportLanguage: reportLanguage ?? "en",
114
114
  createdAt: Date.now(),
115
115
  };
116
- const html = compile({
117
- headTags: headTags.join("\n"),
118
- bodyTags: bodyTags.join("\n"),
119
- reportFilesScript: createReportDataScript(reportDataFiles),
120
- reportOptions: JSON.stringify(reportOptions),
121
- analyticsEnable: true,
122
- allureVersion,
123
- reportLanguage,
124
- reportUuid,
125
- reportName,
126
- singleFile,
127
- });
128
- await reportFiles.addFile("index.html", Buffer.from(html, "utf8"));
116
+ try {
117
+ const html = compile({
118
+ headTags: headTags.join("\n"),
119
+ bodyTags: bodyTags.join("\n"),
120
+ reportFilesScript: createReportDataScript(reportDataFiles),
121
+ reportOptions: JSON.stringify(reportOptions),
122
+ analyticsEnable: true,
123
+ allureVersion,
124
+ reportLanguage,
125
+ reportUuid,
126
+ reportName,
127
+ singleFile,
128
+ });
129
+ await reportFiles.addFile("index.html", Buffer.from(html, "utf8"));
130
+ }
131
+ catch (err) {
132
+ if (err instanceof RangeError) {
133
+ console.error("The report is too large to be generated in the single file mode!");
134
+ process.exit(1);
135
+ return;
136
+ }
137
+ throw err;
138
+ }
129
139
  };
130
140
  export const generateTree = async (writer, name, labelNames, tests) => {
131
141
  const fileName = `${name}.json`;
package/dist/plugin.js CHANGED
@@ -5,7 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
5
5
  };
6
6
  var _Allure2Plugin_generate;
7
7
  import { getWorstStatus } from "@allurereport/core-api";
8
- import { preciseTreeLabels, } from "@allurereport/plugin-api";
8
+ import { convertToSummaryTestResult, preciseTreeLabels, } from "@allurereport/plugin-api";
9
9
  import { convertTestResult } from "./converters.js";
10
10
  import { generateAttachmentsData, generateCategoriesData, generateDefaultWidgetData, generateEmptyTrendData, generateEnvironmentJson, generateExecutorJson, generatePackagesData, generateStaticFiles, generateSummaryJson, generateTestResults, generateTimelineData, generateTree, generateTrendData, } from "./generators.js";
11
11
  import { InMemoryReportDataWriter, ReportFileDataWriter } from "./writer.js";
@@ -75,6 +75,9 @@ export class Allure2Plugin {
75
75
  }
76
76
  async info(context, store) {
77
77
  const allTrs = await store.allTestResults();
78
+ const newTrs = await store.allNewTestResults();
79
+ const retryTrs = allTrs.filter((tr) => !!tr?.retries?.length);
80
+ const flakyTrs = allTrs.filter((tr) => !!tr?.flaky);
78
81
  const duration = allTrs.reduce((acc, { duration: trDuration = 0 }) => acc + trDuration, 0);
79
82
  const worstStatus = getWorstStatus(allTrs.map(({ status }) => status));
80
83
  const createdAt = allTrs.reduce((acc, { stop }) => Math.max(acc, stop || 0), 0);
@@ -85,6 +88,9 @@ export class Allure2Plugin {
85
88
  duration,
86
89
  createdAt,
87
90
  plugin: "Allure2",
91
+ newTests: newTrs.map(convertToSummaryTestResult),
92
+ flakyTests: flakyTrs.map(convertToSummaryTestResult),
93
+ retryTests: retryTrs.map(convertToSummaryTestResult),
88
94
  };
89
95
  }
90
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-allure2",
3
- "version": "3.0.0-beta.16",
3
+ "version": "3.0.0-beta.18",
4
4
  "description": "The classic version of Allure HTML report",
5
5
  "keywords": [
6
6
  "allure",
@@ -30,10 +30,10 @@
30
30
  "test": "rimraf ./out && vitest run"
31
31
  },
32
32
  "dependencies": {
33
- "@allurereport/core-api": "3.0.0-beta.16",
34
- "@allurereport/plugin-api": "3.0.0-beta.16",
35
- "@allurereport/web-allure2": "3.0.0-beta.16",
36
- "@allurereport/web-commons": "3.0.0-beta.16",
33
+ "@allurereport/core-api": "3.0.0-beta.18",
34
+ "@allurereport/plugin-api": "3.0.0-beta.18",
35
+ "@allurereport/web-allure2": "3.0.0-beta.18",
36
+ "@allurereport/web-commons": "3.0.0-beta.18",
37
37
  "handlebars": "^4.7.8"
38
38
  },
39
39
  "devDependencies": {
@@ -43,7 +43,7 @@
43
43
  "@typescript-eslint/eslint-plugin": "^8.0.0",
44
44
  "@typescript-eslint/parser": "^8.0.0",
45
45
  "@vitest/runner": "^2.1.9",
46
- "allure-vitest": "^3.0.9",
46
+ "allure-vitest": "^3.3.3",
47
47
  "eslint": "^8.57.0",
48
48
  "eslint-config-prettier": "^9.1.0",
49
49
  "eslint-plugin-import": "^2.29.1",