allure-js-commons 3.4.5 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/facade.js +19 -1
- package/dist/cjs/facade.js.map +1 -1
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model.js.map +1 -1
- package/dist/cjs/sdk/index.js +12 -0
- package/dist/cjs/sdk/index.js.map +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +91 -15
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/types.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils/envInfo.js +2 -1
- package/dist/cjs/sdk/reporter/utils/envInfo.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js +4 -0
- package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js +6 -0
- package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/MessageReader.js +15 -1
- package/dist/cjs/sdk/reporter/writer/MessageReader.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/MessageWriter.js +3 -0
- package/dist/cjs/sdk/reporter/writer/MessageWriter.js.map +1 -1
- package/dist/cjs/sdk/runtime/MessageTestRuntime.js +79 -23
- package/dist/cjs/sdk/runtime/MessageTestRuntime.js.map +1 -1
- package/dist/cjs/sdk/runtime/NoopTestRuntime.js +31 -13
- package/dist/cjs/sdk/runtime/NoopTestRuntime.js.map +1 -1
- package/dist/cjs/sdk/runtime/index.js +6 -0
- package/dist/cjs/sdk/runtime/index.js.map +1 -1
- package/dist/cjs/sdk/runtime/runtime.js +2 -1
- package/dist/cjs/sdk/runtime/runtime.js.map +1 -1
- package/dist/cjs/sdk/runtime/types.js.map +1 -1
- package/dist/cjs/sdk/types.js.map +1 -1
- package/dist/cjs/sdk/utils.js +17 -1
- package/dist/cjs/sdk/utils.js.map +1 -1
- package/dist/esm/facade.js +15 -0
- package/dist/esm/facade.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/sdk/index.js +1 -1
- package/dist/esm/sdk/index.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +91 -15
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/types.js.map +1 -1
- package/dist/esm/sdk/reporter/utils/envInfo.js +2 -1
- package/dist/esm/sdk/reporter/utils/envInfo.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/FileSystemWriter.js +4 -0
- package/dist/esm/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/InMemoryWriter.js +6 -0
- package/dist/esm/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/MessageReader.js +15 -1
- package/dist/esm/sdk/reporter/writer/MessageReader.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/MessageWriter.js +3 -0
- package/dist/esm/sdk/reporter/writer/MessageWriter.js.map +1 -1
- package/dist/esm/sdk/runtime/MessageTestRuntime.js +77 -21
- package/dist/esm/sdk/runtime/MessageTestRuntime.js.map +1 -1
- package/dist/esm/sdk/runtime/NoopTestRuntime.js +31 -13
- package/dist/esm/sdk/runtime/NoopTestRuntime.js.map +1 -1
- package/dist/esm/sdk/runtime/index.js +1 -1
- package/dist/esm/sdk/runtime/index.js.map +1 -1
- package/dist/esm/sdk/runtime/runtime.js +1 -1
- package/dist/esm/sdk/runtime/runtime.js.map +1 -1
- package/dist/esm/sdk/runtime/types.js.map +1 -1
- package/dist/esm/sdk/types.js.map +1 -1
- package/dist/esm/sdk/utils.js +14 -4
- package/dist/esm/sdk/utils.js.map +1 -1
- package/dist/types/facade.d.ts +5 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/model.d.ts +10 -0
- package/dist/types/sdk/index.d.ts +2 -2
- package/dist/types/sdk/reporter/ReporterRuntime.d.ts +1 -0
- package/dist/types/sdk/reporter/types.d.ts +2 -1
- package/dist/types/sdk/reporter/writer/FileSystemWriter.d.ts +2 -1
- package/dist/types/sdk/reporter/writer/InMemoryWriter.d.ts +3 -1
- package/dist/types/sdk/reporter/writer/MessageWriter.d.ts +2 -1
- package/dist/types/sdk/runtime/MessageTestRuntime.d.ts +10 -3
- package/dist/types/sdk/runtime/NoopTestRuntime.d.ts +3 -0
- package/dist/types/sdk/runtime/index.d.ts +1 -1
- package/dist/types/sdk/runtime/types.d.ts +5 -2
- package/dist/types/sdk/types.d.ts +23 -2
- package/dist/types/sdk/utils.d.ts +7 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["path","extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","_classPrivateMethodInitSpec","_defineProperty","_classPrivateFieldInitSpec","currentStep","_classPrivateGetter","_get_currentStep","startStep","step","stepResult","_objectSpread","steps","push","_classPrivateFieldGet","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","s","found","addAttachment","attachment","writer","isPath","fileExt","fileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","_this","length","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","set","removeStep","newValue","filter","value","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","state","setScope","scope","getScope","concat","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","FINISHED","scopeUuids","arguments","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","historyId","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","status","statusDetails","Buffer","from","content","encoding","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","Array","isArray","Object","keys","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 Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\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 fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\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 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 #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 #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 #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":";;;;;;;;;;;AAAA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,OAAO,QAAQ,MAAM;AAC9B,SAKEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,YAAY,QAAQ,eAAe;AAS5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAChH,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAAC,IAAAC,aAAA,oBAAAC,OAAA;AAAA,IAAAC,wBAAA,oBAAAC,OAAA;AAcnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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GAAG,CAAE4C,CAAC,KAAM;YAAEnD,IAAI;YAAEnF,KAAK,EAAEsI;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLnD,IAAI;UACJnF;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA6jBF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReporterRuntime.js","names":["path","extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","_classPrivateMethodInitSpec","_defineProperty","_classPrivateFieldInitSpec","currentStep","_classPrivateGetter","_get_currentStep","startStep","step","stepResult","_objectSpread","steps","push","_classPrivateFieldGet","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","s","found","addAttachment","attachment","writer","isPath","fileExt","fileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","_this","length","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","set","removeStep","newValue","filter","value","_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","state","setScope","scope","getScope","concat","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","FINISHED","scopeUuids","arguments","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","historyId","afterTestResultStop","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","updateTest","status","statusDetails","Buffer","from","content","encoding","attachmentContent","attachmentSource","errors","_message$fileExtensio","root","getExecutionItem","globals","writeGlobals","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","Array","isArray","Object","keys","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":";;;;;;;;;;;AAAA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,OAAO,QAAQ,MAAM;AAC9B,SAMEC,KAAK,QAGA,gBAAgB;AAevB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,YAAY,QAAQ,eAAe;AAS5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAChH,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAAC,IAAAC,aAAA,oBAAAC,OAAA;AAAA,IAAAC,w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MAAM,IAAIqH,MAAM,CAACC,IAAI,CAACtH,YAAY,CAAC,CAACzC,MAAM,EAAE;MAC3C,IAAI,CAACyC,YAAY,GAAGqH,MAAM,CAACE,OAAO,CAACvH,YAAY,CAAC,CAACwH,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACtD,IAAI,EAAE5F,KAAK,CAAC,GAAAkJ,KAAA;QACrE,IAAIN,KAAK,CAACC,OAAO,CAAC7I,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAACgG,GAAG,CAAEmD,CAAC,KAAM;YAAEvD,IAAI;YAAE5F,KAAK,EAAEmJ;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLvD,IAAI;UACJ5F;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA8oBF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Label,\n LabelName,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport type GlobalLabelsConfig = Partial<Record<LabelName, string | string[]>> & Record<string, string | string[]>;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly globalLabels?: Label[] | GlobalLabelsConfig;\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Globals,\n Label,\n LabelName,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport type GlobalLabelsConfig = Partial<Record<LabelName, string | string[]>> & Record<string, string | string[]>;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly globalLabels?: Label[] | GlobalLabelsConfig;\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n\n writeGlobals(distFileName: string, info: Globals): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":"AAcA,OAAO,IAAMA,4BAA4B,GAAG,sCAAsC;AAClF,OAAO,IAAMC,mCAAmC,GAAG,qCAAqC","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { platform } from "node:process";
|
|
1
2
|
/**
|
|
2
3
|
* The implementation is based on https://github.com/gagle/node-properties.
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
var EOL =
|
|
6
|
+
var EOL = platform === "win32" ? "\r\n" : "\n";
|
|
6
7
|
export var stringifyEnvInfo = envInfo => {
|
|
7
8
|
var lines = [];
|
|
8
9
|
for (var [key, value] of Object.entries(envInfo)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envInfo.js","names":["EOL","process","platform","stringifyEnvInfo","envInfo","lines","key","value","Object","entries","undefined","escapedKey","escapeKey","escapedValue","escapeValue","push","concat","join","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":["/**\n * The implementation is based on https://github.com/gagle/node-properties.\n */\nimport type { EnvironmentInfo } from \"../../types.js\";\n\nconst EOL = process.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;AACA;AACA;;AAGA,IAAMA,GAAG,GAAGC,OAAO,CAACC,QAAQ,KAAK,OAAO,GAAG,MAAM,GAAG,IAAI;AAExD,OAAO,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,E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ringifyEnvInfo","envInfo","lines","key","value","Object","entries","undefined","escapedKey","escapeKey","escapedValue","escapeValue","push","concat","join","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,SAASA,QAAQ,QAAQ,cAAc;AACvC;AACA;AACA;;AAGA,IAAMC,GAAG,GAAGD,QAAQ,KAAK,OAAO,GAAG,MAAM,GAAG,IAAI;AAEhD,OAAO,IAAME,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,CAACf,GAAG,CAAC;AACxB,CAAC;AAED,OAAO,IAAMgB,YAAY,GAAIC,KAAa,IAAsB;EAC9D,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,CAAC,CAAC;EACX;EAEA,IAAMf,OAAwB,GAAG,CAAC,CAAC;EACnC,IAAIgB,MAAM,GAAG,KAAK;EAClB,IAAIC,SAAS,GAAG,IAAI;EACpB,IAAIC,aAAa,GAAG,KAAK;EACzB,IAAIC,OAAO,GAAG,IAAI;EAClB,IAAIC,SAAS,GAAG,KAAK;EACrB,IAAIC,KAAK,GAAG,IAAI;EAChB,IAAInB,GAAG,GAAG,EAAE;EACZ,IAAIC,KAAK,GAAG,EAAE;EACd,IAAImB,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,CAAC,GAAG7B,OAAO,CAACuB,MAAM,CAAC;EAC7C,aAAAjC,MAAA,CAAasC,MAAM,EAAAtC,MAAA,CAAGU,OAAO;AAC/B,CAAC;AAED,IAAMc,WAAW,GAAIN,IAAY,IAAK;EACpC,QAAQA,IAAI;IACV,KAAK,GAAG;IACR,KAAK,GAAG;MACN,OAAO,IAAI;EACf;EACA,OAAO,KAAK;AACd,CAAC;AAED,IAAMK,SAAS,GAAIL,IAAY,IAAK;EAClC,QAAQA,IAAI;IACV,KAAK,GAAG;IACR,KAAK,GAAG;MACN,OAAO,IAAI;EACf;EACA,OAAO,KAAK;AACd,CAAC","ignoreList":[]}
|
|
@@ -33,6 +33,10 @@ export class FileSystemWriter {
|
|
|
33
33
|
var path = this.buildPath("".concat(result.uuid, "-result.json"));
|
|
34
34
|
writeJson(path, result);
|
|
35
35
|
}
|
|
36
|
+
writeGlobals(distFileName, info) {
|
|
37
|
+
var path = this.buildPath(distFileName);
|
|
38
|
+
writeJson(path, info);
|
|
39
|
+
}
|
|
36
40
|
buildPath(name) {
|
|
37
41
|
mkdirSync(this.config.resultsDir, {
|
|
38
42
|
recursive: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystemWriter.js","names":["copyFileSync","mkdirSync","writeFileSync","join","stringifyEnvInfo","writeJson","path","data","JSON","stringify","FileSystemWriter","constructor","config","writeAttachment","distFileName","content","buildPath","writeAttachmentFromPath","from","to","writeEnvironmentInfo","info","text","writeCategoriesDefinitions","categories","writeGroup","result","concat","uuid","writeResult","name","resultsDir","recursive"],"sources":["../../../../../src/sdk/reporter/writer/FileSystemWriter.ts"],"sourcesContent":["import { copyFileSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../../types.js\";\nimport type { Writer } from \"../types.js\";\nimport { stringifyEnvInfo } from \"../utils/envInfo.js\";\n\nconst writeJson = (path: string, data: unknown): void => {\n writeFileSync(path, JSON.stringify(data), \"utf-8\");\n};\n\nexport class FileSystemWriter implements Writer {\n constructor(private config: { resultsDir: string }) {}\n\n writeAttachment(distFileName: string, content: Buffer): void {\n const path = this.buildPath(distFileName);\n\n writeFileSync(path, content, \"utf-8\");\n }\n\n writeAttachmentFromPath(distFileName: string, from: string): void {\n const to = this.buildPath(distFileName);\n\n copyFileSync(from, to);\n }\n\n writeEnvironmentInfo(info: EnvironmentInfo): void {\n const text = stringifyEnvInfo(info);\n const path = this.buildPath(\"environment.properties\");\n\n writeFileSync(path, text);\n }\n\n writeCategoriesDefinitions(categories: Category[]): void {\n const path = this.buildPath(\"categories.json\");\n\n writeJson(path, categories);\n }\n\n writeGroup(result: TestResultContainer): void {\n const path = this.buildPath(`${result.uuid}-container.json`);\n writeJson(path, result);\n }\n\n writeResult(result: TestResult): void {\n const path = this.buildPath(`${result.uuid}-result.json`);\n writeJson(path, result);\n }\n\n private buildPath(name: string): string {\n mkdirSync(this.config.resultsDir, {\n recursive: true,\n });\n return join(this.config.resultsDir, name);\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,SAAS,EAAEC,aAAa,QAAQ,SAAS;AAChE,SAASC,IAAI,QAAQ,WAAW;AAIhC,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD,IAAMC,SAAS,GAAGA,CAACC,IAAY,EAAEC,IAAa,KAAW;EACvDL,aAAa,CAACI,IAAI,EAAEE,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC,EAAE,OAAO,CAAC;AACpD,CAAC;AAED,OAAO,MAAMG,gBAAgB,CAAmB;EAC9CC,WAAWA,CAASC,MAA8B,EAAE;IAAA,KAAhCA,MAA8B,GAA9BA,MAA8B;EAAG;EAErDC,eAAeA,CAACC,YAAoB,EAAEC,OAAe,EAAQ;IAC3D,IAAMT,IAAI,GAAG,IAAI,CAACU,SAAS,CAACF,YAAY,CAAC;IAEzCZ,aAAa,CAACI,IAAI,EAAES,OAAO,EAAE,OAAO,CAAC;EACvC;EAEAE,uBAAuBA,CAACH,YAAoB,EAAEI,IAAY,EAAQ;IAChE,IAAMC,EAAE,GAAG,IAAI,CAACH,SAAS,CAACF,YAAY,CAAC;IAEvCd,YAAY,CAACkB,IAAI,EAAEC,EAAE,CAAC;EACxB;EAEAC,oBAAoBA,CAACC,IAAqB,EAAQ;IAChD,IAAMC,IAAI,GAAGlB,gBAAgB,CAACiB,IAAI,CAAC;IACnC,IAAMf,IAAI,GAAG,IAAI,CAACU,SAAS,CAAC,wBAAwB,CAAC;IAErDd,aAAa,CAACI,IAAI,EAAEgB,IAAI,CAAC;EAC3B;EAEAC,0BAA0BA,CAACC,UAAsB,EAAQ;IACvD,IAAMlB,IAAI,GAAG,IAAI,CAACU,SAAS,CAAC,iBAAiB,CAAC;IAE9CX,SAAS,CAACC,IAAI,EAAEkB,UAAU,CAAC;EAC7B;EAEAC,UAAUA,CAACC,MAA2B,EAAQ;IAC5C,IAAMpB,IAAI,GAAG,IAAI,CAACU,SAAS,IAAAW,MAAA,CAAID,MAAM,CAACE,IAAI,oBAAiB,CAAC;IAC5DvB,SAAS,CAACC,IAAI,EAAEoB,MAAM,CAAC;EACzB;EAEAG,WAAWA,CAACH,MAAkB,EAAQ;IACpC,IAAMpB,IAAI,GAAG,IAAI,CAACU,SAAS,IAAAW,MAAA,CAAID,MAAM,CAACE,IAAI,iBAAc,CAAC;IACzDvB,SAAS,CAACC,IAAI,EAAEoB,MAAM,CAAC;EACzB;
|
|
1
|
+
{"version":3,"file":"FileSystemWriter.js","names":["copyFileSync","mkdirSync","writeFileSync","join","stringifyEnvInfo","writeJson","path","data","JSON","stringify","FileSystemWriter","constructor","config","writeAttachment","distFileName","content","buildPath","writeAttachmentFromPath","from","to","writeEnvironmentInfo","info","text","writeCategoriesDefinitions","categories","writeGroup","result","concat","uuid","writeResult","writeGlobals","name","resultsDir","recursive"],"sources":["../../../../../src/sdk/reporter/writer/FileSystemWriter.ts"],"sourcesContent":["import { copyFileSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { Globals, TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../../types.js\";\nimport type { Writer } from \"../types.js\";\nimport { stringifyEnvInfo } from \"../utils/envInfo.js\";\n\nconst writeJson = (path: string, data: unknown): void => {\n writeFileSync(path, JSON.stringify(data), \"utf-8\");\n};\n\nexport class FileSystemWriter implements Writer {\n constructor(private config: { resultsDir: string }) {}\n\n writeAttachment(distFileName: string, content: Buffer): void {\n const path = this.buildPath(distFileName);\n\n writeFileSync(path, content, \"utf-8\");\n }\n\n writeAttachmentFromPath(distFileName: string, from: string): void {\n const to = this.buildPath(distFileName);\n\n copyFileSync(from, to);\n }\n\n writeEnvironmentInfo(info: EnvironmentInfo): void {\n const text = stringifyEnvInfo(info);\n const path = this.buildPath(\"environment.properties\");\n\n writeFileSync(path, text);\n }\n\n writeCategoriesDefinitions(categories: Category[]): void {\n const path = this.buildPath(\"categories.json\");\n\n writeJson(path, categories);\n }\n\n writeGroup(result: TestResultContainer): void {\n const path = this.buildPath(`${result.uuid}-container.json`);\n writeJson(path, result);\n }\n\n writeResult(result: TestResult): void {\n const path = this.buildPath(`${result.uuid}-result.json`);\n writeJson(path, result);\n }\n\n writeGlobals(distFileName: string, info: Globals): void {\n const path = this.buildPath(distFileName);\n writeJson(path, info);\n }\n\n private buildPath(name: string): string {\n mkdirSync(this.config.resultsDir, {\n recursive: true,\n });\n return join(this.config.resultsDir, name);\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,SAAS,EAAEC,aAAa,QAAQ,SAAS;AAChE,SAASC,IAAI,QAAQ,WAAW;AAIhC,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD,IAAMC,SAAS,GAAGA,CAACC,IAAY,EAAEC,IAAa,KAAW;EACvDL,aAAa,CAACI,IAAI,EAAEE,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC,EAAE,OAAO,CAAC;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O,IAAa,EAAQ;IACtD,IAAMf,IAAI,GAAG,IAAI,CAACU,SAAS,CAACF,YAAY,CAAC;IACzCT,SAAS,CAACC,IAAI,EAAEe,IAAI,CAAC;EACvB;EAEQL,SAASA,CAACe,IAAY,EAAU;IACtC9B,SAAS,CAAC,IAAI,CAACW,MAAM,CAACoB,UAAU,EAAE;MAChCC,SAAS,EAAE;IACb,CAAC,CAAC;IACF,OAAO9B,IAAI,CAAC,IAAI,CAACS,MAAM,CAACoB,UAAU,EAAED,IAAI,CAAC;EAC3C;AACF","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ export class InMemoryWriter {
|
|
|
9
9
|
_defineProperty(this, "attachments", {});
|
|
10
10
|
_defineProperty(this, "categories", void 0);
|
|
11
11
|
_defineProperty(this, "envInfo", void 0);
|
|
12
|
+
_defineProperty(this, "globals", void 0);
|
|
12
13
|
}
|
|
13
14
|
writeGroup(result) {
|
|
14
15
|
this.groups.push(result);
|
|
@@ -28,5 +29,10 @@ export class InMemoryWriter {
|
|
|
28
29
|
writeEnvironmentInfo(envInfo) {
|
|
29
30
|
this.envInfo = envInfo;
|
|
30
31
|
}
|
|
32
|
+
writeGlobals(distFileName, info) {
|
|
33
|
+
var _this$globals;
|
|
34
|
+
this.globals = (_this$globals = this.globals) !== null && _this$globals !== void 0 ? _this$globals : {};
|
|
35
|
+
this.globals[distFileName] = info;
|
|
36
|
+
}
|
|
31
37
|
}
|
|
32
38
|
//# sourceMappingURL=InMemoryWriter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryWriter.js","names":["readFileSync","InMemoryWriter","constructor","_defineProperty","writeGroup","result","groups","push","writeResult","tests","writeAttachment","distFileName","content","attachments","writeAttachmentFromPath","from","writeCategoriesDefinitions","categories","writeEnvironmentInfo","envInfo"],"sources":["../../../../../src/sdk/reporter/writer/InMemoryWriter.ts"],"sourcesContent":["import { readFileSync } from \"fs\";\nimport type { TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { AllureResults, Category, EnvironmentInfo } from \"../../types.js\";\nimport type { Writer } from \"../types.js\";\n\nexport class InMemoryWriter implements Writer, AllureResults {\n public groups: TestResultContainer[] = [];\n public tests: TestResult[] = [];\n public attachments: Record<string, Buffer> = {};\n public categories?: Category[];\n public envInfo?: Record<string, string | undefined>;\n\n public writeGroup(result: TestResultContainer): void {\n this.groups.push(result);\n }\n\n public writeResult(result: TestResult): void {\n this.tests.push(result);\n }\n\n public writeAttachment(distFileName: string, content: Buffer): void {\n this.attachments[distFileName] = content;\n }\n\n public writeAttachmentFromPath(distFileName: string, from: string): void {\n this.attachments[distFileName] = readFileSync(from);\n }\n\n public writeCategoriesDefinitions(categories: Category[]): void {\n this.categories = categories;\n }\n\n public writeEnvironmentInfo(envInfo: EnvironmentInfo): void {\n this.envInfo = envInfo;\n }\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,QAAQ,IAAI;AAKjC,OAAO,MAAMC,cAAc,CAAkC;EAAAC,YAAA;IAAAC,eAAA,iBACpB,EAAE;IAAAA,eAAA,gBACZ,EAAE;IAAAA,eAAA,sBACc,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;EAAA;
|
|
1
|
+
{"version":3,"file":"InMemoryWriter.js","names":["readFileSync","InMemoryWriter","constructor","_defineProperty","writeGroup","result","groups","push","writeResult","tests","writeAttachment","distFileName","content","attachments","writeAttachmentFromPath","from","writeCategoriesDefinitions","categories","writeEnvironmentInfo","envInfo","writeGlobals","info","_this$globals","globals"],"sources":["../../../../../src/sdk/reporter/writer/InMemoryWriter.ts"],"sourcesContent":["import { readFileSync } from \"fs\";\nimport type { Globals, TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { AllureResults, Category, EnvironmentInfo } from \"../../types.js\";\nimport type { Writer } from \"../types.js\";\n\nexport class InMemoryWriter implements Writer, AllureResults {\n public groups: TestResultContainer[] = [];\n public tests: TestResult[] = [];\n public attachments: Record<string, Buffer> = {};\n public categories?: Category[];\n public envInfo?: Record<string, string | undefined>;\n public globals?: Record<string, Globals>;\n\n public writeGroup(result: TestResultContainer): void {\n this.groups.push(result);\n }\n\n public writeResult(result: TestResult): void {\n this.tests.push(result);\n }\n\n public writeAttachment(distFileName: string, content: Buffer): void {\n this.attachments[distFileName] = content;\n }\n\n public writeAttachmentFromPath(distFileName: string, from: string): void {\n this.attachments[distFileName] = readFileSync(from);\n }\n\n public writeCategoriesDefinitions(categories: Category[]): void {\n this.categories = categories;\n }\n\n public writeEnvironmentInfo(envInfo: EnvironmentInfo): void {\n this.envInfo = envInfo;\n }\n\n public writeGlobals(distFileName: string, info: Globals): void {\n this.globals = this.globals ?? {};\n this.globals[distFileName] = info;\n }\n}\n"],"mappings":";;;AAAA,SAASA,YAAY,QAAQ,IAAI;AAKjC,OAAO,MAAMC,cAAc,CAAkC;EAAAC,YAAA;IAAAC,eAAA,iBACpB,EAAE;IAAAA,eAAA,gBACZ,EAAE;IAAAA,eAAA,sBACc,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;EAKxCC,UAAUA,CAACC,MAA2B,EAAQ;IACnD,IAAI,CAACC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC;EAC1B;EAEOG,WAAWA,CAACH,MAAkB,EAAQ;IAC3C,IAAI,CAACI,KAAK,CAACF,IAAI,CAACF,MAAM,CAAC;EACzB;EAEOK,eAAeA,CAACC,YAAoB,EAAEC,OAAe,EAAQ;IAClE,IAAI,CAACC,WAAW,CAACF,YAAY,CAAC,GAAGC,OAAO;EAC1C;EAEOE,uBAAuBA,CAACH,YAAoB,EAAEI,IAAY,EAAQ;IACvE,IAAI,CAACF,WAAW,CAACF,YAAY,CAAC,GAAGX,YAAY,CAACe,IAAI,CAAC;EACrD;EAEOC,0BAA0BA,CAACC,UAAsB,EAAQ;IAC9D,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;EAEOC,oBAAoBA,CAACC,OAAwB,EAAQ;IAC1D,IAAI,CAACA,OAAO,GAAGA,OAAO;EACxB;EAEOC,YAAYA,CAACT,YAAoB,EAAEU,IAAa,EAAQ;IAAA,IAAAC,aAAA;IAC7D,IAAI,CAACC,OAAO,IAAAD,aAAA,GAAG,IAAI,CAACC,OAAO,cAAAD,aAAA,cAAAA,aAAA,GAAI,CAAC,CAAC;IACjC,IAAI,CAACC,OAAO,CAACZ,YAAY,CAAC,GAAGU,IAAI;EACnC;AACF","ignoreList":[]}
|
|
@@ -14,9 +14,11 @@ export class MessageReader {
|
|
|
14
14
|
_defineProperty(this, "results", {
|
|
15
15
|
tests: [],
|
|
16
16
|
groups: [],
|
|
17
|
-
attachments: {}
|
|
17
|
+
attachments: {},
|
|
18
|
+
globals: {}
|
|
18
19
|
});
|
|
19
20
|
_defineProperty(this, "handleMessage", jsonMessage => {
|
|
21
|
+
var _this$results$globals;
|
|
20
22
|
var {
|
|
21
23
|
path,
|
|
22
24
|
type = "undefined",
|
|
@@ -32,6 +34,10 @@ export class MessageReader {
|
|
|
32
34
|
case "attachment":
|
|
33
35
|
this.results.attachments[path] = data;
|
|
34
36
|
return;
|
|
37
|
+
case "globals":
|
|
38
|
+
this.results.globals = (_this$results$globals = this.results.globals) !== null && _this$results$globals !== void 0 ? _this$results$globals : {};
|
|
39
|
+
this.results.globals[path] = parseJsonResult(data);
|
|
40
|
+
return;
|
|
35
41
|
case "misc":
|
|
36
42
|
switch (path) {
|
|
37
43
|
case "environment.properties":
|
|
@@ -84,6 +90,14 @@ export class MessageReader {
|
|
|
84
90
|
});
|
|
85
91
|
}
|
|
86
92
|
}
|
|
93
|
+
if (_this.results.globals) {
|
|
94
|
+
for (var _key of Object.keys(_this.results.globals)) {
|
|
95
|
+
yield attachment(_key, JSON.stringify(_this.results.globals[_key], null, 2), {
|
|
96
|
+
contentType: "application/json",
|
|
97
|
+
encoding: "utf-8"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
87
101
|
}));
|
|
88
102
|
}));
|
|
89
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageReader.js","names":["attachment","step","parseEnvInfo","stringifyEnvInfo","parseJsonResult","data","JSON","parse","Buffer","from","toString","MessageReader","constructor","_this","_defineProperty","tests","groups","attachments","jsonMessage","path","type","results","push","envInfo","categories","handleCustomMessage","_asyncToGenerator","stringify","key","Object","keys","content","contentType","encoding","tr","concat","uuid","trc"],"sources":["../../../../../src/sdk/reporter/writer/MessageReader.ts"],"sourcesContent":["import { attachment, step } from \"../../../facade.js\";\nimport type { TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { AllureResults } from \"../../types.js\";\nimport { parseEnvInfo, stringifyEnvInfo } from \"../utils/envInfo.js\";\n\nconst parseJsonResult = <T>(data: string) => {\n return JSON.parse(Buffer.from(data, \"base64\").toString(\"utf-8\")) as T;\n};\n\nexport class MessageReader {\n readonly results: AllureResults = {\n tests: [],\n groups: [],\n attachments: {},\n };\n\n handleMessage = (jsonMessage: string) => {\n const { path, type = \"undefined\", data }: { path: string; type?: string; data: string } = JSON.parse(jsonMessage);\n\n switch (type) {\n case \"container\":\n this.results.groups.push(parseJsonResult<TestResultContainer>(data));\n return;\n case \"result\":\n this.results.tests.push(parseJsonResult<TestResult>(data));\n return;\n case \"attachment\":\n this.results.attachments[path] = data;\n return;\n case \"misc\":\n switch (path) {\n case \"environment.properties\":\n this.results.envInfo = parseEnvInfo(Buffer.from(data, \"base64\").toString());\n break;\n case \"categories.json\":\n this.results.categories = parseJsonResult(data);\n break;\n default:\n break;\n }\n return;\n default:\n this.handleCustomMessage(type, data, path);\n return;\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n handleCustomMessage = (type: string, data: any, path: string) => {};\n\n attachResults = async () => {\n await step(\"allure-results\", async () => {\n if (this.results.categories) {\n await attachment(\"categories.json\", JSON.stringify(this.results.categories), \"application/json\");\n }\n if (this.results.envInfo) {\n await attachment(\"environment.properties\", stringifyEnvInfo(this.results.envInfo), \"text/plain\");\n }\n if (this.results.attachments) {\n for (const key of Object.keys(this.results.attachments)) {\n const content = this.results.attachments[key];\n await attachment(key, content, {\n contentType: \"text/plain\",\n encoding: \"base64\",\n });\n }\n }\n if (this.results.tests) {\n for (const tr of this.results.tests) {\n await attachment(`${tr.uuid}-result.json`, JSON.stringify(tr, null, 2), {\n contentType: \"application/json\",\n encoding: \"utf-8\",\n });\n }\n }\n if (this.results.groups) {\n for (const trc of this.results.groups) {\n await attachment(`${trc.uuid}-container.json`, JSON.stringify(trc, null, 2), {\n contentType: \"application/json\",\n encoding: \"utf-8\",\n });\n }\n }\n });\n };\n}\n"],"mappings":";;;;;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,oBAAoB;AAGrD,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,qBAAqB;AAEpE,IAAMC,eAAe,GAAOC,IAAY,IAAK;EAC3C,OAAOC,IAAI,CAACC,KAAK,CAACC,MAAM,CAACC,IAAI,CAACJ,IAAI,EAAE,QAAQ,CAAC,CAACK,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClE,CAAC;AAED,OAAO,MAAMC,aAAa,CAAC;EAAAC,YAAA;IAAA,IAAAC,KAAA;IAAAC,eAAA,kBACS;MAChCC,KAAK,EAAE,EAAE;MACTC,MAAM,EAAE,EAAE;MACVC,WAAW,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"MessageReader.js","names":["attachment","step","parseEnvInfo","stringifyEnvInfo","parseJsonResult","data","JSON","parse","Buffer","from","toString","MessageReader","constructor","_this","_defineProperty","tests","groups","attachments","globals","jsonMessage","_this$results$globals","path","type","results","push","envInfo","categories","handleCustomMessage","_asyncToGenerator","stringify","key","Object","keys","content","contentType","encoding","tr","concat","uuid","trc"],"sources":["../../../../../src/sdk/reporter/writer/MessageReader.ts"],"sourcesContent":["import { attachment, step } from \"../../../facade.js\";\nimport type { TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { AllureResults } from \"../../types.js\";\nimport { parseEnvInfo, stringifyEnvInfo } from \"../utils/envInfo.js\";\n\nconst parseJsonResult = <T>(data: string) => {\n return JSON.parse(Buffer.from(data, \"base64\").toString(\"utf-8\")) as T;\n};\n\nexport class MessageReader {\n readonly results: AllureResults = {\n tests: [],\n groups: [],\n attachments: {},\n globals: {},\n };\n\n handleMessage = (jsonMessage: string) => {\n const { path, type = \"undefined\", data }: { path: string; type?: string; data: string } = JSON.parse(jsonMessage);\n\n switch (type) {\n case \"container\":\n this.results.groups.push(parseJsonResult<TestResultContainer>(data));\n return;\n case \"result\":\n this.results.tests.push(parseJsonResult<TestResult>(data));\n return;\n case \"attachment\":\n this.results.attachments[path] = data;\n return;\n case \"globals\":\n this.results.globals = this.results.globals ?? {};\n this.results.globals[path] = parseJsonResult(data);\n return;\n case \"misc\":\n switch (path) {\n case \"environment.properties\":\n this.results.envInfo = parseEnvInfo(Buffer.from(data, \"base64\").toString());\n break;\n case \"categories.json\":\n this.results.categories = parseJsonResult(data);\n break;\n default:\n break;\n }\n return;\n default:\n this.handleCustomMessage(type, data, path);\n return;\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n handleCustomMessage = (type: string, data: any, path: string) => {};\n\n attachResults = async () => {\n await step(\"allure-results\", async () => {\n if (this.results.categories) {\n await attachment(\"categories.json\", JSON.stringify(this.results.categories), \"application/json\");\n }\n if (this.results.envInfo) {\n await attachment(\"environment.properties\", stringifyEnvInfo(this.results.envInfo), \"text/plain\");\n }\n if (this.results.attachments) {\n for (const key of Object.keys(this.results.attachments)) {\n const content = this.results.attachments[key];\n await attachment(key, content, {\n contentType: \"text/plain\",\n encoding: \"base64\",\n });\n }\n }\n if (this.results.tests) {\n for (const tr of this.results.tests) {\n await attachment(`${tr.uuid}-result.json`, JSON.stringify(tr, null, 2), {\n contentType: \"application/json\",\n encoding: \"utf-8\",\n });\n }\n }\n if (this.results.groups) {\n for (const trc of this.results.groups) {\n await attachment(`${trc.uuid}-container.json`, JSON.stringify(trc, null, 2), {\n contentType: \"application/json\",\n encoding: \"utf-8\",\n });\n }\n }\n if (this.results.globals) {\n for (const key of Object.keys(this.results.globals)) {\n await attachment(key, JSON.stringify(this.results.globals[key], null, 2), {\n contentType: \"application/json\",\n encoding: \"utf-8\",\n });\n }\n }\n });\n };\n}\n"],"mappings":";;;;;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,oBAAoB;AAGrD,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,qBAAqB;AAEpE,IAAMC,eAAe,GAAOC,IAAY,IAAK;EAC3C,OAAOC,IAAI,CAACC,KAAK,CAACC,MAAM,CAACC,IAAI,CAACJ,IAAI,EAAE,QAAQ,CAAC,CAACK,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClE,CAAC;AAED,OAAO,MAAMC,aAAa,CAAC;EAAAC,YAAA;IAAA,IAAAC,KAAA;IAAAC,eAAA,kBACS;MAChCC,KAAK,EAAE,EAAE;MACTC,MAAM,EAAE,EAAE;MACVC,WAAW,EAAE,CAAC,CAAC;MACfC,OAAO,EAAE,CAAC;IACZ,CAAC;IAAAJ,eAAA,wBAEgBK,WAAmB,IAAK;MAAA,IAAAC,qBAAA;MACvC,IAAM;QAAEC,IAAI;QAAEC,IAAI,GAAG,WAAW;QAAEjB;MAAoD,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACY,WAAW,CAAC;MAEjH,QAAQG,IAAI;QACV,KAAK,WAAW;UACd,IAAI,CAACC,OAAO,CAACP,MAAM,CAACQ,IAAI,CAACpB,eAAe,CAAsBC,IAAI,CAAC,CAAC;UACpE;QACF,KAAK,QAAQ;UACX,IAAI,CAACkB,OAAO,CAACR,KAAK,CAACS,IAAI,CAACpB,eAAe,CAAaC,IAAI,CAAC,CAAC;UAC1D;QACF,KAAK,YAAY;UACf,IAAI,CAACkB,OAAO,CAACN,WAAW,CAACI,IAAI,CAAC,GAAGhB,IAAI;UACrC;QACF,KAAK,SAAS;UACZ,IAAI,CAACkB,OAAO,CAACL,OAAO,IAAAE,qBAAA,GAAG,IAAI,CAAC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E,kBAAkB;cAC/BC,QAAQ,EAAE;YACZ,CAAC,CAAC;UACJ;QACF;MACF,CAAC,EAAC;IACJ,CAAC;EAAA;AACH","ignoreList":[]}
|
|
@@ -40,5 +40,8 @@ export class MessageWriter {
|
|
|
40
40
|
writeResult(result) {
|
|
41
41
|
this.writeJson("".concat(result.uuid, "-result.json"), "result", result);
|
|
42
42
|
}
|
|
43
|
+
writeGlobals(distFileName, info) {
|
|
44
|
+
this.writeJson(distFileName, "globals", info);
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
//# sourceMappingURL=MessageWriter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageWriter.js","names":["readFileSync","process","stringifyEnvInfo","MessageWriter","constructor","bus","sendData","path","type","data","_process$send","event","toString","emit","JSON","stringify","send","call","writeJson","Buffer","from","writeAttachment","distFileName","content","writeAttachmentFromPath","writeEnvironmentInfo","info","text","writeCategoriesDefinitions","categories","writeGroup","result","concat","uuid","writeResult"],"sources":["../../../../../src/sdk/reporter/writer/MessageWriter.ts"],"sourcesContent":["import { readFileSync } from \"fs\";\nimport type { EventEmitter } from \"node:events\";\nimport process from \"process\";\nimport type { TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../../types.js\";\nimport type { Writer } from \"../types.js\";\nimport { stringifyEnvInfo } from \"../utils/envInfo.js\";\n\ntype EventType = \"result\" | \"container\" | \"attachment\" | \"misc\";\n\nexport class MessageWriter implements Writer {\n constructor(private bus?: EventEmitter) {}\n\n private sendData(path: string, type: EventType, data: Buffer) {\n const event = { path, type, data: data.toString(\"base64\") };\n\n if (this.bus) {\n this.bus.emit(\"allureWriterMessage\", JSON.stringify(event));\n return;\n }\n\n process.send?.(JSON.stringify(event));\n }\n\n private writeJson(path: string, type: EventType, data: any) {\n this.sendData(path, type, Buffer.from(JSON.stringify(data), \"utf-8\"));\n }\n\n writeAttachment(distFileName: string, content: Buffer): void {\n this.sendData(distFileName, \"attachment\", content);\n }\n\n writeAttachmentFromPath(distFileName: string, from: string): void {\n this.sendData(distFileName, \"attachment\", readFileSync(from));\n }\n\n writeEnvironmentInfo(info: EnvironmentInfo): void {\n const text = stringifyEnvInfo(info);\n\n this.sendData(\"environment.properties\", \"misc\", Buffer.from(text, \"utf-8\"));\n }\n\n writeCategoriesDefinitions(categories: Category[]): void {\n this.writeJson(\"categories.json\", \"misc\", categories);\n }\n\n writeGroup(result: TestResultContainer): void {\n this.writeJson(`${result.uuid}-container.json`, \"container\", result);\n }\n\n writeResult(result: TestResult): void {\n this.writeJson(`${result.uuid}-result.json`, \"result\", result);\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,IAAI;AAEjC,OAAOC,OAAO,MAAM,SAAS;AAI7B,SAASC,gBAAgB,QAAQ,qBAAqB;AAItD,OAAO,MAAMC,aAAa,CAAmB;EAC3CC,WAAWA,CAASC,GAAkB,EAAE;IAAA,KAApBA,GAAkB,GAAlBA,GAAkB;EAAG;EAEjCC,QAAQA,CAACC,IAAY,EAAEC,IAAe,EAAEC,IAAY,EAAE;IAAA,IAAAC,aAAA;IAC5D,IAAMC,KAAK,GAAG;MAAEJ,IAAI;MAAEC,IAAI;MAAEC,IAAI,EAAEA,IAAI,CAACG,QAAQ,CAAC,QAAQ;IAAE,CAAC;IAE3D,IAAI,IAAI,CAACP,GAAG,EAAE;MACZ,IAAI,CAACA,GAAG,CAACQ,IAAI,CAAC,qBAAqB,EAAEC,IAAI,CAACC,SAAS,CAACJ,KAAK,CAAC,CAAC;MAC3D;IACF;IAEA,CAAAD,aAAA,GAAAT,OAAO,CAACe,IAAI,cAAAN,aAAA,eAAZA,aAAA,CAAAO,IAAA,CAAAhB,OAAO,EAAQa,IAAI,CAACC,SAAS,CAACJ,KAAK,CAAC,CAAC;EACvC;EAEQO,SAASA,CAACX,IAAY,EAAEC,IAAe,EAAEC,IAAS,EAAE;IAC1D,IAAI,CAACH,QAAQ,CAACC,IAAI,EAAEC,IAAI,EAAEW,MAAM,CAACC,IAAI,CAACN,IAAI,CAACC,SAAS,CAACN,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;EACvE;EAEAY,eAAeA,CAACC,YAAoB,EAAEC,OAAe,EAAQ;IAC3D,IAAI,CAACjB,QAAQ,CAACgB,YAAY,EAAE,YAAY,EAAEC,OAAO,CAAC;EACpD;EAEAC,uBAAuBA,CAACF,YAAoB,EAAEF,IAAY,EAAQ;IAChE,IAAI,CAACd,QAAQ,CAACgB,YAAY,EAAE,YAAY,EAAEtB,YAAY,CAACoB,IAAI,CAAC,CAAC;EAC/D;EAEAK,oBAAoBA,CAACC,IAAqB,EAAQ;IAChD,IAAMC,IAAI,GAAGzB,gBAAgB,CAACwB,IAAI,CAAC;IAEnC,IAAI,CAACpB,QAAQ,CAAC,wBAAwB,EAAE,MAAM,EAAEa,MAAM,CAACC,IAAI,CAACO,IAAI,EAAE,OAAO,CAAC,CAAC;EAC7E;EAEAC,0BAA0BA,CAACC,UAAsB,EAAQ;IACvD,IAAI,CAACX,SAAS,CAAC,iBAAiB,EAAE,MAAM,EAAEW,UAAU,CAAC;EACvD;EAEAC,UAAUA,CAACC,MAA2B,EAAQ;IAC5C,IAAI,CAACb,SAAS,IAAAc,MAAA,CAAID,MAAM,CAACE,IAAI,sBAAmB,WAAW,EAAEF,MAAM,CAAC;EACtE;EAEAG,WAAWA,CAACH,MAAkB,EAAQ;IACpC,IAAI,CAACb,SAAS,IAAAc,MAAA,CAAID,MAAM,CAACE,IAAI,mBAAgB,QAAQ,EAAEF,MAAM,CAAC;EAChE;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"MessageWriter.js","names":["readFileSync","process","stringifyEnvInfo","MessageWriter","constructor","bus","sendData","path","type","data","_process$send","event","toString","emit","JSON","stringify","send","call","writeJson","Buffer","from","writeAttachment","distFileName","content","writeAttachmentFromPath","writeEnvironmentInfo","info","text","writeCategoriesDefinitions","categories","writeGroup","result","concat","uuid","writeResult","writeGlobals"],"sources":["../../../../../src/sdk/reporter/writer/MessageWriter.ts"],"sourcesContent":["import { readFileSync } from \"fs\";\nimport type { EventEmitter } from \"node:events\";\nimport process from \"process\";\nimport type { Globals, TestResult, TestResultContainer } from \"../../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../../types.js\";\nimport type { Writer } from \"../types.js\";\nimport { stringifyEnvInfo } from \"../utils/envInfo.js\";\n\ntype EventType = \"result\" | \"container\" | \"attachment\" | \"misc\" | \"globals\";\n\nexport class MessageWriter implements Writer {\n constructor(private bus?: EventEmitter) {}\n\n private sendData(path: string, type: EventType, data: Buffer) {\n const event = { path, type, data: data.toString(\"base64\") };\n\n if (this.bus) {\n this.bus.emit(\"allureWriterMessage\", JSON.stringify(event));\n return;\n }\n\n process.send?.(JSON.stringify(event));\n }\n\n private writeJson(path: string, type: EventType, data: any) {\n this.sendData(path, type, Buffer.from(JSON.stringify(data), \"utf-8\"));\n }\n\n writeAttachment(distFileName: string, content: Buffer): void {\n this.sendData(distFileName, \"attachment\", content);\n }\n\n writeAttachmentFromPath(distFileName: string, from: string): void {\n this.sendData(distFileName, \"attachment\", readFileSync(from));\n }\n\n writeEnvironmentInfo(info: EnvironmentInfo): void {\n const text = stringifyEnvInfo(info);\n\n this.sendData(\"environment.properties\", \"misc\", Buffer.from(text, \"utf-8\"));\n }\n\n writeCategoriesDefinitions(categories: Category[]): void {\n this.writeJson(\"categories.json\", \"misc\", categories);\n }\n\n writeGroup(result: TestResultContainer): void {\n this.writeJson(`${result.uuid}-container.json`, \"container\", result);\n }\n\n writeResult(result: TestResult): void {\n this.writeJson(`${result.uuid}-result.json`, \"result\", result);\n }\n\n writeGlobals(distFileName: string, info: Globals): void {\n this.writeJson(distFileName, \"globals\", info);\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,IAAI;AAEjC,OAAOC,OAAO,MAAM,SAAS;AAI7B,SAASC,gBAAgB,QAAQ,qBAAqB;AAItD,OAAO,MAAMC,aAAa,CAAmB;EAC3CC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