@allurereport/plugin-dashboard 3.0.0-beta.16 → 3.0.0-beta.17

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.
@@ -139,16 +139,26 @@ export const generateStaticFiles = async (payload) => {
139
139
  reportUuid,
140
140
  allureVersion,
141
141
  };
142
- const html = compile({
143
- headTags: headTags.join("\n"),
144
- bodyTags: bodyTags.join("\n"),
145
- reportFilesScript: createReportDataScript(reportDataFiles),
146
- reportOptions: JSON.stringify(reportOptions),
147
- analyticsEnable: true,
148
- allureVersion,
149
- reportUuid,
150
- reportName,
151
- singleFile: payload.singleFile,
152
- });
153
- await reportFiles.addFile("index.html", Buffer.from(html, "utf8"));
142
+ try {
143
+ const html = compile({
144
+ headTags: headTags.join("\n"),
145
+ bodyTags: bodyTags.join("\n"),
146
+ reportFilesScript: createReportDataScript(reportDataFiles),
147
+ reportOptions: JSON.stringify(reportOptions),
148
+ analyticsEnable: true,
149
+ allureVersion,
150
+ reportUuid,
151
+ reportName,
152
+ singleFile: payload.singleFile,
153
+ });
154
+ await reportFiles.addFile("index.html", Buffer.from(html, "utf8"));
155
+ }
156
+ catch (err) {
157
+ if (err instanceof RangeError) {
158
+ console.error("The report is too large to be generated in the single file mode!");
159
+ process.exit(1);
160
+ return;
161
+ }
162
+ throw err;
163
+ }
154
164
  };
package/dist/plugin.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AllureStore, Plugin, PluginContext, PluginSummary } from "@allurereport/plugin-api";
1
+ import { type AllureStore, type Plugin, type PluginContext, type PluginSummary } from "@allurereport/plugin-api";
2
2
  import type { DashboardPluginOptions } from "./model.js";
3
3
  export declare class DashboardPlugin implements Plugin {
4
4
  #private;
package/dist/plugin.js CHANGED
@@ -11,6 +11,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
11
11
  };
12
12
  var _DashboardPlugin_writer, _DashboardPlugin_generate;
13
13
  import { getWorstStatus } from "@allurereport/core-api";
14
+ import { convertToSummaryTestResult, } from "@allurereport/plugin-api";
14
15
  import { generateAllCharts, generateStaticFiles } from "./generators.js";
15
16
  import { InMemoryDashboardDataWriter, ReportFileDashboardDataWriter } from "./writer.js";
16
17
  export class DashboardPlugin {
@@ -52,6 +53,9 @@ export class DashboardPlugin {
52
53
  }
53
54
  async info(context, store) {
54
55
  const allTrs = (await store.allTestResults()).filter(this.options.filter ? this.options.filter : () => true);
56
+ const newTrs = await store.allNewTestResults();
57
+ const retryTrs = allTrs.filter((tr) => !!tr?.retries?.length);
58
+ const flakyTrs = allTrs.filter((tr) => !!tr?.flaky);
55
59
  const duration = allTrs.reduce((acc, { duration: trDuration = 0 }) => acc + trDuration, 0);
56
60
  const worstStatus = getWorstStatus(allTrs.map(({ status }) => status));
57
61
  const createdAt = allTrs.reduce((acc, { stop }) => Math.max(acc, stop || 0), 0);
@@ -62,6 +66,9 @@ export class DashboardPlugin {
62
66
  duration,
63
67
  createdAt,
64
68
  plugin: "Dashboard",
69
+ newTests: newTrs.map(convertToSummaryTestResult),
70
+ flakyTests: flakyTrs.map(convertToSummaryTestResult),
71
+ retryTests: retryTrs.map(convertToSummaryTestResult),
65
72
  };
66
73
  }
67
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-dashboard",
3
- "version": "3.0.0-beta.16",
3
+ "version": "3.0.0-beta.17",
4
4
  "description": "Allure Dashboard Plugin – plugin for generating dashboard with a mix of charts",
5
5
  "keywords": [
6
6
  "allure",
@@ -32,10 +32,10 @@
32
32
  "test": "rimraf ./out && vitest run"
33
33
  },
34
34
  "dependencies": {
35
- "@allurereport/core-api": "3.0.0-beta.16",
36
- "@allurereport/plugin-api": "3.0.0-beta.16",
37
- "@allurereport/web-commons": "3.0.0-beta.16",
38
- "@allurereport/web-dashboard": "3.0.0-beta.16",
35
+ "@allurereport/core-api": "3.0.0-beta.17",
36
+ "@allurereport/plugin-api": "3.0.0-beta.17",
37
+ "@allurereport/web-commons": "3.0.0-beta.17",
38
+ "@allurereport/web-dashboard": "3.0.0-beta.17",
39
39
  "d3-shape": "^3.2.0",
40
40
  "handlebars": "^4.7.8"
41
41
  },
@@ -47,7 +47,7 @@
47
47
  "@typescript-eslint/eslint-plugin": "^8.0.0",
48
48
  "@typescript-eslint/parser": "^8.0.0",
49
49
  "@vitest/runner": "^2.1.9",
50
- "allure-vitest": "^3.0.9",
50
+ "allure-vitest": "^3.3.0",
51
51
  "eslint": "^8.57.0",
52
52
  "eslint-config-prettier": "^9.1.0",
53
53
  "eslint-plugin-import": "^2.29.1",