@allurereport/plugin-api 3.0.0-beta.17 → 3.0.0-beta.19

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 (40) hide show
  1. package/dist/charts/accessors/coverageDiffTreeMapAccessor.d.ts +17 -0
  2. package/dist/charts/accessors/coverageDiffTreeMapAccessor.js +181 -0
  3. package/dist/charts/accessors/problemsDistributionHeatMap.d.ts +2 -0
  4. package/dist/charts/accessors/problemsDistributionHeatMap.js +65 -0
  5. package/dist/charts/accessors/severityTrendAccessor.d.ts +3 -0
  6. package/dist/charts/accessors/severityTrendAccessor.js +21 -0
  7. package/dist/charts/accessors/statusBySeverityBarAccessor.d.ts +3 -0
  8. package/dist/charts/accessors/statusBySeverityBarAccessor.js +33 -0
  9. package/dist/charts/accessors/statusChangeTrendBarAccessor.d.ts +4 -0
  10. package/dist/charts/accessors/statusChangeTrendBarAccessor.js +92 -0
  11. package/dist/charts/accessors/statusTrendAccessor.d.ts +3 -0
  12. package/dist/charts/accessors/statusTrendAccessor.js +19 -0
  13. package/dist/charts/accessors/statusTrendBarAccessor.d.ts +5 -0
  14. package/dist/charts/accessors/statusTrendBarAccessor.js +63 -0
  15. package/dist/charts/accessors/successRateDistributionTreeMapAccessor.d.ts +14 -0
  16. package/dist/charts/accessors/successRateDistributionTreeMapAccessor.js +111 -0
  17. package/dist/charts/accessors/utils/behavior.d.ts +5 -0
  18. package/dist/charts/accessors/utils/behavior.js +4 -0
  19. package/dist/charts/bar.d.ts +3 -0
  20. package/dist/charts/bar.js +50 -0
  21. package/dist/charts/comingSoon.d.ts +2 -0
  22. package/dist/charts/comingSoon.js +7 -0
  23. package/dist/charts/heatmap.d.ts +3 -0
  24. package/dist/charts/heatmap.js +9 -0
  25. package/dist/charts/line.d.ts +8 -0
  26. package/dist/charts/line.js +140 -0
  27. package/dist/charts/pie.d.ts +6 -0
  28. package/dist/charts/pie.js +10 -0
  29. package/dist/charts/treeMap.d.ts +6 -0
  30. package/dist/charts/treeMap.js +88 -0
  31. package/dist/charts.d.ts +130 -0
  32. package/dist/charts.js +83 -0
  33. package/dist/config.d.ts +3 -1
  34. package/dist/index.d.ts +8 -1
  35. package/dist/index.js +8 -0
  36. package/dist/plugin.d.ts +30 -6
  37. package/dist/qualityGate.d.ts +28 -37
  38. package/dist/store.d.ts +41 -1
  39. package/dist/store.js +18 -1
  40. package/package.json +3 -3
