@allurereport/plugin-classic 3.2.0 → 3.3.1

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.
Files changed (2) hide show
  1. package/dist/plugin.js +7 -18
  2. package/package.json +6 -6
package/dist/plugin.js CHANGED
@@ -10,8 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
12
  var _ClassicPlugin_writer, _ClassicPlugin_generate;
13
- import { getWorstStatus } from "@allurereport/core-api";
14
- import { convertToSummaryTestResult, } from "@allurereport/plugin-api";
13
+ import { createPluginSummary, } from "@allurereport/plugin-api";
15
14
  import { preciseTreeLabels } from "@allurereport/plugin-api";
16
15
  import { generateAttachmentsFiles, generateEnvironmentJson, generateHistoryDataPoints, generatePieChart, generateStaticFiles, generateStatistic, generateTestResults, generateTree, generateTreeByCategories, } from "./generators.js";
17
16
  import { InMemoryReportDataWriter, ReportFileDataWriter } from "./writer.js";
@@ -74,29 +73,19 @@ export class ClassicPlugin {
74
73
  };
75
74
  }
76
75
  async info(context, store) {
77
- const allTrs = (await store.allTestResults()).filter(this.options.filter ? this.options.filter : () => true);
78
- const newTrs = await store.allNewTestResults();
79
- const retryTrs = allTrs.filter((tr) => !!tr?.retries?.length);
80
- const flakyTrs = allTrs.filter((tr) => !!tr?.flaky);
81
- const duration = allTrs.reduce((acc, { duration: trDuration = 0 }) => acc + trDuration, 0);
82
- const worstStatus = getWorstStatus(allTrs.map(({ status }) => status));
83
- const createdAt = allTrs.reduce((acc, { stop }) => Math.max(acc, stop || 0), 0);
84
- return {
76
+ return createPluginSummary({
85
77
  name: this.options.reportName || context.reportName,
86
- stats: await store.testsStatistic(this.options.filter),
87
- status: worstStatus ?? "passed",
88
- createdAt,
89
- duration,
90
78
  plugin: "Classic",
91
- newTests: newTrs.map(convertToSummaryTestResult),
92
- flakyTests: flakyTrs.map(convertToSummaryTestResult),
93
- retryTests: retryTrs.map(convertToSummaryTestResult),
94
79
  meta: {
95
80
  reportId: context.reportUuid,
96
81
  singleFile: this.options.singleFile ?? false,
97
82
  withTestResultsLinks: true,
98
83
  },
99
- };
84
+ filter: this.options.filter,
85
+ history: context.history,
86
+ ci: context.ci,
87
+ store,
88
+ });
100
89
  }
101
90
  }
102
91
  _ClassicPlugin_writer = new WeakMap(), _ClassicPlugin_generate = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-classic",
3
- "version": "3.2.0",
3
+ "version": "3.3.1",
4
4
  "description": "The classic version of Allure HTML report",
5
5
  "keywords": [
6
6
  "allure",
@@ -30,11 +30,11 @@
30
30
  "test": "rimraf ./out && vitest run"
31
31
  },
32
32
  "dependencies": {
33
- "@allurereport/core-api": "3.2.0",
34
- "@allurereport/plugin-api": "3.2.0",
35
- "@allurereport/web-awesome": "3.2.0",
36
- "@allurereport/web-classic": "3.2.0",
37
- "@allurereport/web-commons": "3.2.0",
33
+ "@allurereport/core-api": "3.3.1",
34
+ "@allurereport/plugin-api": "3.3.1",
35
+ "@allurereport/web-awesome": "3.3.1",
36
+ "@allurereport/web-classic": "3.3.1",
37
+ "@allurereport/web-commons": "3.3.1",
38
38
  "d3-shape": "^3.2.0",
39
39
  "handlebars": "^4.7.8",
40
40
  "markdown-it": "^14.1.0"