@allurereport/plugin-api 3.16.1 → 3.17.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/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AllureServiceConfig, CategoriesConfig, DefaultLabelsConfig, EnvironmentsConfig, ReportVariables, ResolutionsConfig } from "@allurereport/core-api";
1
+ import type { AllureServiceConfig, CategoriesConfig, DefaultLabelsConfig, EnvironmentsConfig, PerformanceConfig, ReportVariables, ResolutionsConfig } from "@allurereport/core-api";
2
2
  import type { PluginDescriptor } from "./plugin.js";
3
3
  import type { QualityGateConfig } from "./qualityGate.js";
4
4
  export interface Config {
@@ -19,6 +19,7 @@ export interface Config {
19
19
  plugins?: Record<string, PluginDescriptor>;
20
20
  appendHistory?: boolean;
21
21
  qualityGate?: QualityGateConfig;
22
+ performance?: PerformanceConfig;
22
23
  allureService?: AllureServiceConfig;
23
24
  categories?: CategoriesConfig;
24
25
  globalAttachments?: string[];
package/dist/plugin.d.ts CHANGED
@@ -34,7 +34,7 @@ export interface PluginContext {
34
34
  categories?: CategoryDefinition[];
35
35
  history?: AllureHistory;
36
36
  }
37
- export type TestResultSummary = Pick<TestResult, "id" | "name" | "duration" | "status">;
37
+ export type TestResultSummary = Pick<TestResult, "id" | "name" | "duration" | "environment" | "status">;
38
38
  export interface TestResultRegistry {
39
39
  byId: Record<string, TestResultSummary>;
40
40
  }
@@ -1,4 +1,4 @@
1
- import type { TestResult } from "@allurereport/core-api";
1
+ import type { MetricSample, TestResult } from "@allurereport/core-api";
2
2
  export type QualityGateValidationResult = {
3
3
  success: boolean;
4
4
  expected: any;
@@ -13,27 +13,34 @@ export type QualityGateRules = Record<string, any> & {
13
13
  fastFail?: boolean;
14
14
  filter?: (tr: TestResult) => boolean;
15
15
  };
16
- export type QualityGateRuleResult = {
16
+ export type QualityGateRuleResult<T = unknown> = {
17
17
  success: boolean;
18
- actual: any;
18
+ actual: T;
19
19
  testResults: string[];
20
20
  };
21
- export interface QualityGateRuleState<T> {
22
- getResult(): T | undefined;
23
- setResult(value: T, testResults: QualityGateRuleResult["testResults"]): void;
21
+ export interface QualityGateRuleState {
22
+ getResult(): unknown;
23
+ setResult(value: unknown, testResults: string[]): void;
24
24
  }
25
- export type QualityGateRule<T = any, K = T> = {
25
+ export type QualityGateMetricHistoryPoint = {
26
+ uuid?: string;
27
+ timestamp?: number;
28
+ metrics?: Record<string, number>;
29
+ };
30
+ export type QualityGateRule<T = unknown, K = T> = {
26
31
  rule: string;
27
32
  message: (payload: {
28
33
  expected: T;
29
- actual: T;
34
+ actual: K;
30
35
  }) => string;
31
36
  validate: (payload: {
32
37
  expected: T;
33
38
  trs: TestResult[];
34
- state: QualityGateRuleState<K>;
39
+ state: QualityGateRuleState;
40
+ metrics?: MetricSample[];
41
+ previousHistory?: QualityGateMetricHistoryPoint[];
35
42
  environment?: string;
36
- }) => Promise<QualityGateRuleResult>;
43
+ }) => Promise<QualityGateRuleResult<K>>;
37
44
  };
38
45
  export type QualityGateConfig = {
39
46
  rules?: QualityGateRules[];
package/dist/report.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AttachmentTestStepResult, CiDescriptor, DefaultTreeGroup, HistoryTestResult, TestFixtureResult, TestResult, TestStatus, TestStepResult, TreeData, WithChildren } from "@allurereport/core-api";
1
+ import type { AttachmentTestStepResult, CiDescriptor, DefaultTreeGroup, HistoryTestResult, ResolutionCategory, ResolutionIssue, TestFixtureResult, TestResult, TestStatus, TestStepResult, TreeData, WithChildren } from "@allurereport/core-api";
2
2
  import type { QualityGateValidationResult } from "./qualityGate.js";
3
3
  export type Layout = "base" | "split";
4
4
  export type StepTreeExpansion = "collapsed" | "expand_failed_only" | "expanded";
@@ -74,13 +74,14 @@ export type ReportTestResult = Omit<TestResult, "runSelector" | "sourceMetadata"
74
74
  retry: boolean;
75
75
  categories?: ReportCategory[];
76
76
  environment?: string | "default";
77
+ resolutionIssue?: ResolutionIssue;
77
78
  tooltips?: Record<string, string>;
78
79
  time?: Record<string, string[]>;
79
80
  extra?: {
80
81
  severity: string;
81
82
  };
82
83
  };
83
- export type ReportTreeLeaf = Pick<ReportTestResult, "duration" | "name" | "start" | "status" | "groupOrder" | "flaky" | "transition" | "retry" | "retriesCount"> & {
84
+ export type ReportTreeLeaf = Pick<ReportTestResult, "duration" | "name" | "start" | "status" | "groupOrder" | "flaky" | "transition" | "retry" | "retriesCount" | "resolution"> & {
84
85
  nodeId: string;
85
86
  id?: string;
86
87
  transitionTooltip?: string;
@@ -110,6 +111,20 @@ export type ReportSearchDocument = {
110
111
  statusMessage?: string;
111
112
  links?: string;
112
113
  };
114
+ export type ReportResolutionTestResult = Pick<ReportTreeLeaf, "nodeId" | "id" | "name" | "status" | "duration" | "flaky" | "transition" | "retry" | "retriesCount" | "resolution" | "tooltips"> & {
115
+ groupOrder?: number;
116
+ };
117
+ export type ReportResolutionGroup = {
118
+ id: string;
119
+ resolution: ResolutionCategory;
120
+ name: string;
121
+ comment?: string;
122
+ issue?: ResolutionIssue;
123
+ testResults: ReportResolutionTestResult[];
124
+ };
125
+ export type ReportResolutionCategories = {
126
+ groups: ReportResolutionGroup[];
127
+ };
113
128
  export type ReportRecursiveTree = DefaultTreeGroup & {
114
129
  nodeId: string;
115
130
  leaves: ReportTreeLeaf[];
package/dist/store.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AllureCheckResult, AttachmentLink, EnvironmentIdentity, GlobalAttachmentLink, HistoryDataPoint, HistoryTestResult, ResolutionIssue, ReportVariables, Statistic, TestCase, TestEnvGroup, TestError, TestFixtureResult, TestResult } from "@allurereport/core-api";
1
+ import type { AllureCheckResult, AttachmentLink, EnvironmentIdentity, GlobalAttachmentLink, HistoryDataPoint, HistoryTestResult, ResolutionIssue, MetricSample, ReportVariables, Statistic, TestCase, TestEnvGroup, TestError, TestFixtureResult, TestResult } from "@allurereport/core-api";
2
2
  import type { ExitCode, PluginGlobalError } from "./plugin.js";
3
3
  import type { QualityGateValidationResult } from "./qualityGate.js";
4
4
  import type { ResultFile } from "./resultFile.js";
@@ -24,6 +24,7 @@ export interface AllureStore {
24
24
  allResolutionIssues: () => Promise<ResolutionIssue[]>;
25
25
  resolutionIssueByTestResultId: (trId: string) => Promise<ResolutionIssue | undefined>;
26
26
  testResultsByResolutionIssueId: (resolutionIssueId: string) => Promise<TestResult[]>;
27
+ allMetrics: () => Promise<MetricSample[]>;
27
28
  allNewTestResults: (filter?: TestResultFilter, history?: HistoryDataPoint[]) => Promise<TestResult[]>;
28
29
  addCheckResult: (result: AllureCheckResult) => Promise<void>;
29
30
  allCheckResults: () => Promise<AllureCheckResult[]>;
@@ -81,6 +82,7 @@ export interface AllureStoreDump {
81
82
  reportVariables: ReportVariables;
82
83
  resolutionIssues: Record<string, ResolutionIssue>;
83
84
  qualityGateResults: QualityGateValidationResult[];
85
+ metrics?: MetricSample[];
84
86
  indexAttachmentByTestResult: Record<string, string[]>;
85
87
  indexTestResultByHistoryId: Record<string, string[]>;
86
88
  indexTestResultByTestCase: Record<string, string[]>;
@@ -107,5 +109,6 @@ export declare enum AllureStoreDumpFiles {
107
109
  IndexAttachmentsByFixture = "index-attachments-by-fixture.json",
108
110
  IndexFixturesByTestResult = "index-fixtures-by-test-result.json",
109
111
  QualityGateResults = "quality-gate-results.json",
110
- TestResultIngestOrder = "test-result-ingest-order.json"
112
+ TestResultIngestOrder = "test-result-ingest-order.json",
113
+ Metrics = "metrics.json"
111
114
  }
package/dist/store.js CHANGED
@@ -18,4 +18,5 @@ export var AllureStoreDumpFiles;
18
18
  AllureStoreDumpFiles["IndexFixturesByTestResult"] = "index-fixtures-by-test-result.json";
19
19
  AllureStoreDumpFiles["QualityGateResults"] = "quality-gate-results.json";
20
20
  AllureStoreDumpFiles["TestResultIngestOrder"] = "test-result-ingest-order.json";
21
+ AllureStoreDumpFiles["Metrics"] = "metrics.json";
21
22
  })(AllureStoreDumpFiles || (AllureStoreDumpFiles = {}));
@@ -4,6 +4,7 @@ export const convertToTestResultSummary = (tr) => ({
4
4
  name: tr.name,
5
5
  duration: tr.duration,
6
6
  status: tr.status,
7
+ ...(tr.environment ? { environment: tr.environment } : {}),
7
8
  });
8
9
  export const createTestResultRegistry = (testResults) => ({
9
10
  byId: Object.fromEntries(testResults.map((testResult) => [testResult.id, convertToTestResultSummary(testResult)])),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-api",
3
- "version": "3.16.1",
3
+ "version": "3.17.0",
4
4
  "description": "Allure Plugin API",
5
5
  "keywords": [
6
6
  "allure"
@@ -29,7 +29,7 @@
29
29
  "lint:fix": "oxlint --import-plugin --fix src test features stories"
30
30
  },
31
31
  "dependencies": {
32
- "@allurereport/core-api": "3.16.1",
32
+ "@allurereport/core-api": "3.17.0",
33
33
  "tar-stream": "3.1.7"
34
34
  },
35
35
  "devDependencies": {