@allurereport/core 3.12.0 → 3.13.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.
package/dist/config.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import type { Config, PluginDescriptor } from "@allurereport/plugin-api";
1
+ import type { Config, Plugin, PluginConstructorContext, PluginDescriptor } from "@allurereport/plugin-api";
2
2
  import type { FullConfig, PluginInstance } from "./api.js";
3
+ type PluginConstructor = new (options?: Record<string, any>, context?: PluginConstructorContext) => Plugin;
3
4
  export interface ConfigOverride {
4
5
  name?: Config["name"];
5
6
  output?: Config["output"];
@@ -28,4 +29,5 @@ export declare const resolveConfig: (config: Config, override?: ConfigOverride)
28
29
  export declare const readConfig: (cwd?: string, configPath?: string, override?: ConfigOverride) => Promise<FullConfig>;
29
30
  export declare const readRawConfig: (cwd?: string, configPath?: string) => Promise<Config>;
30
31
  export declare const getPluginInstance: (config: FullConfig, predicate: (plugin: PluginInstance) => boolean) => PluginInstance | undefined;
31
- export declare const resolvePlugin: (path: string) => Promise<any>;
32
+ export declare const resolvePlugin: (path: string) => Promise<PluginConstructor>;
33
+ export {};
package/dist/config.js CHANGED
@@ -319,11 +319,16 @@ const resolvePlugins = async (plugins) => {
319
319
  const pluginConfig = plugins[id];
320
320
  const pluginId = getPluginId(id);
321
321
  const Plugin = await resolvePlugin(pluginConfig.import ?? id);
322
+ const enabled = pluginConfig.enabled ?? true;
323
+ const constructorContext = {};
324
+ if ("enabled" in pluginConfig) {
325
+ constructorContext.enabled = pluginConfig.enabled;
326
+ }
322
327
  pluginInstances.push({
323
328
  id: pluginId,
324
- enabled: pluginConfig.enabled ?? true,
329
+ enabled,
325
330
  options: pluginConfig.options ?? {},
326
- plugin: new Plugin(pluginConfig.options),
331
+ plugin: new Plugin(pluginConfig.options, constructorContext),
327
332
  });
328
333
  }
329
334
  return pluginInstances;
package/dist/report.js CHANGED
@@ -362,7 +362,7 @@ export class AllureReport {
362
362
  const addJsonDumpEntry = async (entryName, value) => {
363
363
  await addRequiredDumpEntry(Buffer.from(JSON.stringify(value)), entryName);
364
364
  };
365
- const dumpJsonEntries = ({ testResults, testCases, fixtures, attachments, environments, reportVariables, checkResults = [], globalAttachmentIds = [], globalErrors = [], indexAttachmentByTestResult = {}, indexTestResultByHistoryId = {}, indexTestResultByTestCase = {}, indexAttachmentByFixture = {}, indexFixturesByTestResult = {}, indexKnownByHistoryId = {}, qualityGateResults = [], testResultIdsIngestOrder = [], }) => [
365
+ const dumpJsonEntries = ({ testResults, testCases, fixtures, attachments, environments, reportVariables, checkResults = {}, globalAttachmentIds = [], globalErrors = [], indexAttachmentByTestResult = {}, indexTestResultByHistoryId = {}, indexTestResultByTestCase = {}, indexAttachmentByFixture = {}, indexFixturesByTestResult = {}, indexKnownByHistoryId = {}, qualityGateResults = [], testResultIdsIngestOrder = [], }) => [
366
366
  [AllureStoreDumpFiles.TestResults, testResults],
367
367
  [AllureStoreDumpFiles.TestCases, testCases],
368
368
  [AllureStoreDumpFiles.Fixtures, fixtures],
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _DefaultAllureStore_instances, _DefaultAllureStore_testResults, _DefaultAllureStore_environmentDisplayNames, _DefaultAllureStore_environmentNameToId, _DefaultAllureStore_attachments, _DefaultAllureStore_attachmentContents, _DefaultAllureStore_testCases, _DefaultAllureStore_metadata, _DefaultAllureStore_history, _DefaultAllureStore_known, _DefaultAllureStore_fixtures, _DefaultAllureStore_defaultLabels, _DefaultAllureStore_environment, _DefaultAllureStore_environmentsConfig, _DefaultAllureStore_reportVariables, _DefaultAllureStore_realtimeDispatcher, _DefaultAllureStore_realtimeSubscriber, _DefaultAllureStore_allowedEnvironmentIds, _DefaultAllureStore_retrySubstore, _DefaultAllureStore_testResultIdsByEnvironmentId, _DefaultAllureStore_cachedEnvironmentEntries, _DefaultAllureStore_globalAttachmentIds, _DefaultAllureStore_globalAttachmentIdsByEnv, _DefaultAllureStore_globalErrors, _DefaultAllureStore_globalErrorsByEnv, _DefaultAllureStore_globalExitCode, _DefaultAllureStore_checkResults, _DefaultAllureStore_qualityGateResults, _DefaultAllureStore_historyPoints, _DefaultAllureStore_environments, _DefaultAllureStore_mergeEnvironmentIdentity, _DefaultAllureStore_environmentIdForLookup, _DefaultAllureStore_addEnvironments, _DefaultAllureStore_environmentIdByName, _DefaultAllureStore_setTestResultEnvironmentId, _DefaultAllureStore_assertAllowedEnvironmentId, _DefaultAllureStore_assertAllowedStoredEnvironment, _DefaultAllureStore_environmentIdByTestResult, _DefaultAllureStore_assignRetryHash, _DefaultAllureStore_rebuildRetrySubstore, _DefaultAllureStore_resolveGlobalEnvironmentIdentity, _DefaultAllureStore_globalAttachmentId, _DefaultAllureStore_indexGlobalError, _DefaultAllureStore_addGlobalError, _DefaultAllureStore_indexGlobalAttachment, _DefaultAllureStore_addGlobalAttachment, _DefaultAllureStore_restoreAttachmentContent, _DefaultAllureStore_relinkRestoredAttachmentSteps, _DefaultAllureStore_retriesByTr, _DefaultAllureStore_historyByTr;
12
+ var _DefaultAllureStore_instances, _DefaultAllureStore_testResults, _DefaultAllureStore_environmentDisplayNames, _DefaultAllureStore_environmentNameToId, _DefaultAllureStore_attachments, _DefaultAllureStore_attachmentContents, _DefaultAllureStore_testCases, _DefaultAllureStore_metadata, _DefaultAllureStore_history, _DefaultAllureStore_known, _DefaultAllureStore_fixtures, _DefaultAllureStore_defaultLabels, _DefaultAllureStore_environment, _DefaultAllureStore_environmentsConfig, _DefaultAllureStore_reportVariables, _DefaultAllureStore_realtimeDispatcher, _DefaultAllureStore_realtimeSubscriber, _DefaultAllureStore_allowedEnvironmentIds, _DefaultAllureStore_retrySubstore, _DefaultAllureStore_testResultIdsByEnvironmentId, _DefaultAllureStore_cachedEnvironmentEntries, _DefaultAllureStore_globalAttachmentIds, _DefaultAllureStore_globalAttachmentIdsByEnv, _DefaultAllureStore_globalErrors, _DefaultAllureStore_globalErrorsByEnv, _DefaultAllureStore_globalExitCode, _DefaultAllureStore_checkResultsById, _DefaultAllureStore_qualityGateResults, _DefaultAllureStore_historyPoints, _DefaultAllureStore_environments, _DefaultAllureStore_mergeEnvironmentIdentity, _DefaultAllureStore_environmentIdForLookup, _DefaultAllureStore_addEnvironments, _DefaultAllureStore_environmentIdByName, _DefaultAllureStore_setTestResultEnvironmentId, _DefaultAllureStore_assertAllowedEnvironmentId, _DefaultAllureStore_assertAllowedStoredEnvironment, _DefaultAllureStore_environmentIdByTestResult, _DefaultAllureStore_assignRetryHash, _DefaultAllureStore_rebuildRetrySubstore, _DefaultAllureStore_resolveGlobalEnvironmentIdentity, _DefaultAllureStore_globalAttachmentId, _DefaultAllureStore_indexGlobalError, _DefaultAllureStore_addGlobalError, _DefaultAllureStore_indexGlobalAttachment, _DefaultAllureStore_addGlobalAttachment, _DefaultAllureStore_restoreAttachmentContent, _DefaultAllureStore_relinkRestoredAttachmentSteps, _DefaultAllureStore_retriesByTr, _DefaultAllureStore_historyByTr;
13
13
  import { extname } from "node:path";
14
14
  import { DEFAULT_ENVIRONMENT, DEFAULT_ENVIRONMENT_IDENTITY, compareBy, createDictionary, getHistoryIdCandidates, getWorstStatus, normalizeHistoryDataPoint, ordinal, reverse, selectHistoryTestResults, validateEnvironmentId, validateEnvironmentName, } from "@allurereport/core-api";
15
15
  import { md5, } from "@allurereport/plugin-api";
@@ -87,7 +87,7 @@ export class DefaultAllureStore {
87
87
  _DefaultAllureStore_globalErrors.set(this, []);
88
88
  _DefaultAllureStore_globalErrorsByEnv.set(this, new Map());
89
89
  _DefaultAllureStore_globalExitCode.set(this, void 0);
90
- _DefaultAllureStore_checkResults.set(this, []);
90
+ _DefaultAllureStore_checkResultsById.set(this, new Map());
91
91
  _DefaultAllureStore_qualityGateResults.set(this, []);
92
92
  _DefaultAllureStore_historyPoints.set(this, []);
93
93
  _DefaultAllureStore_environments.set(this, []);
@@ -190,9 +190,8 @@ export class DefaultAllureStore {
190
190
  await __classPrivateFieldGet(this, _DefaultAllureStore_history, "f").appendHistory(history);
191
191
  }
192
192
  async addCheckResult(result) {
193
- __classPrivateFieldGet(this, _DefaultAllureStore_checkResults, "f").push({
194
- name: result.name,
195
- status: result.status,
193
+ __classPrivateFieldGet(this, _DefaultAllureStore_checkResultsById, "f").set(result.id, {
194
+ ...result,
196
195
  ...(result.tags?.length ? { tags: [...result.tags] } : {}),
197
196
  details: {
198
197
  command: result.details.command,
@@ -202,9 +201,14 @@ export class DefaultAllureStore {
202
201
  });
203
202
  }
204
203
  async allCheckResults() {
205
- return __classPrivateFieldGet(this, _DefaultAllureStore_checkResults, "f").map((result) => ({
204
+ return Array.from(__classPrivateFieldGet(this, _DefaultAllureStore_checkResultsById, "f").values()).map((result) => ({
206
205
  ...result,
207
206
  ...(result.tags ? { tags: [...result.tags] } : {}),
207
+ details: {
208
+ command: result.details.command,
209
+ ...(result.details.message ? { message: result.details.message } : {}),
210
+ ...(result.details.error ? { error: result.details.error } : {}),
211
+ },
208
212
  }));
209
213
  }
210
214
  async qualityGateResults() {
@@ -779,10 +783,7 @@ export class DefaultAllureStore {
779
783
  reportVariables: __classPrivateFieldGet(this, _DefaultAllureStore_reportVariables, "f"),
780
784
  globalAttachmentIds: __classPrivateFieldGet(this, _DefaultAllureStore_globalAttachmentIds, "f"),
781
785
  globalErrors: __classPrivateFieldGet(this, _DefaultAllureStore_globalErrors, "f"),
782
- checkResults: __classPrivateFieldGet(this, _DefaultAllureStore_checkResults, "f").map((result) => ({
783
- ...result,
784
- ...(result.tags ? { tags: [...result.tags] } : {}),
785
- })),
786
+ checkResults: mapToObject(__classPrivateFieldGet(this, _DefaultAllureStore_checkResultsById, "f")),
786
787
  indexAttachmentByTestResult: {},
787
788
  indexTestResultByHistoryId: {},
788
789
  indexTestResultByTestCase: {},
@@ -813,7 +814,7 @@ export class DefaultAllureStore {
813
814
  return storeDump;
814
815
  }
815
816
  async restoreState(stateDump, attachmentsContents = {}) {
816
- const { testResults, attachments, testCases, fixtures, reportVariables, environments, globalAttachmentIds = [], globalErrors = [], checkResults = [], indexAttachmentByTestResult = {}, indexTestResultByHistoryId = {}, indexTestResultByTestCase = {}, indexAttachmentByFixture = {}, indexFixturesByTestResult = {}, indexKnownByHistoryId = {}, qualityGateResults = [], testResultIdsIngestOrder = [], } = stateDump;
817
+ const { testResults, attachments, testCases, fixtures, reportVariables, environments, globalAttachmentIds = [], globalErrors = [], checkResults, indexAttachmentByTestResult = {}, indexTestResultByHistoryId = {}, indexTestResultByTestCase = {}, indexAttachmentByFixture = {}, indexFixturesByTestResult = {}, indexKnownByHistoryId = {}, qualityGateResults = [], testResultIdsIngestOrder = [], } = stateDump;
817
818
  const storedEnvironmentAliases = environments.flatMap((environmentValue) => {
818
819
  if (typeof environmentValue === "string") {
819
820
  return [{ id: environmentValue, name: environmentValue }];
@@ -874,6 +875,7 @@ export class DefaultAllureStore {
874
875
  this.indexTestResultByEnvironmentId.forEach((trs, envId) => {
875
876
  __classPrivateFieldGet(this, _DefaultAllureStore_testResultIdsByEnvironmentId, "f").set(envId, new Set(trs.map((tr) => tr.id)));
876
877
  });
878
+ updateMapWithRecord(__classPrivateFieldGet(this, _DefaultAllureStore_checkResultsById, "f"), checkResults);
877
879
  updateMapWithRecord(__classPrivateFieldGet(this, _DefaultAllureStore_attachments, "f"), attachments);
878
880
  updateMapWithRecord(__classPrivateFieldGet(this, _DefaultAllureStore_testCases, "f"), testCases);
879
881
  updateMapWithRecord(__classPrivateFieldGet(this, _DefaultAllureStore_fixtures, "f"), fixtures);
@@ -904,18 +906,6 @@ export class DefaultAllureStore {
904
906
  });
905
907
  __classPrivateFieldGet(this, _DefaultAllureStore_globalErrors, "f").push(__classPrivateFieldGet(this, _DefaultAllureStore_instances, "m", _DefaultAllureStore_indexGlobalError).call(this, error));
906
908
  });
907
- checkResults.forEach((result) => {
908
- __classPrivateFieldGet(this, _DefaultAllureStore_checkResults, "f").push({
909
- name: result.name,
910
- status: result.status,
911
- ...(result.tags?.length ? { tags: [...result.tags] } : {}),
912
- details: {
913
- command: result.details?.command ?? "",
914
- ...(result.details?.message ? { message: result.details.message } : {}),
915
- ...(result.details?.error ? { error: result.details.error } : {}),
916
- },
917
- });
918
- });
919
909
  Object.assign(__classPrivateFieldGet(this, _DefaultAllureStore_reportVariables, "f"), reportVariables);
920
910
  Object.entries(indexAttachmentByTestResult).forEach(([trId, links]) => {
921
911
  const attachmentsLinks = links.map((id) => __classPrivateFieldGet(this, _DefaultAllureStore_attachments, "f").get(id)).filter(Boolean);
@@ -997,7 +987,7 @@ export class DefaultAllureStore {
997
987
  });
998
988
  }
999
989
  }
1000
- _DefaultAllureStore_testResults = new WeakMap(), _DefaultAllureStore_environmentDisplayNames = new WeakMap(), _DefaultAllureStore_environmentNameToId = new WeakMap(), _DefaultAllureStore_attachments = new WeakMap(), _DefaultAllureStore_attachmentContents = new WeakMap(), _DefaultAllureStore_testCases = new WeakMap(), _DefaultAllureStore_metadata = new WeakMap(), _DefaultAllureStore_history = new WeakMap(), _DefaultAllureStore_known = new WeakMap(), _DefaultAllureStore_fixtures = new WeakMap(), _DefaultAllureStore_defaultLabels = new WeakMap(), _DefaultAllureStore_environment = new WeakMap(), _DefaultAllureStore_environmentsConfig = new WeakMap(), _DefaultAllureStore_reportVariables = new WeakMap(), _DefaultAllureStore_realtimeDispatcher = new WeakMap(), _DefaultAllureStore_realtimeSubscriber = new WeakMap(), _DefaultAllureStore_allowedEnvironmentIds = new WeakMap(), _DefaultAllureStore_retrySubstore = new WeakMap(), _DefaultAllureStore_testResultIdsByEnvironmentId = new WeakMap(), _DefaultAllureStore_cachedEnvironmentEntries = new WeakMap(), _DefaultAllureStore_globalAttachmentIds = new WeakMap(), _DefaultAllureStore_globalAttachmentIdsByEnv = new WeakMap(), _DefaultAllureStore_globalErrors = new WeakMap(), _DefaultAllureStore_globalErrorsByEnv = new WeakMap(), _DefaultAllureStore_globalExitCode = new WeakMap(), _DefaultAllureStore_checkResults = new WeakMap(), _DefaultAllureStore_qualityGateResults = new WeakMap(), _DefaultAllureStore_historyPoints = new WeakMap(), _DefaultAllureStore_environments = new WeakMap(), _DefaultAllureStore_instances = new WeakSet(), _DefaultAllureStore_mergeEnvironmentIdentity = function _DefaultAllureStore_mergeEnvironmentIdentity(existingEnvironment, incomingEnvironment) {
990
+ _DefaultAllureStore_testResults = new WeakMap(), _DefaultAllureStore_environmentDisplayNames = new WeakMap(), _DefaultAllureStore_environmentNameToId = new WeakMap(), _DefaultAllureStore_attachments = new WeakMap(), _DefaultAllureStore_attachmentContents = new WeakMap(), _DefaultAllureStore_testCases = new WeakMap(), _DefaultAllureStore_metadata = new WeakMap(), _DefaultAllureStore_history = new WeakMap(), _DefaultAllureStore_known = new WeakMap(), _DefaultAllureStore_fixtures = new WeakMap(), _DefaultAllureStore_defaultLabels = new WeakMap(), _DefaultAllureStore_environment = new WeakMap(), _DefaultAllureStore_environmentsConfig = new WeakMap(), _DefaultAllureStore_reportVariables = new WeakMap(), _DefaultAllureStore_realtimeDispatcher = new WeakMap(), _DefaultAllureStore_realtimeSubscriber = new WeakMap(), _DefaultAllureStore_allowedEnvironmentIds = new WeakMap(), _DefaultAllureStore_retrySubstore = new WeakMap(), _DefaultAllureStore_testResultIdsByEnvironmentId = new WeakMap(), _DefaultAllureStore_cachedEnvironmentEntries = new WeakMap(), _DefaultAllureStore_globalAttachmentIds = new WeakMap(), _DefaultAllureStore_globalAttachmentIdsByEnv = new WeakMap(), _DefaultAllureStore_globalErrors = new WeakMap(), _DefaultAllureStore_globalErrorsByEnv = new WeakMap(), _DefaultAllureStore_globalExitCode = new WeakMap(), _DefaultAllureStore_checkResultsById = new WeakMap(), _DefaultAllureStore_qualityGateResults = new WeakMap(), _DefaultAllureStore_historyPoints = new WeakMap(), _DefaultAllureStore_environments = new WeakMap(), _DefaultAllureStore_instances = new WeakSet(), _DefaultAllureStore_mergeEnvironmentIdentity = function _DefaultAllureStore_mergeEnvironmentIdentity(existingEnvironment, incomingEnvironment) {
1001
991
  const configuredEnvironment = environmentIdentityById(__classPrivateFieldGet(this, _DefaultAllureStore_environmentsConfig, "f"), incomingEnvironment.id);
1002
992
  if (configuredEnvironment) {
1003
993
  return configuredEnvironment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/core",
3
- "version": "3.12.0",
3
+ "version": "3.13.1",
4
4
  "description": "Collection of generic Allure utilities used across the entire project",
5
5
  "keywords": [
6
6
  "allure"
@@ -25,25 +25,25 @@
25
25
  "lint:fix": "oxlint --import-plugin --fix src test features stories"
26
26
  },
27
27
  "dependencies": {
28
- "@allurereport/ci": "3.12.0",
29
- "@allurereport/core-api": "3.12.0",
30
- "@allurereport/plugin-agent": "3.12.0",
31
- "@allurereport/plugin-allure2": "3.12.0",
32
- "@allurereport/plugin-api": "3.12.0",
33
- "@allurereport/plugin-awesome": "3.12.0",
34
- "@allurereport/plugin-classic": "3.12.0",
35
- "@allurereport/plugin-csv": "3.12.0",
36
- "@allurereport/plugin-dashboard": "3.12.0",
37
- "@allurereport/plugin-jira": "3.12.0",
38
- "@allurereport/plugin-log": "3.12.0",
39
- "@allurereport/plugin-progress": "3.12.0",
40
- "@allurereport/plugin-slack": "3.12.0",
41
- "@allurereport/plugin-testops": "3.12.0",
42
- "@allurereport/plugin-testplan": "3.12.0",
43
- "@allurereport/reader": "3.12.0",
44
- "@allurereport/reader-api": "3.12.0",
45
- "@allurereport/service": "3.12.0",
46
- "@allurereport/summary": "3.12.0",
28
+ "@allurereport/ci": "3.13.1",
29
+ "@allurereport/core-api": "3.13.1",
30
+ "@allurereport/plugin-agent": "3.13.1",
31
+ "@allurereport/plugin-allure2": "3.13.1",
32
+ "@allurereport/plugin-api": "3.13.1",
33
+ "@allurereport/plugin-awesome": "3.13.1",
34
+ "@allurereport/plugin-classic": "3.13.1",
35
+ "@allurereport/plugin-csv": "3.13.1",
36
+ "@allurereport/plugin-dashboard": "3.13.1",
37
+ "@allurereport/plugin-jira": "3.13.1",
38
+ "@allurereport/plugin-log": "3.13.1",
39
+ "@allurereport/plugin-progress": "3.13.1",
40
+ "@allurereport/plugin-slack": "3.13.1",
41
+ "@allurereport/plugin-testops": "3.13.1",
42
+ "@allurereport/plugin-testplan": "3.13.1",
43
+ "@allurereport/reader": "3.13.1",
44
+ "@allurereport/reader-api": "3.13.1",
45
+ "@allurereport/service": "3.13.1",
46
+ "@allurereport/summary": "3.13.1",
47
47
  "glob": "^13.0.6",
48
48
  "handlebars": "^4.7.9",
49
49
  "node-stream-zip": "^1.15.0",