allure-js-commons 3.6.0 → 3.7.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/README.md +176 -6
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/testplan.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils/envInfo.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils/labels.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/MessageWriter.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/testplan.js.map +1 -1
- package/dist/esm/sdk/reporter/utils/envInfo.js +1 -0
- package/dist/esm/sdk/reporter/utils/envInfo.js.map +1 -1
- package/dist/esm/sdk/reporter/utils/labels.js.map +1 -1
- package/dist/esm/sdk/reporter/utils.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/MessageWriter.js.map +1 -1
- package/dist/types/facade.d.ts +1 -0
- package/dist/types/model.d.ts +1 -0
- package/dist/types/sdk/reporter/ReporterRuntime.d.ts +1 -0
- package/dist/types/sdk/reporter/types.d.ts +1 -0
- package/dist/types/sdk/reporter/writer/FileSystemWriter.d.ts +1 -0
- package/dist/types/sdk/reporter/writer/InMemoryWriter.d.ts +1 -0
- package/dist/types/sdk/reporter/writer/MessageWriter.d.ts +1 -0
- package/dist/types/sdk/runtime/MessageTestRuntime.d.ts +1 -0
- package/dist/types/sdk/runtime/types.d.ts +1 -0
- package/dist/types/sdk/types.d.ts +1 -0
- package/package.json +24 -35
package/README.md
CHANGED
|
@@ -12,15 +12,185 @@
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
There you can find primitives to create custom integrations for the javascript testing frameworks.
|
|
15
|
+
`allure-js-commons` is the shared runtime API and reporter SDK used by the packages in this repository. It gives you both:
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
- a high-level facade for test code, such as `allure.step()`, `allure.attachment()`, `allure.owner()`, and `allure.epic()`
|
|
18
|
+
- low-level building blocks for custom integrations, such as `ReporterRuntime`, writers, runtime message transport, and result model factories
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Use it when you want to:
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
- enrich tests with Allure metadata from JavaScript or TypeScript
|
|
23
|
+
- write your own test framework integration
|
|
24
|
+
- build a custom adapter that emits standard `allure-results`
|
|
25
|
+
- reuse the same reporting model across multiple runners or tools
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
Install the package with your package manager of choice:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install -D allure-js-commons
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If you are building a custom integration, install your framework alongside it and add Allure Report separately when you want to render results:
|
|
36
|
+
|
|
37
|
+
- follow the [Allure Report 2 installation guide](https://allurereport.org/docs/install/) to use the `allure` CLI
|
|
38
|
+
- or install Allure Report 3 with `npm install -D allure` to use `npx allure`
|
|
39
|
+
|
|
40
|
+
## View the report
|
|
41
|
+
|
|
42
|
+
If your integration writes `./allure-results`, you can render it with either report generator.
|
|
43
|
+
|
|
44
|
+
Use Allure Report 2:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
allure generate ./allure-results -o ./allure-report
|
|
48
|
+
allure open ./allure-report
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or use Allure Report 3:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx allure generate ./allure-results
|
|
55
|
+
npx allure open ./allure-report
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Supported versions and platforms
|
|
59
|
+
|
|
60
|
+
- works in Node.js environments on Linux, macOS, and Windows
|
|
61
|
+
- used by the official integrations in this repository, which are validated in CI on Node.js 20 and 22
|
|
62
|
+
- intended for frameworks and tooling that can produce or consume Allure runtime messages and result files
|
|
63
|
+
|
|
64
|
+
## Overview
|
|
65
|
+
|
|
66
|
+
### High-level facade
|
|
67
|
+
|
|
68
|
+
The package root exports the API used directly inside tests:
|
|
69
|
+
|
|
70
|
+
- labels and links: `epic`, `feature`, `story`, `owner`, `severity`, `issue`, `tms`, `tag`
|
|
71
|
+
- descriptions and identifiers: `description`, `descriptionHtml`, `displayName`, `historyId`, `testCaseId`
|
|
72
|
+
- execution details: `parameter`, `step`, `logStep`
|
|
73
|
+
- attachments: `attachment`, `attachmentPath`, `globalAttachment`, `globalAttachmentPath`
|
|
74
|
+
|
|
75
|
+
These helpers delegate to the active test runtime, which integrations register with `setGlobalTestRuntime()`.
|
|
76
|
+
|
|
77
|
+
### Reporter SDK
|
|
78
|
+
|
|
79
|
+
The `allure-js-commons/sdk` entry points expose the pieces used by official integrations:
|
|
80
|
+
|
|
81
|
+
- `sdk/runtime`: runtime message transport and global runtime registration
|
|
82
|
+
- `sdk/reporter`: `ReporterRuntime`, writers, result factories, categories, environment info, and helper utilities
|
|
83
|
+
- `sdk`: shared types, runtime message definitions, serialization helpers, and metadata parsing helpers
|
|
84
|
+
|
|
85
|
+
## Basic usage in tests
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import * as allure from "allure-js-commons";
|
|
89
|
+
|
|
90
|
+
await allure.epic("Authentication");
|
|
91
|
+
await allure.feature("Password sign-in");
|
|
92
|
+
await allure.owner("qa-team");
|
|
93
|
+
await allure.parameter("browser", "chromium");
|
|
94
|
+
|
|
95
|
+
await allure.step("Submit valid credentials", async () => {
|
|
96
|
+
await allure.attachment("request", JSON.stringify({ login: "jane" }), {
|
|
97
|
+
contentType: "application/json",
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Creating your own integration
|
|
103
|
+
|
|
104
|
+
The official adapters in this repository follow the same basic flow:
|
|
105
|
+
|
|
106
|
+
1. Create a `ReporterRuntime` with a writer that persists `allure-results`.
|
|
107
|
+
2. Register a test runtime with `setGlobalTestRuntime()` so `allure-js-commons` calls inside tests can emit runtime messages.
|
|
108
|
+
3. Map your framework lifecycle events to `startTest`, `updateTest`, `stopTest`, `writeTest`, and optional scope or fixture methods.
|
|
109
|
+
4. Forward runtime messages from the active test into `ReporterRuntime.applyRuntimeMessages()`.
|
|
110
|
+
|
|
111
|
+
Here is a minimal example:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import { Stage, Status } from "allure-js-commons";
|
|
115
|
+
import type { RuntimeMessage } from "allure-js-commons/sdk";
|
|
116
|
+
import { ReporterRuntime, createDefaultWriter } from "allure-js-commons/sdk/reporter";
|
|
117
|
+
import { MessageTestRuntime, setGlobalTestRuntime } from "allure-js-commons/sdk/runtime";
|
|
118
|
+
|
|
119
|
+
class MyFrameworkRuntime extends MessageTestRuntime {
|
|
120
|
+
constructor(private readonly forward: (message: RuntimeMessage) => void) {
|
|
121
|
+
super();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async sendMessage(message: RuntimeMessage) {
|
|
125
|
+
this.forward(message);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const reporterRuntime = new ReporterRuntime({
|
|
130
|
+
writer: createDefaultWriter({ resultsDir: "./allure-results" }),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
let currentTestUuid: string | undefined;
|
|
134
|
+
|
|
135
|
+
setGlobalTestRuntime(
|
|
136
|
+
new MyFrameworkRuntime((message) => {
|
|
137
|
+
if (currentTestUuid) {
|
|
138
|
+
reporterRuntime.applyRuntimeMessages(currentTestUuid, [message]);
|
|
139
|
+
} else {
|
|
140
|
+
reporterRuntime.applyGlobalRuntimeMessages([message]);
|
|
141
|
+
}
|
|
142
|
+
}),
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const onTestStart = (name: string, fullName: string) => {
|
|
146
|
+
currentTestUuid = reporterRuntime.startTest({
|
|
147
|
+
name,
|
|
148
|
+
fullName,
|
|
149
|
+
stage: Stage.RUNNING,
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const onTestPass = () => {
|
|
154
|
+
if (!currentTestUuid) return;
|
|
155
|
+
reporterRuntime.updateTest(currentTestUuid, (result) => {
|
|
156
|
+
result.status = Status.PASSED;
|
|
157
|
+
result.stage = Stage.FINISHED;
|
|
158
|
+
});
|
|
159
|
+
reporterRuntime.stopTest(currentTestUuid);
|
|
160
|
+
reporterRuntime.writeTest(currentTestUuid);
|
|
161
|
+
currentTestUuid = undefined;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const onTestFail = (error: Error) => {
|
|
165
|
+
if (!currentTestUuid) return;
|
|
166
|
+
reporterRuntime.updateTest(currentTestUuid, (result) => {
|
|
167
|
+
result.status = Status.BROKEN;
|
|
168
|
+
result.stage = Stage.FINISHED;
|
|
169
|
+
result.statusDetails = {
|
|
170
|
+
message: error.message,
|
|
171
|
+
trace: error.stack,
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
reporterRuntime.stopTest(currentTestUuid);
|
|
175
|
+
reporterRuntime.writeTest(currentTestUuid);
|
|
176
|
+
currentTestUuid = undefined;
|
|
177
|
+
};
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
This approach lets framework callbacks manage test lifecycle state while user code keeps using the regular `allure-js-commons` facade.
|
|
181
|
+
|
|
182
|
+
## Useful building blocks
|
|
183
|
+
|
|
184
|
+
- `ReporterRuntime`: creates and writes tests, fixtures, steps, attachments, categories, and environment info
|
|
185
|
+
- `createDefaultWriter()`: writes to `./allure-results` in normal runs and switches to a message writer in test mode
|
|
186
|
+
- `FileSystemWriter`, `InMemoryWriter`, `MessageWriter`, `MessageReader`: transport and persistence helpers
|
|
187
|
+
- `setGlobalTestRuntime()`: connects the facade API to the currently active framework runtime
|
|
188
|
+
- `MessageTestRuntime` and `MessageHolderTestRuntime`: ready-made runtime message implementations for adapters
|
|
189
|
+
- `createTestResult()`, `createStepResult()`, `createFixtureResult()`, `createTestResultContainer()`: factories for manual result construction
|
|
190
|
+
|
|
191
|
+
## Labels from environment variables
|
|
192
|
+
|
|
193
|
+
Allure allows you to apply labels to every test through environment variables. Use the `ALLURE_LABEL_<labelName>=<labelValue>` format.
|
|
24
194
|
|
|
25
195
|
#### Examples
|
|
26
196
|
|
|
@@ -7,9 +7,9 @@ exports.ShallowStepsStack = exports.ReporterRuntime = exports.DefaultStepStack =
|
|
|
7
7
|
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
8
8
|
var _path = require("path");
|
|
9
9
|
var _model = require("../../model.js");
|
|
10
|
+
var _factory = require("./factory.js");
|
|
10
11
|
var _LifecycleState = require("./LifecycleState.js");
|
|
11
12
|
var _Notifier = require("./Notifier.js");
|
|
12
|
-
var _factory = require("./factory.js");
|
|
13
13
|
var _testplan = require("./testplan.js");
|
|
14
14
|
var _utils = require("./utils.js");
|
|
15
15
|
var _attachments = require("./utils/attachments.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["_nodePath","_interopRequireDefault","require","_path","_model","_LifecycleState","_Notifier","_factory","_testplan","_utils","_attachments","_loader","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","set","has","TypeError","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","_classPrivateGetter","s","_assertClassBrand","_classPrivateFieldGet","get","n","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","currentStep","_get_currentStep","startStep","step","stepResult","createStepResult","steps","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","found","addAttachment","attachment","writer","isPath","path","fileExt","extname","fileName","buildAttachmentFileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","exports","_this","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_handleGlobalAttachmentContentMessage","_handleGlobalAttachmentPathMessage","_handleGlobalErrorMessage","_findParent","_writeAttachmentFile","_createAttachment","_createGlobalAttachment","_writeGlobals","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","randomUuid","state","setScope","scope","getScope","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","Stage","FINISHED","scopeUuids","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","wrapInStep","timestamp","name","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","source","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","status","statusDetails","Buffer","from","content","encoding","attachmentContent","attachmentSource","errors","_message$fileExtensio","root","getExecutionItem","globals","writeGlobals","_ref2","writtenFixtures","Set","deleteFixtureResult","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","Array","isArray","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Globals,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = stop ?? result.start ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = this.#writeAttachmentFile(attachmentContentOrPath, {\n ...options,\n fileExtension: options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined),\n });\n const attachment = this.#createAttachment(attachmentName, options.contentType, attachmentFileName);\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n return;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n return;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n applyGlobalRuntimeMessages = (messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n break;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n break;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n break;\n default:\n break;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleGlobalAttachmentContentMessage = (message: RuntimeGlobalAttachmentContentMessage[\"data\"]) => {\n const attachmentContent = Buffer.from(message.content, message.encoding);\n const attachmentSource = this.#writeAttachmentFile(attachmentContent, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalAttachmentPathMessage = (message: RuntimeGlobalAttachmentPathMessage[\"data\"]) => {\n const attachmentSource = this.#writeAttachmentFile(message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension ?? extname(message.path),\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalErrorMessage = (message: RuntimeGlobalErrorMessage[\"data\"]) => {\n this.#writeGlobals({\n attachments: [],\n errors: [{ ...message, timestamp: Date.now() }],\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeAttachmentFile = (\n attachmentContentOrPath: Buffer | string,\n options: Pick<AttachmentOptions, \"contentType\" | \"fileExtension\">,\n ) => {\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n return attachmentFileName;\n };\n\n #createAttachment = (name: string, contentType: string, source: string): Attachment => ({\n name,\n source,\n type: contentType,\n });\n\n #createGlobalAttachment = (name: string, contentType: string, source: string): Globals[\"attachments\"][number] => ({\n ...this.#createAttachment(name, contentType, source),\n timestamp: Date.now(),\n });\n\n #writeGlobals = (globals: Globals): void => {\n this.writer.writeGlobals(`${randomUuid()}-globals.json`, globals);\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAwBA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AASA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAAmD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAA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K;IAEvB,IAAI4H,KAAK,CAACC,OAAO,CAAC5H,YAAY,CAAC,EAAE;MAC/B,IAAI,CAACA,YAAY,GAAGA,YAAY;IAClC,CAAC,MAAM,IAAI1H,MAAM,CAACC,IAAI,CAACyH,YAAY,CAAC,CAAC/G,MAAM,EAAE;MAC3C,IAAI,CAAC+G,YAAY,GAAG1H,MAAM,CAACuP,OAAO,CAAC7H,YAAY,CAAC,CAAC8H,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACrD,IAAI,EAAE1K,KAAK,CAAC,GAAA+N,KAAA;QACrE,IAAIJ,KAAK,CAACC,OAAO,CAAC5N,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAAC8K,GAAG,CAAEkD,CAAC,KAAM;YAAEtD,IAAI;YAAE1K,KAAK,EAAEgO;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLtD,IAAI;UACJ1K;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA8oBF;AAAC2D,OAAA,CAAA8B,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReporterRuntime.js","names":["_nodePath","_interopRequireDefault","require","_path","_model","_factory","_LifecycleState","_Notifier","_testplan","_utils","_attachments","_loader","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","set","has","TypeError","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","_classPrivateGetter","s","_assertClassBrand","_classPrivateFieldGet","get","n","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","currentStep","_get_currentStep","startStep","step","stepResult","createStepResult","steps","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","found","addAttachment","attachment","writer","isPath","path","fileExt","extname","fileName","buildAttachmentFileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","exports","_this","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_handleGlobalAttachmentContentMessage","_handleGlobalAttachmentPathMessage","_handleGlobalErrorMessage","_findParent","_writeAttachmentFile","_createAttachment","_createGlobalAttachment","_writeGlobals","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","randomUuid","state","setScope","scope","getScope","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","Stage","FINISHED","scopeUuids","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","wrapInStep","timestamp","name","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","source","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","status","statusDetails","Buffer","from","content","encoding","attachmentContent","attachmentSource","errors","_message$fileExtensio","root","getExecutionItem","globals","writeGlobals","_ref2","writtenFixtures","Set","deleteFixtureResult","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","Array","isArray","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\n\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Globals,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = (stop ?? result.start) ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = this.#writeAttachmentFile(attachmentContentOrPath, {\n ...options,\n fileExtension: options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined),\n });\n const attachment = this.#createAttachment(attachmentName, options.contentType, attachmentFileName);\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n return;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n return;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n applyGlobalRuntimeMessages = (messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n break;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n break;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n break;\n default:\n break;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleGlobalAttachmentContentMessage = (message: RuntimeGlobalAttachmentContentMessage[\"data\"]) => {\n const attachmentContent = Buffer.from(message.content, message.encoding);\n const attachmentSource = this.#writeAttachmentFile(attachmentContent, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalAttachmentPathMessage = (message: RuntimeGlobalAttachmentPathMessage[\"data\"]) => {\n const attachmentSource = this.#writeAttachmentFile(message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension ?? extname(message.path),\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalErrorMessage = (message: RuntimeGlobalErrorMessage[\"data\"]) => {\n this.#writeGlobals({\n attachments: [],\n errors: [{ ...message, timestamp: Date.now() }],\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeAttachmentFile = (\n attachmentContentOrPath: Buffer | string,\n options: Pick<AttachmentOptions, \"contentType\" | \"fileExtension\">,\n ) => {\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n return attachmentFileName;\n };\n\n #createAttachment = (name: string, contentType: string, source: string): Attachment => ({\n name,\n source,\n type: contentType,\n });\n\n #createGlobalAttachment = (name: string, contentType: string, source: string): Globals[\"attachments\"][number] => ({\n ...this.#createAttachment(name, contentType, source),\n timestamp: Date.now(),\n });\n\n #writeGlobals = (globals: Globals): void => {\n this.writer.writeGlobals(`${randomUuid()}-globals.json`, globals);\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAwBA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AASA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAAmD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ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H,MAAM,CAACuP,OAAO,CAAC7H,YAAY,CAAC,CAAC8H,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACrD,IAAI,EAAE1K,KAAK,CAAC,GAAA+N,KAAA;QACrE,IAAIJ,KAAK,CAACC,OAAO,CAAC5N,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAAC8K,GAAG,CAAEkD,CAAC,KAAM;YAAEtD,IAAI;YAAE1K,KAAK,EAAEgO;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLtD,IAAI;UACJ1K;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA8oBF;AAAC2D,OAAA,CAAA8B,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testplan.js","names":["_nodeFs","require","_utils","parseTestPlan","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","undefined","existsSync","console","error","file","readFileSync","testPlan","JSON","parse","tests","length","e","concat","exports","includedInTestPlan","subject","id","fullName","tags","effectiveId","map","tag","_tag$match","match","allureIdRegexp","groups","find","maybeId","some","test","idMatched","String","selectorMatched","selector","addSkipLabel","labels","push","name","value","addSkipLabelAsMeta","hasSkipLabel","_ref"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport type { Label } from \"../../model.js\";\nimport type { TestPlanV1 } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n if (!existsSync(testPlanPath)) {\n // eslint-disable-next-line no-console\n console.error(\"Test plan file is missing. Skipping test plan usage:\", testPlanPath);\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as TestPlanV1;\n\n // Execute all tests if test plan is empty\n if ((testPlan.tests || []).length === 0) {\n return undefined;\n }\n\n return testPlan;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not parse test plan ${testPlanPath}`, e);\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { id?: string; fullName?: string; tags?: string[] },\n): boolean => {\n const { id, fullName, tags = [] } = subject;\n const effectiveId =\n id ?? tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n return testPlan.tests.some((test) => {\n const idMatched = effectiveId && test.id ? String(test.id) === effectiveId : false;\n const selectorMatched = fullName && test.selector === fullName;\n\n return idMatched || selectorMatched;\n });\n};\n\nexport const addSkipLabel = (labels: Label[]) => {\n labels.push({ name: \"ALLURE_TESTPLAN_SKIP\", value: \"true\" });\n};\n\nexport const addSkipLabelAsMeta = (name: string) => {\n return `${name} @allure.label.ALLURE_TESTPLAN_SKIP:true`;\n};\n\nexport const hasSkipLabel = (labels: readonly Label[]) => labels.some(({ name }) => name === \"ALLURE_TESTPLAN_SKIP\");\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"file":"testplan.js","names":["_nodeFs","require","_utils","parseTestPlan","testPlanPath","process","env","ALLURE_TESTPLAN_PATH","undefined","existsSync","console","error","file","readFileSync","testPlan","JSON","parse","tests","length","e","concat","exports","includedInTestPlan","subject","id","fullName","tags","effectiveId","map","tag","_tag$match","match","allureIdRegexp","groups","find","maybeId","some","test","idMatched","String","selectorMatched","selector","addSkipLabel","labels","push","name","value","addSkipLabelAsMeta","hasSkipLabel","_ref"],"sources":["../../../../src/sdk/reporter/testplan.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\n\nimport type { Label } from \"../../model.js\";\nimport type { TestPlanV1 } from \"../types.js\";\nimport { allureIdRegexp } from \"../utils.js\";\n\nexport const parseTestPlan = (): TestPlanV1 | undefined => {\n const testPlanPath = process.env.ALLURE_TESTPLAN_PATH;\n\n if (!testPlanPath) {\n return undefined;\n }\n\n if (!existsSync(testPlanPath)) {\n // eslint-disable-next-line no-console\n console.error(\"Test plan file is missing. Skipping test plan usage:\", testPlanPath);\n return undefined;\n }\n\n try {\n const file = readFileSync(testPlanPath, \"utf8\");\n const testPlan = JSON.parse(file) as TestPlanV1;\n\n // Execute all tests if test plan is empty\n if ((testPlan.tests || []).length === 0) {\n return undefined;\n }\n\n return testPlan;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`could not parse test plan ${testPlanPath}`, e);\n return undefined;\n }\n};\n\nexport const includedInTestPlan = (\n testPlan: TestPlanV1,\n subject: { id?: string; fullName?: string; tags?: string[] },\n): boolean => {\n const { id, fullName, tags = [] } = subject;\n const effectiveId =\n id ?? tags.map((tag) => tag?.match(allureIdRegexp)?.groups?.id).find((maybeId) => maybeId !== undefined);\n\n return testPlan.tests.some((test) => {\n const idMatched = effectiveId && test.id ? String(test.id) === effectiveId : false;\n const selectorMatched = fullName && test.selector === fullName;\n\n return idMatched || selectorMatched;\n });\n};\n\nexport const addSkipLabel = (labels: Label[]) => {\n labels.push({ name: \"ALLURE_TESTPLAN_SKIP\", value: \"true\" });\n};\n\nexport const addSkipLabelAsMeta = (name: string) => {\n return `${name} @allure.label.ALLURE_TESTPLAN_SKIP:true`;\n};\n\nexport const hasSkipLabel = (labels: readonly Label[]) => labels.some(({ name }) => name === \"ALLURE_TESTPLAN_SKIP\");\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAEO,IAAME,aAAa,GAAGA,CAAA,KAA8B;EACzD,IAAMC,YAAY,GAAGC,OAAO,CAACC,GAAG,CAACC,oBAAoB;EAErD,IAAI,CAACH,YAAY,EAAE;IACjB,OAAOI,SAAS;EAClB;EAEA,IAAI,CAAC,IAAAC,kBAAU,EAACL,YAAY,CAAC,EAAE;IAC7B;IACAM,OAAO,CAACC,KAAK,CAAC,sDAAsD,EAA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AK;IAClF,IAAMa,eAAe,GAAGf,QAAQ,IAAIY,IAAI,CAACI,QAAQ,KAAKhB,QAAQ;IAE9D,OAAOa,SAAS,IAAIE,eAAe;EACrC,CAAC,CAAC;AACJ,CAAC;AAACnB,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEK,IAAMoB,YAAY,GAAIC,MAAe,IAAK;EAC/CA,MAAM,CAACC,IAAI,CAAC;IAAEC,IAAI,EAAE,sBAAsB;IAAEC,KAAK,EAAE;EAAO,CAAC,CAAC;AAC9D,CAAC;AAACzB,OAAA,CAAAqB,YAAA,GAAAA,YAAA;AAEK,IAAMK,kBAAkB,GAAIF,IAAY,IAAK;EAClD,UAAAzB,MAAA,CAAUyB,IAAI;AAChB,CAAC;AAACxB,OAAA,CAAA0B,kBAAA,GAAAA,kBAAA;AAEK,IAAMC,YAAY,GAAIL,MAAwB,IAAKA,MAAM,CAACP,IAAI,CAACa,IAAA;EAAA,IAAC;IAAEJ;EAAK,CAAC,GAAAI,IAAA;EAAA,OAAKJ,IAAI,KAAK,sBAAsB;AAAA,EAAC;AAACxB,OAAA,CAAA2B,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envInfo.js","names":["_nodeProcess","require","EOL","platform","stringifyEnvInfo","envInfo","lines","key","value","Object","entries","undefined","escapedKey","escapeKey","escapedValue","escapeValue","push","concat","join","exports","parseEnvInfo","input","escape","skipSpace","isCommentLine","newLine","multiLine","isKey","unicode","unicodeRemaining","escapingUnicode","keySpace","sep","line","decodeString","output","char","hex","String","fromCharCode","isWhitespace","isComment","isSeparator","Error","mapcatChars","code","escapeCharacter","escapeWhitespace","fn","result","i","length","charCodeAt","isAsciiPrintable","escapeUnicode","toString","prefix","repeat"],"sources":["../../../../../src/sdk/reporter/utils/envInfo.ts"],"sourcesContent":["import { platform } from \"node:process\";\n/**\n * The implementation is based on https://github.com/gagle/node-properties.\n */\nimport type { EnvironmentInfo } from \"../../types.js\";\n\nconst EOL = platform === \"win32\" ? \"\\r\\n\" : \"\\n\";\n\nexport const stringifyEnvInfo = (envInfo: EnvironmentInfo) => {\n const lines: string[] = [];\n\n for (const [key, value] of Object.entries(envInfo)) {\n if (value !== null && value !== undefined) {\n const escapedKey = escapeKey(key);\n const escapedValue = escapeValue(value ?? \"\");\n lines.push(`${escapedKey}=${escapedValue}`);\n }\n }\n\n return lines.join(EOL);\n};\n\nexport const parseEnvInfo = (input: string): EnvironmentInfo => {\n if (!input) {\n return {};\n }\n\n const envInfo: EnvironmentInfo = {};\n let escape = false;\n let skipSpace = true;\n let isCommentLine = false;\n let newLine = true;\n let multiLine = false;\n let isKey = true;\n let key = \"\";\n let value = \"\";\n let unicode: number;\n let unicodeRemaining = 0;\n let escapingUnicode = false;\n let keySpace = false;\n let sep = false;\n\n const line = () => {\n if (key || value || sep) {\n envInfo[key] = value;\n key = \"\";\n value = \"\";\n sep = false;\n }\n };\n\n const decodeString = (output: string, char: string) => {\n if (escapingUnicode && unicodeRemaining) {\n // eslint-disable-next-line no-bitwise\n unicode = (unicode << 4) + hex(char);\n if (--unicodeRemaining) {\n return output;\n }\n escape = false;\n escapingUnicode = false;\n return output + String.fromCharCode(unicode);\n }\n\n if (char === \"u\") {\n unicode = 0;\n escapingUnicode = true;\n unicodeRemaining = 4;\n return output;\n }\n\n escape = false;\n\n switch (char) {\n case \"t\":\n return `${output}\\t`;\n case \"r\":\n return `${output}\\r`;\n case \"n\":\n return `${output}\\n`;\n case \"f\":\n return `${output}\\f`;\n }\n\n return output + char;\n };\n\n for (const char of input) {\n if (char === \"\\r\") {\n continue;\n }\n\n if (isCommentLine) {\n if (char === \"\\n\") {\n isCommentLine = false;\n newLine = true;\n skipSpace = true;\n }\n continue;\n }\n\n if (skipSpace) {\n if (isWhitespace(char)) {\n continue;\n }\n\n if (!multiLine && char === \"\\n\") {\n isKey = true;\n keySpace = false;\n newLine = true;\n line();\n continue;\n }\n skipSpace = false;\n multiLine = false;\n }\n\n if (newLine) {\n newLine = false;\n if (isComment(char)) {\n isCommentLine = true;\n continue;\n }\n }\n\n if (char !== \"\\n\") {\n if (!escape && isKey && isSeparator(char)) {\n sep = true;\n isKey = false;\n keySpace = false;\n skipSpace = true;\n continue;\n }\n\n if (char === \"\\\\\") {\n if (escape) {\n if (escapingUnicode) {\n continue;\n }\n\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n key += \"\\\\\";\n } else {\n value += \"\\\\\";\n }\n }\n escape = !escape;\n } else {\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n if (escape) {\n key = decodeString(key, char);\n } else {\n if (isWhitespace(char)) {\n keySpace = true;\n skipSpace = true;\n continue;\n }\n key += char;\n }\n } else {\n if (escape) {\n value = decodeString(value, char);\n } else {\n value += char;\n }\n }\n }\n } else {\n if (escape) {\n if (!escapingUnicode) {\n escape = false;\n }\n skipSpace = true;\n multiLine = true;\n } else {\n newLine = true;\n skipSpace = true;\n isKey = true;\n\n line();\n }\n }\n }\n\n line();\n\n return envInfo;\n};\n\nconst hex = (char: string) => {\n switch (char) {\n case \"0\":\n return 0;\n case \"1\":\n return 1;\n case \"2\":\n return 2;\n case \"3\":\n return 3;\n case \"4\":\n return 4;\n case \"5\":\n return 5;\n case \"6\":\n return 6;\n case \"7\":\n return 7;\n case \"8\":\n return 8;\n case \"9\":\n return 9;\n case \"a\":\n case \"A\":\n return 10;\n case \"b\":\n case \"B\":\n return 11;\n case \"c\":\n case \"C\":\n return 12;\n case \"d\":\n case \"D\":\n return 13;\n case \"e\":\n case \"E\":\n return 14;\n case \"f\":\n case \"F\":\n return 15;\n }\n throw new Error(`Non-hex char ${char}`);\n};\n\nconst escapeKey = (key: string) => {\n return mapcatChars(key, (char, code) => {\n if (isSeparator(char)) {\n return `\\\\${char}`;\n }\n return escapeCharacter(char, code, true);\n });\n};\n\nconst escapeValue = (value: string) => {\n let escapeWhitespace = true;\n return mapcatChars(value, (char, code) => {\n if (!isWhitespace(char)) {\n escapeWhitespace = false;\n }\n return escapeCharacter(char, code, escapeWhitespace);\n });\n};\n\nconst mapcatChars = (value: string, fn: (char: string, code: number) => string) => {\n let result = \"\";\n for (let i = 0; i < value.length; i++) {\n const char = value[i];\n const code = value.charCodeAt(i);\n\n result += fn(char, code);\n }\n return result;\n};\n\nconst escapeCharacter = (char: string, code: number, escapeWhitespace: boolean) => {\n if (isAsciiPrintable(code)) {\n if (char === \" \" && escapeWhitespace) {\n return \"\\\\ \";\n } else if (char === \"\\\\\") {\n return \"\\\\\\\\\";\n } else {\n return char;\n }\n } else if (char === \"\\t\") {\n return \"\\\\t\";\n } else if (char === \"\\n\") {\n return \"\\\\n\";\n } else if (char === \"\\f\") {\n return \"\\\\f\";\n } else if (char === \"\\r\") {\n return \"\\\\r\";\n } else if (code < 160 || code >= 256) {\n // Control sets 0 and 1 or non-ASCII characters\n return escapeUnicode(code);\n } else {\n return char;\n }\n};\n\nconst isWhitespace = (char: string) => {\n switch (char) {\n case \"\\t\":\n case \"\\f\":\n case \" \":\n return true;\n }\n return false;\n};\n\nconst isAsciiPrintable = (code: number) => code > 31 && code < 127;\n\nconst escapeUnicode = (code: number) => {\n const unicode = code.toString(16);\n const prefix = \"0\".repeat(4 - unicode.length);\n return `\\\\u${prefix}${unicode}`;\n};\n\nconst isSeparator = (char: string) => {\n switch (char) {\n case \"=\":\n case \":\":\n return true;\n }\n return false;\n};\n\nconst isComment = (char: string) => {\n switch (char) {\n case \"#\":\n case \"!\":\n return true;\n }\n return false;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA;AACA;AACA;;AAGA,IAAMC,GAAG,GAAGC,qBAAQ,KAAK,OAAO,GAAG,MAAM,GAAG,IAAI;AAEzC,IAAMC,gBAAgB,GAAIC,OAAwB,IAAK;EAC5D,IAAMC,KAAe,GAAG,EAAE;EAE1B,KAAK,IAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,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K,GAAG;MACN,OAAO,IAAI;EACf;EACA,OAAO,KAAK;AACd,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"envInfo.js","names":["_nodeProcess","require","EOL","platform","stringifyEnvInfo","envInfo","lines","key","value","Object","entries","undefined","escapedKey","escapeKey","escapedValue","escapeValue","push","concat","join","exports","parseEnvInfo","input","escape","skipSpace","isCommentLine","newLine","multiLine","isKey","unicode","unicodeRemaining","escapingUnicode","keySpace","sep","line","decodeString","output","char","hex","String","fromCharCode","isWhitespace","isComment","isSeparator","Error","mapcatChars","code","escapeCharacter","escapeWhitespace","fn","result","i","length","charCodeAt","isAsciiPrintable","escapeUnicode","toString","prefix","repeat"],"sources":["../../../../../src/sdk/reporter/utils/envInfo.ts"],"sourcesContent":["import { platform } from \"node:process\";\n\n/**\n * The implementation is based on https://github.com/gagle/node-properties.\n */\nimport type { EnvironmentInfo } from \"../../types.js\";\n\nconst EOL = platform === \"win32\" ? \"\\r\\n\" : \"\\n\";\n\nexport const stringifyEnvInfo = (envInfo: EnvironmentInfo) => {\n const lines: string[] = [];\n\n for (const [key, value] of Object.entries(envInfo)) {\n if (value !== null && value !== undefined) {\n const escapedKey = escapeKey(key);\n const escapedValue = escapeValue(value ?? \"\");\n lines.push(`${escapedKey}=${escapedValue}`);\n }\n }\n\n return lines.join(EOL);\n};\n\nexport const parseEnvInfo = (input: string): EnvironmentInfo => {\n if (!input) {\n return {};\n }\n\n const envInfo: EnvironmentInfo = {};\n let escape = false;\n let skipSpace = true;\n let isCommentLine = false;\n let newLine = true;\n let multiLine = false;\n let isKey = true;\n let key = \"\";\n let value = \"\";\n let unicode: number;\n let unicodeRemaining = 0;\n let escapingUnicode = false;\n let keySpace = false;\n let sep = false;\n\n const line = () => {\n if (key || value || sep) {\n envInfo[key] = value;\n key = \"\";\n value = \"\";\n sep = false;\n }\n };\n\n const decodeString = (output: string, char: string) => {\n if (escapingUnicode && unicodeRemaining) {\n // eslint-disable-next-line no-bitwise\n unicode = (unicode << 4) + hex(char);\n if (--unicodeRemaining) {\n return output;\n }\n escape = false;\n escapingUnicode = false;\n return output + String.fromCharCode(unicode);\n }\n\n if (char === \"u\") {\n unicode = 0;\n escapingUnicode = true;\n unicodeRemaining = 4;\n return output;\n }\n\n escape = false;\n\n switch (char) {\n case \"t\":\n return `${output}\\t`;\n case \"r\":\n return `${output}\\r`;\n case \"n\":\n return `${output}\\n`;\n case \"f\":\n return `${output}\\f`;\n }\n\n return output + char;\n };\n\n for (const char of input) {\n if (char === \"\\r\") {\n continue;\n }\n\n if (isCommentLine) {\n if (char === \"\\n\") {\n isCommentLine = false;\n newLine = true;\n skipSpace = true;\n }\n continue;\n }\n\n if (skipSpace) {\n if (isWhitespace(char)) {\n continue;\n }\n\n if (!multiLine && char === \"\\n\") {\n isKey = true;\n keySpace = false;\n newLine = true;\n line();\n continue;\n }\n skipSpace = false;\n multiLine = false;\n }\n\n if (newLine) {\n newLine = false;\n if (isComment(char)) {\n isCommentLine = true;\n continue;\n }\n }\n\n if (char !== \"\\n\") {\n if (!escape && isKey && isSeparator(char)) {\n sep = true;\n isKey = false;\n keySpace = false;\n skipSpace = true;\n continue;\n }\n\n if (char === \"\\\\\") {\n if (escape) {\n if (escapingUnicode) {\n continue;\n }\n\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n key += \"\\\\\";\n } else {\n value += \"\\\\\";\n }\n }\n escape = !escape;\n } else {\n if (keySpace) {\n keySpace = false;\n isKey = false;\n }\n\n if (isKey) {\n if (escape) {\n key = decodeString(key, char);\n } else {\n if (isWhitespace(char)) {\n keySpace = true;\n skipSpace = true;\n continue;\n }\n key += char;\n }\n } else {\n if (escape) {\n value = decodeString(value, char);\n } else {\n value += char;\n }\n }\n }\n } else {\n if (escape) {\n if (!escapingUnicode) {\n escape = false;\n }\n skipSpace = true;\n multiLine = true;\n } else {\n newLine = true;\n skipSpace = true;\n isKey = true;\n\n line();\n }\n }\n }\n\n line();\n\n return envInfo;\n};\n\nconst hex = (char: string) => {\n switch (char) {\n case \"0\":\n return 0;\n case \"1\":\n return 1;\n case \"2\":\n return 2;\n case \"3\":\n return 3;\n case \"4\":\n return 4;\n case \"5\":\n return 5;\n case \"6\":\n return 6;\n case \"7\":\n return 7;\n case \"8\":\n return 8;\n case \"9\":\n return 9;\n case \"a\":\n case \"A\":\n return 10;\n case \"b\":\n case \"B\":\n return 11;\n case \"c\":\n case \"C\":\n return 12;\n case \"d\":\n case \"D\":\n return 13;\n case \"e\":\n case \"E\":\n return 14;\n case \"f\":\n case \"F\":\n return 15;\n }\n throw new Error(`Non-hex char ${char}`);\n};\n\nconst escapeKey = (key: string) => {\n return mapcatChars(key, (char, code) => {\n if (isSeparator(char)) {\n return `\\\\${char}`;\n }\n return escapeCharacter(char, code, true);\n });\n};\n\nconst escapeValue = (value: string) => {\n let escapeWhitespace = true;\n return mapcatChars(value, (char, code) => {\n if (!isWhitespace(char)) {\n escapeWhitespace = false;\n }\n return escapeCharacter(char, code, escapeWhitespace);\n });\n};\n\nconst mapcatChars = (value: string, fn: (char: string, code: number) => string) => {\n let result = \"\";\n for (let i = 0; i < value.length; i++) {\n const char = value[i];\n const code = value.charCodeAt(i);\n\n result += fn(char, code);\n }\n return result;\n};\n\nconst escapeCharacter = (char: string, code: number, escapeWhitespace: boolean) => {\n if (isAsciiPrintable(code)) {\n if (char === \" \" && escapeWhitespace) {\n return \"\\\\ \";\n } else if (char === \"\\\\\") {\n return \"\\\\\\\\\";\n } else {\n return char;\n }\n } else if (char === \"\\t\") {\n return \"\\\\t\";\n } else if (char === \"\\n\") {\n return \"\\\\n\";\n } else if (char === \"\\f\") {\n return \"\\\\f\";\n } else if (char === \"\\r\") {\n return \"\\\\r\";\n } else if (code < 160 || code >= 256) {\n // Control sets 0 and 1 or non-ASCII characters\n return escapeUnicode(code);\n } else {\n return char;\n }\n};\n\nconst isWhitespace = (char: string) => {\n switch (char) {\n case \"\\t\":\n case \"\\f\":\n case \" \":\n return true;\n }\n return false;\n};\n\nconst isAsciiPrintable = (code: number) => code > 31 && code < 127;\n\nconst escapeUnicode = (code: number) => {\n const unicode = code.toString(16);\n const prefix = \"0\".repeat(4 - unicode.length);\n return `\\\\u${prefix}${unicode}`;\n};\n\nconst isSeparator = (char: string) => {\n switch (char) {\n case \"=\":\n case \":\":\n return true;\n }\n return false;\n};\n\nconst isComment = (char: string) => {\n switch (char) {\n case \"#\":\n case \"!\":\n return true;\n }\n return false;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;;AAGA,IAAMC,GAAG,GAAGC,qBAAQ,KAAK,OAAO,GAAG,MAAM,GAAG,IAAI;AAEzC,IAAMC,gBAAgB,GAAIC,OAAwB,IAAK;EAC5D,IAAMC,KAAe,GAAG,EAAE;EAE1B,KAAK,IAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,OAAO,CAAC,EAAE;IAClD,IAAIG,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKG,SAAS,EAAE;MACzC,IAAMC,UAAU,GAAGC,SAAS,CAACN,GAAG,CAAC;MACjC,IAAMO,YAAY,GAAGC,WAAW,CAACP,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;MAC7CF,KAAK,CAACU,IAAI,IAAAC,MAAA,CAAIL,UAAU,OAAAK,MAAA,CAAIH,YAAY,CAAE,CAAC;IAC7C;EACF;EAEA,OAAOR,KAAK,CAACY,IAAI,CAAChB,GAAG,CAAC;AACxB,CAAC;AAACiB,OAAA,CAAAf,gBAAA,GAAAA,gBAAA;AAEK,IAAMgB,YAAY,GAAIC,KAAa,IAAsB;EAC9D,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,CAAC,CAAC;EACX;EAEA,IAAMhB,OAAwB,GAAG,CAAC,CAAC;EACnC,IAAIiB,MAAM,GAAG,KAAK;EAClB,IAAIC,SAAS,GAAG,IAAI;EACpB,IAAIC,aAAa,GAAG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