@@ -1,44 +1,35 @@
1
- import type { AllureStore } from "./store.js";
2
- export type QualityGateRules = Record<string, any>;
3
- export type QualityGateRulesBaseMeta<T> = {
4
- type: T;
5
- };
6
- export type QualityGateLabelsRulesMeta = QualityGateRulesBaseMeta<"label"> & {
7
- name: string;
8
- value: string;
9
- };
10
- export type QualityGateParametersRulesMeta = QualityGateRulesBaseMeta<"parameter"> & {
11
- name: string;
12
- value: string;
13
- };
14
- export type QualityGateLabelsEnforceConfig = {
15
- type: "label";
16
- name: string;
17
- value: string;
18
- rules: QualityGateRules;
1
+ import type { KnownTestFailure, TestResult } from "@allurereport/core-api";
2
+ export type QualityGateValidationResult = {
3
+ success: boolean;
4
+ expected: any;
5
+ actual: any;
6
+ rule: string;
7
+ message: string;
19
8
  };
20
- export type QualityGateParametersEnforceConfig = {
21
- type: "parameter";
22
- name: string;
23
- value: string;
24
- rules: QualityGateRules;
9
+ export type QualityGateRules = Record<string, any> & {
10
+ id?: string;
11
+ fastFail?: boolean;
12
+ filter?: (tr: TestResult) => boolean;
25
13
  };
26
- export type QualityGateRulesMeta = Omit<QualityGateLabelsRulesMeta, "rules"> | Omit<QualityGateParametersRulesMeta, "rules">;
27
- export type QualityGateEnforceConfig = QualityGateLabelsEnforceConfig | QualityGateParametersEnforceConfig;
28
- export type QualityGateValidationResult = {
14
+ export type QualityGateRuleResult = {
29
15
  success: boolean;
16
+ expected: any;
17
+ actual: any;
18
+ };
19
+ export type QualityGateRule<T = any> = {
30
20
  rule: string;
31
- meta?: QualityGateRulesMeta;
32
- expected?: number;
33
- actual?: number;
34
- message?: string;
21
+ message: (payload: {
22
+ expected: T;
23
+ actual: T;
24
+ }) => string;
25
+ validate: (payload: {
26
+ expected: T;
27
+ trs: TestResult[];
28
+ knownIssues: KnownTestFailure[];
29
+ state?: T;
30
+ }) => Promise<QualityGateRuleResult>;
35
31
  };
36
- export interface QualityGateValidator {
37
- validate(store: AllureStore): Promise<QualityGateValidationResult>;
38
- }
39
- export type QualityGateValidatorConstructor = new (limit: number, meta?: QualityGateRulesMeta) => QualityGateValidator;
40
32
  export type QualityGateConfig = {
41
- rules?: QualityGateRules;
42
- enforce?: QualityGateEnforceConfig[];
43
- validators?: Record<string, QualityGateValidatorConstructor>;
33
+ rules?: QualityGateRules[];
34
+ use?: QualityGateRule[];
44
35
  };
package/dist/store.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import type { AttachmentLink, HistoryDataPoint, HistoryTestResult, KnownTestFailure, Statistic, TestCase, TestEnvGroup, TestFixtureResult, TestResult } from "@allurereport/core-api";
1
+ import type { AttachmentLink, HistoryDataPoint, HistoryTestResult, KnownTestFailure, ReportVariables, Statistic, TestCase, TestEnvGroup, TestError, TestFixtureResult, TestResult } from "@allurereport/core-api";
2
+ import type { ExitCode } from "./plugin.js";
3
+ import type { QualityGateValidationResult } from "./qualityGate.js";
2
4
  import type { ResultFile } from "./resultFile.js";
3
5
  export type TestResultFilter = (testResult: TestResult) => boolean;
4
6
  export interface AllureStore {
@@ -12,6 +14,10 @@ export interface AllureStore {
12
14
  allHistoryDataPoints: () => Promise<HistoryDataPoint[]>;
13
15
  allKnownIssues: () => Promise<KnownTestFailure[]>;
14
16
  allNewTestResults: () => Promise<TestResult[]>;
17
+ qualityGateResults: () => Promise<QualityGateValidationResult[]>;
18
+ globalExitCode: () => Promise<ExitCode | undefined>;
19
+ allGlobalErrors: () => Promise<TestError[]>;
20
+ allGlobalAttachments: () => Promise<AttachmentLink[]>;
15
21
  testCaseById: (tcId: string) => Promise<TestCase | undefined>;
16
22
  testResultById: (trId: string) => Promise<TestResult | undefined>;
17
23
  attachmentById: (attachmentId: string) => Promise<AttachmentLink | undefined>;
@@ -35,3 +41,37 @@ export interface AllureStore {
35
41
  allVariables: () => Promise<Record<string, any>>;
36
42
  envVariables: (env: string) => Promise<Record<string, any>>;
37
43
  }
44
+ export interface AllureStoreDump {
45
+ testResults: Record<string, TestResult>;
46
+ attachments: Record<string, AttachmentLink>;
47
+ globalAttachments: AttachmentLink[];
48
+ globalErrors: TestError[];
49
+ testCases: Record<string, TestCase>;
50
+ fixtures: Record<string, TestFixtureResult>;
51
+ environments: string[];
52
+ reportVariables: ReportVariables;
53
+ indexAttachmentByTestResult: Record<string, string[]>;
54
+ indexTestResultByHistoryId: Record<string, string[]>;
55
+ indexTestResultByTestCase: Record<string, string[]>;
56
+ indexLatestEnvTestResultByHistoryId: Record<string, string>;
57
+ indexAttachmentByFixture: Record<string, string[]>;
58
+ indexFixturesByTestResult: Record<string, string[]>;
59
+ indexKnownByHistoryId: Record<string, KnownTestFailure[]>;
60
+ }
61
+ export declare enum AllureStoreDumpFiles {
62
+ TestResults = "test-results.json",
63
+ TestCases = "test-cases.json",
64
+ Fixtures = "fixtures.json",
65
+ GlobalErrors = "global-errors.json",
66
+ GlobalAttachments = "global-attachments.json",
67
+ Attachments = "attachments.json",
68
+ Environments = "environments.json",
69
+ ReportVariables = "report-variables.json",
70
+ IndexAttachmentsByTestResults = "index-attachments-by-test-results.json",
71
+ IndexTestResultsByHistoryId = "index-test-results-by-history-id.json",
72
+ IndexTestResultsByTestCase = "index-test-results-by-test-case.json",
73
+ IndexLatestEnvTestResultsByHistoryId = "index-latest-env-test-results-by-history-id.json",
74
+ IndexAttachmentsByFixture = "index-attachments-by-fixture.json",
75
+ IndexFixturesByTestResult = "index-fixtures-by-test-result.json",
76
+ IndexKnownByHistoryId = "index-known-by-history-id.json"
77
+ }
package/dist/store.js CHANGED
@@ -1 +1,18 @@
1
- export {};
1
+ export var AllureStoreDumpFiles;
2
+ (function (AllureStoreDumpFiles) {
3
+ AllureStoreDumpFiles["TestResults"] = "test-results.json";
4
+ AllureStoreDumpFiles["TestCases"] = "test-cases.json";
5
+ AllureStoreDumpFiles["Fixtures"] = "fixtures.json";
6
+ AllureStoreDumpFiles["GlobalErrors"] = "global-errors.json";
7
+ AllureStoreDumpFiles["GlobalAttachments"] = "global-attachments.json";
8
+ AllureStoreDumpFiles["Attachments"] = "attachments.json";
9
+ AllureStoreDumpFiles["Environments"] = "environments.json";
10
+ AllureStoreDumpFiles["ReportVariables"] = "report-variables.json";
11
+ AllureStoreDumpFiles["IndexAttachmentsByTestResults"] = "index-attachments-by-test-results.json";
12
+ AllureStoreDumpFiles["IndexTestResultsByHistoryId"] = "index-test-results-by-history-id.json";
13
+ AllureStoreDumpFiles["IndexTestResultsByTestCase"] = "index-test-results-by-test-case.json";
14
+ AllureStoreDumpFiles["IndexLatestEnvTestResultsByHistoryId"] = "index-latest-env-test-results-by-history-id.json";
15
+ AllureStoreDumpFiles["IndexAttachmentsByFixture"] = "index-attachments-by-fixture.json";
16
+ AllureStoreDumpFiles["IndexFixturesByTestResult"] = "index-fixtures-by-test-result.json";
17
+ AllureStoreDumpFiles["IndexKnownByHistoryId"] = "index-known-by-history-id.json";
18
+ })(AllureStoreDumpFiles || (AllureStoreDumpFiles = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-api",
3
- "version": "3.0.0-beta.17",
3
+ "version": "3.0.0-beta.19",
4
4
  "description": "Allure Plugin API",
5
5
  "keywords": [
6
6
  "allure"
@@ -26,7 +26,7 @@
26
26
  "test": "rimraf ./out && vitest run"
27
27
  },
28
28
  "dependencies": {
29
- "@allurereport/core-api": "3.0.0-beta.17"
29
+ "@allurereport/core-api": "3.0.0-beta.19"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@stylistic/eslint-plugin": "^2.6.1",
@@ -36,7 +36,7 @@
36
36
  "@typescript-eslint/parser": "^8.0.0",
37
37
  "@vitest/runner": "^2.1.9",
38
38
  "@vitest/snapshot": "^2.1.9",
39
- "allure-vitest": "^3.3.0",
39
+ "allure-vitest": "^3.3.3",
40
40
  "eslint": "^8.57.0",
41
41
  "eslint-config-prettier": "^9.1.0",
42
42
  "eslint-plugin-import": "^2.29.1",