@azure/microsoft-playwright-testing 1.0.0-alpha.20250620.1 → 1.0.0-alpha.20250716.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/utils/reporterUtils.js +1 -1
- package/dist/browser/utils/reporterUtils.js.map +1 -1
- package/dist/browser/utils/utils.js +1 -1
- package/dist/browser/utils/utils.js.map +1 -1
- package/dist/commonjs/utils/reporterUtils.js +1 -1
- package/dist/commonjs/utils/reporterUtils.js.map +1 -1
- package/dist/commonjs/utils/utils.js +7 -7
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/esm/utils/reporterUtils.js +1 -1
- package/dist/esm/utils/reporterUtils.js.map +1 -1
- package/dist/esm/utils/utils.js +1 -1
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/react-native/utils/reporterUtils.js +1 -1
- package/dist/react-native/utils/reporterUtils.js.map +1 -1
- package/dist/react-native/utils/utils.js +1 -1
- package/dist/react-native/utils/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporterUtils.js","sourceRoot":"","sources":["../../../src/utils/reporterUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE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,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,IAAI,SAAS,CAAC,0BAA0B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1D,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAyUJ,eAAe,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n Location,\n TestCase,\n TestResult,\n TestStep,\n FullConfig,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { exec } from \"node:child_process\";\nimport { reporterLogger } from \"../common/logger.js\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport type { IBackOffOptions } from \"../common/types.js\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Constants } from \"../common/constants.js\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables.js\";\nimport type { DedupedStep, RawTestStep } from \"../common/types.js\";\nimport { TokenType } from \"../model/mptTokenDetails.js\";\nimport type { UploadMetadata } from \"../model/shard.js\";\nimport { Shard, TestRunStatus } from \"../model/shard.js\";\nimport type { RawTestResult } from \"../model/testResult.js\";\nimport { TestResult as MPTTestResult } from \"../model/testResult.js\";\nimport type { TestRunConfig } from \"../model/testRun.js\";\nimport { TestRun } from \"../model/testRun.js\";\nimport type { CIInfo } from \"./cIInfoProvider.js\";\nimport { CI_PROVIDERS } from \"./cIInfoProvider.js\";\nimport { CIInfoProvider } from \"./cIInfoProvider.js\";\nimport type { StorageUri } from \"../model/storageUri.js\";\nimport { getPackageVersion } from \"./utils.js\";\nclass ReporterUtils {\n private envVariables: EnvironmentVariables;\n\n private config: FullConfig;\n totalTests: number;\n failedTests: number;\n skippedTests: number;\n passedTests: number;\n flakyTests: number;\n startTime: number;\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n constructor(envVariables: EnvironmentVariables, config: FullConfig, _: Suite) {\n this.config = config;\n this.envVariables = envVariables;\n this.startTime = Date.now();\n\n this.totalTests = 0;\n this.failedTests = 0;\n this.skippedTests = 0;\n this.passedTests = 0;\n this.flakyTests = 0;\n }\n\n public async getTestRunObject(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = new TestRun();\n const runName = this.envVariables.runName || (await this.getRunName(ciInfo));\n testRun.testRunId = this.envVariables.runId;\n testRun.displayName = ReporterUtils.isNullOrEmpty(runName) ? this.envVariables.runId : runName;\n testRun.creatorName = this.envVariables.userName;\n testRun.creatorId = this.envVariables.userId!;\n testRun.startTime = ReporterUtils.timestampToRFC3339(this.startTime);\n testRun.ciConfig = {\n ciProviderName: ciInfo.provider!,\n branch: ciInfo.branch!,\n author: ciInfo.author!,\n commitId: ciInfo.commitId!,\n revisionUrl: ciInfo.revisionUrl!,\n };\n testRun.testRunConfig = this.getTestRunConfig();\n testRun.cloudReportingEnabled = \"true\";\n return testRun;\n }\n\n public getTestRunShardStartObject(): Shard {\n const shard = new Shard();\n if (this.config.shard !== null && this.config.shard !== undefined) {\n this.envVariables.shardId = this.config.shard.current.toString();\n } else {\n this.envVariables.shardId = \"1\";\n }\n shard.shardId = this.envVariables.shardId;\n shard.summary = {\n startTime: ReporterUtils.timestampToRFC3339(this.startTime),\n };\n shard.uploadCompleted = false;\n return shard;\n }\n\n public getTestRunShardEndObject(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Shard {\n shard.shardId = this.envVariables.shardId ?? \"1\";\n shard.summary.totalTime = result.duration;\n shard.summary.endTime = ReporterUtils.timestampToRFC3339(Date.now());\n shard.summary.status = TestRunStatus.CLIENT_COMPLETE;\n shard.summary.errorMessages = errorMessages;\n shard.summary.uploadMetadata = attachmentMetadata;\n shard.uploadCompleted = true;\n shard.workers = workers;\n return shard;\n }\n\n public getOSName(result: TestResult, data: string): string {\n try {\n for (const attachment of result.attachments) {\n if (attachment.name === data) {\n const match = attachment?.contentType?.match(/charset=(.*)/);\n const charset = match && match.length > 1 ? match[1] : \"utf-8\";\n return attachment.body?.toString((charset as any) || \"utf-8\").toUpperCase() || \"\";\n }\n }\n } catch (error) {\n reporterLogger.error(`Error in fetching OS - ${error}`);\n }\n return \"\";\n }\n\n public getTestResultObject(test: TestCase, result: TestResult, jobName: string): MPTTestResult {\n switch (test.outcome()) {\n case \"skipped\":\n this.skippedTests++;\n this.totalTests++;\n break;\n case \"expected\":\n this.passedTests++;\n this.totalTests++;\n break;\n case \"unexpected\":\n if (result.retry === test.retries) {\n this.failedTests++;\n this.totalTests++;\n }\n break;\n case \"flaky\":\n this.totalTests++;\n this.flakyTests++;\n break;\n default:\n break;\n }\n\n const testResult = new MPTTestResult();\n testResult.runId = this.envVariables.runId;\n testResult.shardId = this.envVariables.runId + \"_\" + this.envVariables.shardId;\n testResult.accountId = this.envVariables.accountId!;\n testResult.suiteId = ReporterUtils.calculateSha1(`${test.parent.title}-${test.location.file}`);\n testResult.testId = testResult.suiteId.concat(`-${ReporterUtils.calculateSha1(test.title)}`);\n testResult.testCombinationId = test.id;\n testResult.testExecutionId = randomUUID();\n testResult.testTitle = test.title;\n testResult.suiteTitle = this.extractRootParentTitle(test.parent)!;\n testResult.fileName = test.location.file;\n testResult.status = this.getTestStatus(test, result);\n testResult.lineNumber = test.location.line;\n testResult.retry = result.retry ? result.retry : 0;\n let browserName = test.parent.project()?.use.browserName?.toLowerCase();\n if (!browserName) {\n browserName = test.parent.project()?.use.defaultBrowserType?.toLowerCase();\n }\n testResult.webTestConfig = {\n jobName: jobName,\n projectName: test.parent.project()!.name,\n browserType: browserName ? browserName.toUpperCase() : \"\",\n os: this.getOSName(result, Constants.OS),\n };\n testResult.annotations = this.extractTestAnnotations(test.annotations);\n testResult.tags = this.extractTestTags(test);\n testResult.resultsSummary = {\n status: result.status.toUpperCase(),\n duration: result.duration,\n startTime: result.startTime.toISOString().replace(/\\.\\d+Z$/, \"Z\"),\n attachmentsMetadata: this.getAttachmentStatus(result),\n };\n testResult.artifactsPath = result.attachments\n .filter((attachment) => attachment?.path !== null && attachment?.path !== undefined) // Filter attachments with defined and non-null path property\n .map(\n (attachment) =>\n `${testResult.testExecutionId}/${ReporterUtils.getFileRelativePath(attachment.path!)}`,\n );\n return testResult;\n }\n\n public generateMarkdownSummary(testRunUrl: string): void {\n try {\n if (CIInfoProvider.getCIProvider() === CI_PROVIDERS.GITHUB) {\n const markdownContent = `\n#### Microsoft Playwright Testing run summary\n\n#### Results:\n \n **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: this.getTestError(result),\n stdErr: result.stderr ? JSON.stringify(result.stderr, null, 2) : \"\",\n stdOut: result.stdout ? JSON.stringify(result.stdout, null, 2) : \"\",\n };\n return rawTestResult;\n }\n\n public static getRunId(cIInfo: CIInfo): string {\n if (cIInfo === null || cIInfo.provider === CI_PROVIDERS.DEFAULT) {\n return randomUUID();\n }\n\n const concatString = `${cIInfo.provider}-${cIInfo.repo}-${cIInfo.runId}-${cIInfo.runAttempt}`;\n const runId = ReporterUtils.calculateSha1(concatString);\n return runId;\n }\n\n public static calculateSha1(buffer: Buffer | string): string {\n const hash = createHash(\"sha1\");\n hash.update(buffer);\n return hash.digest(\"hex\");\n }\n\n /*\n public static getTokenDetails(accessToken: string) {\n let tokenDetails = new MPTTokenDetails();\n try {\n const token = accessToken.split('.')[1];\n const _token = Buffer.from(token, 'base64');\n tokenDetails = JSON.parse(_token.toString());\n } catch (err) {\n throw err;\n }\n return tokenDetails;\n }\n */\n\n public static getTokenDetails<T>(accessToken: string, tokenType: TokenType): T {\n const token = accessToken.split(\".\")[1]!;\n const _token = Buffer.from(token, \"base64\");\n const tokenDetails = JSON.parse(_token.toString());\n\n switch (tokenType) {\n case TokenType.MPT:\n return tokenDetails as T;\n case TokenType.ENTRA:\n return tokenDetails as T;\n default:\n throw new Error(\"Unsupported token type\");\n }\n }\n\n public static hasAudienceClaim(token: string): boolean {\n try {\n // Split the token into its three parts\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"Invalid token format\");\n }\n\n // Base64 decode the payload\n const payload = parts[1]!;\n const decodedPayload = Buffer.from(payload, \"base64\");\n\n // Parse the decoded payload as JSON\n const payloadObject = JSON.parse(decodedPayload.toString());\n\n // Check if the payload has an 'aud' claim\n return \"aud\" in payloadObject;\n } catch (error) {\n return false;\n }\n }\n\n public static timestampToRFC3339(timestamp: number): string {\n const date = new Date(timestamp);\n const dateString = date.toISOString().replace(/\\.\\d+Z$/, \"Z\");\n return dateString;\n }\n\n public static getFileRelativePath(filePath: string): string {\n if (filePath) {\n let parts = filePath.split(\"/\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n\n parts = filePath.split(\"\\\\\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n }\n\n return filePath;\n }\n\n public static getReporterBackOffOptions: Partial<IBackOffOptions> = {\n numOfAttempts: 3,\n jitter: \"full\",\n retry: (error) => {\n if (error.response) {\n const status = error.response.status;\n if (Constants.NON_RETRYABLE_STATUS_CODES.includes(status)) {\n return false;\n }\n }\n return true;\n },\n };\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n public static isTimeGreaterThanCurrentPlus10Minutes(sasUri: StorageUri): boolean {\n try {\n const url = new URL(sasUri.uri);\n const params = new URLSearchParams(url.search);\n const expiryTime = params.get(\"se\"); // 'se' is the query parameter for the expiry time\n if (expiryTime) {\n const timestampFromIsoString = new Date(expiryTime).getTime();\n const currentTimestampPlus10Minutes = Date.now() + 10 * 60 * 1000;\n const isSasValidityGreaterThanCurrentTimePlus10Minutes =\n timestampFromIsoString > currentTimestampPlus10Minutes;\n if (!isSasValidityGreaterThanCurrentTimePlus10Minutes) {\n reporterLogger.info(\n `Sas rotation required because close to expiry, SasUriValidTillTime: ${timestampFromIsoString}, CurrentTime: ${currentTimestampPlus10Minutes}`,\n );\n }\n return isSasValidityGreaterThanCurrentTimePlus10Minutes;\n }\n reporterLogger.error(`Sas rotation required because expiry param not found.`);\n return false;\n } catch (error) {\n reporterLogger.error(`Sas rotation required because of ${error}.`);\n return false;\n }\n }\n\n public static getFileSize(attachmentPath: string): number {\n try {\n const stats = fs.statSync(attachmentPath);\n return stats.size;\n } catch (error) {\n return 0;\n }\n }\n\n public static getBufferSize(attachmentBody: Buffer): number {\n try {\n const fileSizeInBytes = attachmentBody.length;\n return fileSizeInBytes;\n } catch (error) {\n return 0;\n }\n }\n\n public redactAccessToken(info: string | undefined): string {\n if (!info || ReporterUtils.isNullOrEmpty(this.envVariables.accessToken)) {\n return \"\";\n }\n const accessTokenRegex = new RegExp(this.envVariables.accessToken, \"g\");\n return info.replace(accessTokenRegex, Constants.DEFAULT_REDACTED_MESSAGE);\n }\n public static getRegionFromAccountID(accountId: string): string | undefined {\n if (accountId.includes(\"_\")) {\n return accountId.split(\"_\")[0]!;\n } else {\n return;\n } // Handling for older workspaces without region in id\n }\n\n public progressBar(current: number, total: number): void {\n const width = 40;\n const percent = current / total;\n const completed = Math.round(width * percent);\n const remaining = width - completed;\n\n if (current % Math.round(total / 5) === 0 || current === total) {\n process.stdout.write(\"\\r\");\n process.stdout.write(\n `[${\"=\".repeat(completed)}${\" \".repeat(remaining)}] ${Math.round(percent * 100)}%`,\n );\n }\n }\n\n private getTestRunConfig(): TestRunConfig {\n const testRunConfig: TestRunConfig = {\n workers: this.getWorkers(),\n pwVersion: this.config.version,\n timeout: this.config.globalTimeout,\n repeatEach: this.config.projects[0].repeatEach,\n retries: this.config.projects[0].retries,\n shards: this.config.shard ? this.config.shard : { total: 1 },\n testFramework: {\n name: Constants.TEST_FRAMEWORK_NAME,\n version: this.config.version,\n runnerName: Constants.TEST_FRAMEWORK_RUNNERNAME,\n },\n testType: Constants.TEST_TYPE,\n testSdkLanguage: Constants.TEST_SDK_LANGUAGE,\n reporterPackageVersion: getPackageVersion(),\n };\n return testRunConfig;\n }\n\n private relativeLocation(location: Location | undefined): Location | undefined {\n if (!location) {\n return undefined;\n }\n const file = this.toPosixPath(path.relative(this.config.rootDir, location.file));\n return {\n file,\n line: location.line,\n column: location.column,\n };\n }\n\n private extractTestTags(input: TestCase): string[] {\n let tags: string[] = [];\n if (\"tags\" in input && Array.isArray(input.tags) && input.tags.length > 0) {\n tags = input.tags.map((tag) => tag.slice(1));\n return tags;\n }\n\n // Check if the input string contains tags directly\n const regex = /@(\\w+)/g;\n const matches = input.title.match(regex);\n if (matches) {\n tags = tags.concat(matches.map((match) => match.slice(1)));\n }\n\n // Try parsing the input string as a JavaScript object\n try {\n const obj = JSON.parse(`{${input}}`);\n if (obj.tag && Array.isArray(obj.tag)) {\n tags = tags.concat(obj.tag);\n }\n } catch (error) {\n // Ignore parsing errors\n }\n return tags;\n }\n\n private extractTestAnnotations(annotations: TestCase[\"annotations\"]): string[] {\n const result = annotations.map((annotation) => {\n if (annotation.type && annotation.description) {\n return `${annotation.type}: ${annotation.description}`;\n }\n return annotation.type;\n });\n return result;\n }\n\n private toPosixPath(aPath: string): string {\n return aPath.split(path.sep).join(path.posix.sep);\n }\n\n private getAttachmentStatus(testResult: TestResult): string {\n let attachmentStatus: string = \"\";\n for (const attachment of testResult.attachments) {\n if (attachment.contentType.includes(\"image\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"image\";\n } else if (attachment.contentType.includes(\"video\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"video\";\n } else if (attachment.contentType === \"application/zip\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"trace\";\n } else if (attachment.contentType === \"text/plain\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"txt\";\n }\n }\n return attachmentStatus;\n }\n\n private dedupeSteps(steps: TestStep[]): DedupedStep[] {\n const result: DedupedStep[] = [];\n let lastResult = undefined;\n for (const step of steps) {\n const canDedupe =\n !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;\n const lastStep = lastResult?.step;\n if (\n canDedupe &&\n lastResult &&\n lastStep &&\n step.category === lastStep.category &&\n step.title === lastStep.title &&\n step.location?.file === lastStep.location?.file &&\n step.location?.line === lastStep.location?.line &&\n step.location?.column === lastStep.location?.column\n ) {\n ++lastResult.count;\n lastResult.duration += step.duration;\n continue;\n }\n lastResult = { step, count: 1, duration: step.duration };\n result.push(lastResult);\n if (!canDedupe) {\n lastResult = undefined;\n }\n }\n return result;\n }\n\n private serializeTestStep(dedupedStep: DedupedStep): RawTestStep {\n const { step, duration, count } = dedupedStep;\n const result: RawTestStep = {\n title: step.title,\n category: step.category,\n startTime: step.startTime.toISOString(),\n duration,\n error: step.error ? step.error.message : undefined,\n location: this.relativeLocation(step.location),\n steps: this.dedupeSteps(step.steps).map((subStep) => this.serializeTestStep(subStep)),\n count: count,\n };\n return result;\n }\n\n private getTestStatus(test: TestCase, result: TestResult): string {\n if (test.expectedStatus === result.status) {\n if (result.status === \"skipped\") {\n return \"SKIPPED\";\n } else {\n return \"PASSED\";\n }\n } else if (result.status === \"interrupted\") {\n return \"SKIPPED\";\n } else {\n return \"FAILED\";\n }\n }\n\n private extractRootParentTitle(suite: Suite): string | undefined {\n // Traverse through the parent properties until reaching the root parent\n let currentSuite: Suite | undefined = suite;\n let depthCount: number = 0;\n let suiteTitle: string = currentSuite.title;\n const projectName = currentSuite.project()!.name;\n while (currentSuite?.parent && !ReporterUtils.isNullOrEmpty(currentSuite.parent.title)) {\n if (depthCount > 10 || currentSuite.parent.title === projectName) {\n break;\n }\n suiteTitle = suiteTitle + \" > \" + currentSuite.parent.title;\n currentSuite = currentSuite.parent;\n depthCount++;\n }\n return suiteTitle;\n }\n\n private async getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.provider === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n let gitCommitMessage: string | null = null;\n try {\n const gitVersion = await this.runCommand(Constants.GIT_VERSION_COMMAND);\n if (ReporterUtils.isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await this.runCommand(Constants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n gitCommitMessage = await this.runCommand(Constants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n reporterLogger.error(`\\nError in getting git commit message: ${err}.`);\n return \"\";\n }\n }\n\n private async runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n }\n\n public static isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n }\n\n private getTestError(result: TestResult): string {\n if (!result.errors || result.errors.length === 0) return \"\";\n const errorMessages: { message: string }[] = [];\n result.errors.forEach((error) => {\n if (error.message) errorMessages.push({ message: error.message });\n if (error.snippet && error.location) {\n errorMessages.push({\n message: error.snippet + \"\\n\\n\" + this.getReadableLineLocation(error.location),\n });\n } else if (error.snippet) errorMessages.push({ message: error.snippet });\n });\n return JSON.stringify(errorMessages, null, 2);\n }\n\n private getReadableLineLocation(location: Location): string {\n return `at ${location.file}:${location.line}:${location.column}`;\n }\n\n private getWorkers(): number {\n if (\n this.config.metadata &&\n \"actualWorkers\" in this.config.metadata &&\n typeof this.config.metadata.actualWorkers === \"number\"\n ) {\n return this.config.metadata.actualWorkers;\n }\n return this.config.workers;\n }\n}\n\nexport default ReporterUtils;\n"]}
|
|
1
|
+
{"version":3,"file":"reporterUtils.js","sourceRoot":"","sources":["../../../src/utils/reporterUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,MAAM,aAAa;IAWjB,wEAAwE;IACxE,YAAY,YAAkC,EAAE,MAAkB,EAAE,CAAQ;QAC1E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC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C;YACL,CAAC;iBAAM,IAAI,KAAK,CAAC,OAAO;gBAAE,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAEO,uBAAuB,CAAC,QAAkB;QAChD,OAAO,MAAM,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;IACnE,CAAC;IAEO,UAAU;QAChB,IACE,IAAI,CAAC,MAAM,CAAC,QAAQ;YACpB,eAAe,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ;YACvC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,KAAK,QAAQ,EACtD,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC5C,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IAC7B,CAAC;;AAlVa,uCAAyB,GAA6B;IAClE,aAAa,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,IAAI,SAAS,CAAC,0BAA0B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1D,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAyUJ,eAAe,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n Location,\n TestCase,\n TestResult,\n TestStep,\n FullConfig,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { exec } from \"node:child_process\";\nimport { reporterLogger } from \"../common/logger.js\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport type { IBackOffOptions } from \"../common/types.js\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Constants } from \"../common/constants.js\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables.js\";\nimport type { DedupedStep, RawTestStep } from \"../common/types.js\";\nimport { TokenType } from \"../model/mptTokenDetails.js\";\nimport type { UploadMetadata } from \"../model/shard.js\";\nimport { Shard, TestRunStatus } from \"../model/shard.js\";\nimport type { RawTestResult } from \"../model/testResult.js\";\nimport { TestResult as MPTTestResult } from \"../model/testResult.js\";\nimport type { TestRunConfig } from \"../model/testRun.js\";\nimport { TestRun } from \"../model/testRun.js\";\nimport type { CIInfo } from \"./cIInfoProvider.js\";\nimport { CI_PROVIDERS } from \"./cIInfoProvider.js\";\nimport { CIInfoProvider } from \"./cIInfoProvider.js\";\nimport type { StorageUri } from \"../model/storageUri.js\";\nimport { getPackageVersion } from \"./utils.js\";\nclass ReporterUtils {\n private envVariables: EnvironmentVariables;\n\n private config: FullConfig;\n totalTests: number;\n failedTests: number;\n skippedTests: number;\n passedTests: number;\n flakyTests: number;\n startTime: number;\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n constructor(envVariables: EnvironmentVariables, config: FullConfig, _: Suite) {\n this.config = config;\n this.envVariables = envVariables;\n this.startTime = Date.now();\n\n this.totalTests = 0;\n this.failedTests = 0;\n this.skippedTests = 0;\n this.passedTests = 0;\n this.flakyTests = 0;\n }\n\n public async getTestRunObject(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = new TestRun();\n const runName = this.envVariables.runName || (await this.getRunName(ciInfo));\n testRun.testRunId = this.envVariables.runId;\n testRun.displayName = ReporterUtils.isNullOrEmpty(runName) ? this.envVariables.runId : runName;\n testRun.creatorName = this.envVariables.userName;\n testRun.creatorId = this.envVariables.userId!;\n testRun.startTime = ReporterUtils.timestampToRFC3339(this.startTime);\n testRun.ciConfig = {\n ciProviderName: ciInfo.provider!,\n branch: ciInfo.branch!,\n author: ciInfo.author!,\n commitId: ciInfo.commitId!,\n revisionUrl: ciInfo.revisionUrl!,\n };\n testRun.testRunConfig = this.getTestRunConfig();\n testRun.cloudReportingEnabled = \"true\";\n return testRun;\n }\n\n public getTestRunShardStartObject(): Shard {\n const shard = new Shard();\n if (this.config.shard !== null && this.config.shard !== undefined) {\n this.envVariables.shardId = this.config.shard.current.toString();\n } else {\n this.envVariables.shardId = \"1\";\n }\n shard.shardId = this.envVariables.shardId;\n shard.summary = {\n startTime: ReporterUtils.timestampToRFC3339(this.startTime),\n };\n shard.uploadCompleted = false;\n return shard;\n }\n\n public getTestRunShardEndObject(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Shard {\n shard.shardId = this.envVariables.shardId ?? \"1\";\n shard.summary.totalTime = result.duration;\n shard.summary.endTime = ReporterUtils.timestampToRFC3339(Date.now());\n shard.summary.status = TestRunStatus.CLIENT_COMPLETE;\n shard.summary.errorMessages = errorMessages;\n shard.summary.uploadMetadata = attachmentMetadata;\n shard.uploadCompleted = true;\n shard.workers = workers;\n return shard;\n }\n\n public getOSName(result: TestResult, data: string): string {\n try {\n for (const attachment of result.attachments) {\n if (attachment.name === data) {\n const match = attachment?.contentType?.match(/charset=(.*)/);\n const charset = match && match.length > 1 ? match[1] : \"utf-8\";\n return attachment.body?.toString((charset as any) || \"utf-8\").toUpperCase() || \"\";\n }\n }\n } catch (error) {\n reporterLogger.error(`Error in fetching OS - ${error}`);\n }\n return \"\";\n }\n\n public getTestResultObject(test: TestCase, result: TestResult, jobName: string): MPTTestResult {\n switch (test.outcome()) {\n case \"skipped\":\n this.skippedTests++;\n this.totalTests++;\n break;\n case \"expected\":\n this.passedTests++;\n this.totalTests++;\n break;\n case \"unexpected\":\n if (result.retry === test.retries) {\n this.failedTests++;\n this.totalTests++;\n }\n break;\n case \"flaky\":\n this.totalTests++;\n this.flakyTests++;\n break;\n default:\n break;\n }\n\n const testResult = new MPTTestResult();\n testResult.runId = this.envVariables.runId;\n testResult.shardId = this.envVariables.runId + \"_\" + this.envVariables.shardId;\n testResult.accountId = this.envVariables.accountId!;\n testResult.suiteId = ReporterUtils.calculateSha1(`${test.parent.title}-${test.location.file}`);\n testResult.testId = testResult.suiteId.concat(`-${ReporterUtils.calculateSha1(test.title)}`);\n testResult.testCombinationId = test.id;\n testResult.testExecutionId = randomUUID();\n testResult.testTitle = test.title;\n testResult.suiteTitle = this.extractRootParentTitle(test.parent)!;\n testResult.fileName = test.location.file;\n testResult.status = this.getTestStatus(test, result);\n testResult.lineNumber = test.location.line;\n testResult.retry = result.retry ? result.retry : 0;\n let browserName = test.parent.project()?.use.browserName?.toLowerCase();\n if (!browserName) {\n browserName = test.parent.project()?.use.defaultBrowserType?.toLowerCase();\n }\n testResult.webTestConfig = {\n jobName: jobName,\n projectName: test.parent.project()!.name,\n browserType: browserName ? browserName.toUpperCase() : \"\",\n os: this.getOSName(result, Constants.OS),\n };\n testResult.annotations = this.extractTestAnnotations(test.annotations);\n testResult.tags = this.extractTestTags(test);\n testResult.resultsSummary = {\n status: result.status.toUpperCase(),\n duration: result.duration,\n startTime: result.startTime.toISOString().replace(/\\.\\d+Z$/, \"Z\"),\n attachmentsMetadata: this.getAttachmentStatus(result),\n };\n testResult.artifactsPath = result.attachments\n .filter((attachment) => attachment?.path !== null && attachment?.path !== undefined) // Filter attachments with defined and non-null path property\n .map(\n (attachment) =>\n `${testResult.testExecutionId}/${ReporterUtils.getFileRelativePath(attachment.path!)}`,\n );\n return testResult;\n }\n\n public generateMarkdownSummary(testRunUrl: string): void {\n try {\n if (CIInfoProvider.getCIProvider() === CI_PROVIDERS.GITHUB) {\n const markdownContent = `\n#### Microsoft Playwright Testing run summary\n\n#### Results:\n \n **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: this.getTestError(result),\n stdErr: result.stderr ? JSON.stringify(result.stderr, null, 2) : \"\",\n stdOut: result.stdout ? JSON.stringify(result.stdout, null, 2) : \"\",\n };\n return rawTestResult;\n }\n\n public static getRunId(cIInfo: CIInfo): string {\n if (cIInfo === null || cIInfo.provider === CI_PROVIDERS.DEFAULT) {\n return randomUUID();\n }\n\n const concatString = `${cIInfo.provider}-${cIInfo.repo}-${cIInfo.runId}-${cIInfo.runAttempt}`;\n const runId = ReporterUtils.calculateSha1(concatString);\n return runId;\n }\n\n public static calculateSha1(buffer: Buffer | string): string {\n const hash = createHash(\"sha256\");\n hash.update(buffer);\n return hash.digest(\"hex\");\n }\n\n /*\n public static getTokenDetails(accessToken: string) {\n let tokenDetails = new MPTTokenDetails();\n try {\n const token = accessToken.split('.')[1];\n const _token = Buffer.from(token, 'base64');\n tokenDetails = JSON.parse(_token.toString());\n } catch (err) {\n throw err;\n }\n return tokenDetails;\n }\n */\n\n public static getTokenDetails<T>(accessToken: string, tokenType: TokenType): T {\n const token = accessToken.split(\".\")[1]!;\n const _token = Buffer.from(token, \"base64\");\n const tokenDetails = JSON.parse(_token.toString());\n\n switch (tokenType) {\n case TokenType.MPT:\n return tokenDetails as T;\n case TokenType.ENTRA:\n return tokenDetails as T;\n default:\n throw new Error(\"Unsupported token type\");\n }\n }\n\n public static hasAudienceClaim(token: string): boolean {\n try {\n // Split the token into its three parts\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"Invalid token format\");\n }\n\n // Base64 decode the payload\n const payload = parts[1]!;\n const decodedPayload = Buffer.from(payload, \"base64\");\n\n // Parse the decoded payload as JSON\n const payloadObject = JSON.parse(decodedPayload.toString());\n\n // Check if the payload has an 'aud' claim\n return \"aud\" in payloadObject;\n } catch (error) {\n return false;\n }\n }\n\n public static timestampToRFC3339(timestamp: number): string {\n const date = new Date(timestamp);\n const dateString = date.toISOString().replace(/\\.\\d+Z$/, \"Z\");\n return dateString;\n }\n\n public static getFileRelativePath(filePath: string): string {\n if (filePath) {\n let parts = filePath.split(\"/\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n\n parts = filePath.split(\"\\\\\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n }\n\n return filePath;\n }\n\n public static getReporterBackOffOptions: Partial<IBackOffOptions> = {\n numOfAttempts: 3,\n jitter: \"full\",\n retry: (error) => {\n if (error.response) {\n const status = error.response.status;\n if (Constants.NON_RETRYABLE_STATUS_CODES.includes(status)) {\n return false;\n }\n }\n return true;\n },\n };\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n public static isTimeGreaterThanCurrentPlus10Minutes(sasUri: StorageUri): boolean {\n try {\n const url = new URL(sasUri.uri);\n const params = new URLSearchParams(url.search);\n const expiryTime = params.get(\"se\"); // 'se' is the query parameter for the expiry time\n if (expiryTime) {\n const timestampFromIsoString = new Date(expiryTime).getTime();\n const currentTimestampPlus10Minutes = Date.now() + 10 * 60 * 1000;\n const isSasValidityGreaterThanCurrentTimePlus10Minutes =\n timestampFromIsoString > currentTimestampPlus10Minutes;\n if (!isSasValidityGreaterThanCurrentTimePlus10Minutes) {\n reporterLogger.info(\n `Sas rotation required because close to expiry, SasUriValidTillTime: ${timestampFromIsoString}, CurrentTime: ${currentTimestampPlus10Minutes}`,\n );\n }\n return isSasValidityGreaterThanCurrentTimePlus10Minutes;\n }\n reporterLogger.error(`Sas rotation required because expiry param not found.`);\n return false;\n } catch (error) {\n reporterLogger.error(`Sas rotation required because of ${error}.`);\n return false;\n }\n }\n\n public static getFileSize(attachmentPath: string): number {\n try {\n const stats = fs.statSync(attachmentPath);\n return stats.size;\n } catch (error) {\n return 0;\n }\n }\n\n public static getBufferSize(attachmentBody: Buffer): number {\n try {\n const fileSizeInBytes = attachmentBody.length;\n return fileSizeInBytes;\n } catch (error) {\n return 0;\n }\n }\n\n public redactAccessToken(info: string | undefined): string {\n if (!info || ReporterUtils.isNullOrEmpty(this.envVariables.accessToken)) {\n return \"\";\n }\n const accessTokenRegex = new RegExp(this.envVariables.accessToken, \"g\");\n return info.replace(accessTokenRegex, Constants.DEFAULT_REDACTED_MESSAGE);\n }\n public static getRegionFromAccountID(accountId: string): string | undefined {\n if (accountId.includes(\"_\")) {\n return accountId.split(\"_\")[0]!;\n } else {\n return;\n } // Handling for older workspaces without region in id\n }\n\n public progressBar(current: number, total: number): void {\n const width = 40;\n const percent = current / total;\n const completed = Math.round(width * percent);\n const remaining = width - completed;\n\n if (current % Math.round(total / 5) === 0 || current === total) {\n process.stdout.write(\"\\r\");\n process.stdout.write(\n `[${\"=\".repeat(completed)}${\" \".repeat(remaining)}] ${Math.round(percent * 100)}%`,\n );\n }\n }\n\n private getTestRunConfig(): TestRunConfig {\n const testRunConfig: TestRunConfig = {\n workers: this.getWorkers(),\n pwVersion: this.config.version,\n timeout: this.config.globalTimeout,\n repeatEach: this.config.projects[0].repeatEach,\n retries: this.config.projects[0].retries,\n shards: this.config.shard ? this.config.shard : { total: 1 },\n testFramework: {\n name: Constants.TEST_FRAMEWORK_NAME,\n version: this.config.version,\n runnerName: Constants.TEST_FRAMEWORK_RUNNERNAME,\n },\n testType: Constants.TEST_TYPE,\n testSdkLanguage: Constants.TEST_SDK_LANGUAGE,\n reporterPackageVersion: getPackageVersion(),\n };\n return testRunConfig;\n }\n\n private relativeLocation(location: Location | undefined): Location | undefined {\n if (!location) {\n return undefined;\n }\n const file = this.toPosixPath(path.relative(this.config.rootDir, location.file));\n return {\n file,\n line: location.line,\n column: location.column,\n };\n }\n\n private extractTestTags(input: TestCase): string[] {\n let tags: string[] = [];\n if (\"tags\" in input && Array.isArray(input.tags) && input.tags.length > 0) {\n tags = input.tags.map((tag) => tag.slice(1));\n return tags;\n }\n\n // Check if the input string contains tags directly\n const regex = /@(\\w+)/g;\n const matches = input.title.match(regex);\n if (matches) {\n tags = tags.concat(matches.map((match) => match.slice(1)));\n }\n\n // Try parsing the input string as a JavaScript object\n try {\n const obj = JSON.parse(`{${input}}`);\n if (obj.tag && Array.isArray(obj.tag)) {\n tags = tags.concat(obj.tag);\n }\n } catch (error) {\n // Ignore parsing errors\n }\n return tags;\n }\n\n private extractTestAnnotations(annotations: TestCase[\"annotations\"]): string[] {\n const result = annotations.map((annotation) => {\n if (annotation.type && annotation.description) {\n return `${annotation.type}: ${annotation.description}`;\n }\n return annotation.type;\n });\n return result;\n }\n\n private toPosixPath(aPath: string): string {\n return aPath.split(path.sep).join(path.posix.sep);\n }\n\n private getAttachmentStatus(testResult: TestResult): string {\n let attachmentStatus: string = \"\";\n for (const attachment of testResult.attachments) {\n if (attachment.contentType.includes(\"image\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"image\";\n } else if (attachment.contentType.includes(\"video\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"video\";\n } else if (attachment.contentType === \"application/zip\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"trace\";\n } else if (attachment.contentType === \"text/plain\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"txt\";\n }\n }\n return attachmentStatus;\n }\n\n private dedupeSteps(steps: TestStep[]): DedupedStep[] {\n const result: DedupedStep[] = [];\n let lastResult = undefined;\n for (const step of steps) {\n const canDedupe =\n !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;\n const lastStep = lastResult?.step;\n if (\n canDedupe &&\n lastResult &&\n lastStep &&\n step.category === lastStep.category &&\n step.title === lastStep.title &&\n step.location?.file === lastStep.location?.file &&\n step.location?.line === lastStep.location?.line &&\n step.location?.column === lastStep.location?.column\n ) {\n ++lastResult.count;\n lastResult.duration += step.duration;\n continue;\n }\n lastResult = { step, count: 1, duration: step.duration };\n result.push(lastResult);\n if (!canDedupe) {\n lastResult = undefined;\n }\n }\n return result;\n }\n\n private serializeTestStep(dedupedStep: DedupedStep): RawTestStep {\n const { step, duration, count } = dedupedStep;\n const result: RawTestStep = {\n title: step.title,\n category: step.category,\n startTime: step.startTime.toISOString(),\n duration,\n error: step.error ? step.error.message : undefined,\n location: this.relativeLocation(step.location),\n steps: this.dedupeSteps(step.steps).map((subStep) => this.serializeTestStep(subStep)),\n count: count,\n };\n return result;\n }\n\n private getTestStatus(test: TestCase, result: TestResult): string {\n if (test.expectedStatus === result.status) {\n if (result.status === \"skipped\") {\n return \"SKIPPED\";\n } else {\n return \"PASSED\";\n }\n } else if (result.status === \"interrupted\") {\n return \"SKIPPED\";\n } else {\n return \"FAILED\";\n }\n }\n\n private extractRootParentTitle(suite: Suite): string | undefined {\n // Traverse through the parent properties until reaching the root parent\n let currentSuite: Suite | undefined = suite;\n let depthCount: number = 0;\n let suiteTitle: string = currentSuite.title;\n const projectName = currentSuite.project()!.name;\n while (currentSuite?.parent && !ReporterUtils.isNullOrEmpty(currentSuite.parent.title)) {\n if (depthCount > 10 || currentSuite.parent.title === projectName) {\n break;\n }\n suiteTitle = suiteTitle + \" > \" + currentSuite.parent.title;\n currentSuite = currentSuite.parent;\n depthCount++;\n }\n return suiteTitle;\n }\n\n private async getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.provider === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n let gitCommitMessage: string | null = null;\n try {\n const gitVersion = await this.runCommand(Constants.GIT_VERSION_COMMAND);\n if (ReporterUtils.isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await this.runCommand(Constants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n gitCommitMessage = await this.runCommand(Constants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n reporterLogger.error(`\\nError in getting git commit message: ${err}.`);\n return \"\";\n }\n }\n\n private async runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n }\n\n public static isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n }\n\n private getTestError(result: TestResult): string {\n if (!result.errors || result.errors.length === 0) return \"\";\n const errorMessages: { message: string }[] = [];\n result.errors.forEach((error) => {\n if (error.message) errorMessages.push({ message: error.message });\n if (error.snippet && error.location) {\n errorMessages.push({\n message: error.snippet + \"\\n\\n\" + this.getReadableLineLocation(error.location),\n });\n } else if (error.snippet) errorMessages.push({ message: error.snippet });\n });\n return JSON.stringify(errorMessages, null, 2);\n }\n\n private getReadableLineLocation(location: Location): string {\n return `at ${location.file}:${location.line}:${location.column}`;\n }\n\n private getWorkers(): number {\n if (\n this.config.metadata &&\n \"actualWorkers\" in this.config.metadata &&\n typeof this.config.metadata.actualWorkers === \"number\"\n ) {\n return this.config.metadata.actualWorkers;\n }\n return this.config.workers;\n }\n}\n\nexport default ReporterUtils;\n"]}
|
|
@@ -5,7 +5,7 @@ import { ServiceErrorMessageConstants } from "../common/messages.js";
|
|
|
5
5
|
import { coreLogger } from "../common/logger.js";
|
|
6
6
|
import ReporterUtils from "./reporterUtils.js";
|
|
7
7
|
import { CIInfoProvider } from "./cIInfoProvider.js";
|
|
8
|
-
import
|
|
8
|
+
import process from "node:process";
|
|
9
9
|
import { parseJwt } from "./parseJwt.js";
|
|
10
10
|
import { getPlaywrightVersion } from "./getPlaywrightVersion.js";
|
|
11
11
|
import { createEntraIdAccessToken } from "../common/entraIdAccessToken.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,WAAW,EACX,SAAS,EACT,4BAA4B,EAC5B,oCAAoC,EACpC,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,0CAA0C;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAuC,EAAS,EAAE;IACvF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,6CAA6C;IAC7C,OAAO,CAAC,IAA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sB,CAAC,4BAA4B,CAAC,gCAAgC,CAAC,CAAC;IACxF,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { JwtPayload, VersionInfo } from \"../common/types.js\";\nimport {\n API_VERSION,\n Constants,\n InternalEnvironmentVariables,\n MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION,\n ServiceEnvironmentVariable,\n} from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport { coreLogger } from \"../common/logger.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport ReporterUtils from \"./reporterUtils.js\";\nimport { CIInfoProvider } from \"./cIInfoProvider.js\";\nimport * as process from \"node:process\";\nimport { parseJwt } from \"./parseJwt.js\";\nimport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nimport { createEntraIdAccessToken } from \"../common/entraIdAccessToken.js\";\n\n// Re-exporting for backward compatibility\nexport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nexport { parseJwt } from \"./parseJwt.js\";\n\nexport const exitWithFailureMessage = (error: { key: string; message: string }): never => {\n console.log();\n console.error(error.message);\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n};\n\nexport const populateValuesFromServiceUrl = (): { region: string; accountId: string } | null => {\n // Service URL format: wss://<region>.api.playwright.microsoft.com/accounts/<workspace-id>/browsers\n const url = process.env[\"PLAYWRIGHT_SERVICE_URL\"]!;\n if (!ReporterUtils.isNullOrEmpty(url)) {\n const parts = url.split(\"/\");\n\n if (parts.length > 2) {\n const subdomainParts = parts[2]!.split(\".\");\n const region = subdomainParts.length > 0 ? subdomainParts[0] : null;\n const accountId = parts[4];\n\n return { region: region!, accountId: accountId! };\n }\n }\n return null;\n};\n\nexport const getAccessToken = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n};\n\nexport const getServiceBaseURL = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_URL];\n};\n\nexport const getAndSetRunId = (): string => {\n const runId = ReporterUtils.getRunId(CIInfoProvider.getCIInfo());\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = runId;\n return runId;\n};\n\nexport const getServiceWSEndpoint = (runId: string, os: string): string => {\n return `${getServiceBaseURL()}?runId=${encodeURIComponent(runId)}&os=${os}&api-version=${API_VERSION}`;\n};\n\nexport const validateServiceUrl = (): void => {\n const serviceUrl = getServiceBaseURL();\n if (!serviceUrl) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n};\n\nexport const validateMptPAT = (\n validationFailureCallback: (error: { key: string; message: string }) => void,\n): void => {\n try {\n const accessToken = getAccessToken();\n const result = populateValuesFromServiceUrl();\n if (!accessToken) {\n validationFailureCallback(ServiceErrorMessageConstants.NO_AUTH_ERROR);\n }\n const claims = parseJwt<JwtPayload>(accessToken!);\n if (!claims.exp) {\n validationFailureCallback(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n if (Date.now() >= claims.exp! * 1000) {\n validationFailureCallback(ServiceErrorMessageConstants.EXPIRED_MPT_PAT_ERROR);\n }\n if (result!.accountId !== claims!.aid) {\n validationFailureCallback(ServiceErrorMessageConstants.WORKSPACE_MISMATCH_ERROR);\n }\n } catch (err) {\n coreLogger.error(err);\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n};\nconst isTokenExpiringSoon = (expirationTime: number, currentTime: number): boolean => {\n return expirationTime * 1000 - currentTime <= Constants.sevenDaysInMs;\n};\n\nconst warnAboutTokenExpiry = (expirationTime: number, currentTime: number): void => {\n const daysToExpiration = Math.ceil((expirationTime * 1000 - currentTime) / Constants.oneDayInMs);\n const expirationDate = new Date(expirationTime * 1000).toLocaleDateString();\n const expirationWarning = `Warning: The access token used for this test run will expire in ${daysToExpiration} days on ${expirationDate}. Generate a new token from the portal to avoid failures. For a simpler, more secure solution, switch to Microsoft Entra ID and eliminate token management. https://learn.microsoft.com/entra/identity/`;\n console.warn(expirationWarning);\n};\n\nexport const warnIfAccessTokenCloseToExpiry = (): void => {\n const accessToken = getAccessToken();\n const claims = parseJwt<JwtPayload>(accessToken!);\n const currentTime = Date.now();\n if (isTokenExpiringSoon(claims.exp!, currentTime)) {\n warnAboutTokenExpiry(claims.exp!, currentTime);\n }\n};\n\nexport const fetchOrValidateAccessToken = async (credential?: TokenCredential): Promise<string> => {\n const entraIdAccessToken = createEntraIdAccessToken(credential);\n if (entraIdAccessToken.token && entraIdAccessToken.doesEntraIdAccessTokenNeedRotation()) {\n await entraIdAccessToken.fetchEntraIdAccessToken();\n }\n if (!getAccessToken()) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);\n }\n return getAccessToken()!;\n};\n\nexport const emitReportingUrl = (): void => {\n const regex =\n /wss:\\/\\/([\\w-]+)\\.api\\.(playwright(?:-test|-int)?\\.io|playwright\\.microsoft\\.com)\\//;\n const url = getServiceBaseURL();\n const match = url?.match(regex);\n if (match && match.length >= 3) {\n const [, region, domain] = match;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL] =\n `https://${region}.reporting.api.${domain}`;\n }\n};\n\nexport const getPackageVersion = (): string => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const version = require(\"../../package.json\").version;\n return version;\n } catch (error) {\n console.error(\"Error fetching package version:\", error);\n return \"unknown version\";\n }\n};\nexport const getVersionInfo = (version: string): VersionInfo => {\n const regex = /^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?/;\n const match = version.match(regex);\n const versionInfo = {\n major: 0,\n minor: 0,\n patch: 0,\n };\n versionInfo.major = match && match[1] ? parseInt(match[1], 10) : 0;\n versionInfo.minor = match && match[2] ? parseInt(match[2], 10) : 0;\n versionInfo.patch = match && match[3] ? parseInt(match[3], 10) : 0;\n return versionInfo;\n};\n\nexport const validatePlaywrightVersion = (): void => {\n const minimumSupportedVersion = MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION;\n const installedVersion = getPlaywrightVersion();\n\n const minimumSupportedVersionInfo = getVersionInfo(minimumSupportedVersion);\n const installedVersionInfo = getVersionInfo(installedVersion);\n\n const isInstalledVersionGreater =\n installedVersionInfo.major > minimumSupportedVersionInfo.major ||\n (installedVersionInfo.major === minimumSupportedVersionInfo.major &&\n installedVersionInfo.minor >= minimumSupportedVersionInfo.minor);\n if (!isInstalledVersionGreater) {\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_PLAYWRIGHT_VERSION_ERROR);\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,WAAW,EACX,SAAS,EACT,4BAA4B,EAC5B,oCAAoC,EACpC,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,0CAA0C;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAuC,EAAS,EAAE;IACvF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,KAAK,CAAC,K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AAK,CAAC,CAAC;IACrE,IAAI,CAAC,yBAAyB,EAAE,CAAC;QAC/B,sBAAsB,CAAC,4BAA4B,CAAC,gCAAgC,CAAC,CAAC;IACxF,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { JwtPayload, VersionInfo } from \"../common/types.js\";\nimport {\n API_VERSION,\n Constants,\n InternalEnvironmentVariables,\n MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION,\n ServiceEnvironmentVariable,\n} from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport { coreLogger } from \"../common/logger.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport ReporterUtils from \"./reporterUtils.js\";\nimport { CIInfoProvider } from \"./cIInfoProvider.js\";\nimport process from \"node:process\";\nimport { parseJwt } from \"./parseJwt.js\";\nimport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nimport { createEntraIdAccessToken } from \"../common/entraIdAccessToken.js\";\n\n// Re-exporting for backward compatibility\nexport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nexport { parseJwt } from \"./parseJwt.js\";\n\nexport const exitWithFailureMessage = (error: { key: string; message: string }): never => {\n console.log();\n console.error(error.message);\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n};\n\nexport const populateValuesFromServiceUrl = (): { region: string; accountId: string } | null => {\n // Service URL format: wss://<region>.api.playwright.microsoft.com/accounts/<workspace-id>/browsers\n const url = process.env[\"PLAYWRIGHT_SERVICE_URL\"]!;\n if (!ReporterUtils.isNullOrEmpty(url)) {\n const parts = url.split(\"/\");\n\n if (parts.length > 2) {\n const subdomainParts = parts[2]!.split(\".\");\n const region = subdomainParts.length > 0 ? subdomainParts[0] : null;\n const accountId = parts[4];\n\n return { region: region!, accountId: accountId! };\n }\n }\n return null;\n};\n\nexport const getAccessToken = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n};\n\nexport const getServiceBaseURL = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_URL];\n};\n\nexport const getAndSetRunId = (): string => {\n const runId = ReporterUtils.getRunId(CIInfoProvider.getCIInfo());\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = runId;\n return runId;\n};\n\nexport const getServiceWSEndpoint = (runId: string, os: string): string => {\n return `${getServiceBaseURL()}?runId=${encodeURIComponent(runId)}&os=${os}&api-version=${API_VERSION}`;\n};\n\nexport const validateServiceUrl = (): void => {\n const serviceUrl = getServiceBaseURL();\n if (!serviceUrl) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n};\n\nexport const validateMptPAT = (\n validationFailureCallback: (error: { key: string; message: string }) => void,\n): void => {\n try {\n const accessToken = getAccessToken();\n const result = populateValuesFromServiceUrl();\n if (!accessToken) {\n validationFailureCallback(ServiceErrorMessageConstants.NO_AUTH_ERROR);\n }\n const claims = parseJwt<JwtPayload>(accessToken!);\n if (!claims.exp) {\n validationFailureCallback(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n if (Date.now() >= claims.exp! * 1000) {\n validationFailureCallback(ServiceErrorMessageConstants.EXPIRED_MPT_PAT_ERROR);\n }\n if (result!.accountId !== claims!.aid) {\n validationFailureCallback(ServiceErrorMessageConstants.WORKSPACE_MISMATCH_ERROR);\n }\n } catch (err) {\n coreLogger.error(err);\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n};\nconst isTokenExpiringSoon = (expirationTime: number, currentTime: number): boolean => {\n return expirationTime * 1000 - currentTime <= Constants.sevenDaysInMs;\n};\n\nconst warnAboutTokenExpiry = (expirationTime: number, currentTime: number): void => {\n const daysToExpiration = Math.ceil((expirationTime * 1000 - currentTime) / Constants.oneDayInMs);\n const expirationDate = new Date(expirationTime * 1000).toLocaleDateString();\n const expirationWarning = `Warning: The access token used for this test run will expire in ${daysToExpiration} days on ${expirationDate}. Generate a new token from the portal to avoid failures. For a simpler, more secure solution, switch to Microsoft Entra ID and eliminate token management. https://learn.microsoft.com/entra/identity/`;\n console.warn(expirationWarning);\n};\n\nexport const warnIfAccessTokenCloseToExpiry = (): void => {\n const accessToken = getAccessToken();\n const claims = parseJwt<JwtPayload>(accessToken!);\n const currentTime = Date.now();\n if (isTokenExpiringSoon(claims.exp!, currentTime)) {\n warnAboutTokenExpiry(claims.exp!, currentTime);\n }\n};\n\nexport const fetchOrValidateAccessToken = async (credential?: TokenCredential): Promise<string> => {\n const entraIdAccessToken = createEntraIdAccessToken(credential);\n if (entraIdAccessToken.token && entraIdAccessToken.doesEntraIdAccessTokenNeedRotation()) {\n await entraIdAccessToken.fetchEntraIdAccessToken();\n }\n if (!getAccessToken()) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);\n }\n return getAccessToken()!;\n};\n\nexport const emitReportingUrl = (): void => {\n const regex =\n /wss:\\/\\/([\\w-]+)\\.api\\.(playwright(?:-test|-int)?\\.io|playwright\\.microsoft\\.com)\\//;\n const url = getServiceBaseURL();\n const match = url?.match(regex);\n if (match && match.length >= 3) {\n const [, region, domain] = match;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL] =\n `https://${region}.reporting.api.${domain}`;\n }\n};\n\nexport const getPackageVersion = (): string => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const version = require(\"../../package.json\").version;\n return version;\n } catch (error) {\n console.error(\"Error fetching package version:\", error);\n return \"unknown version\";\n }\n};\nexport const getVersionInfo = (version: string): VersionInfo => {\n const regex = /^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?/;\n const match = version.match(regex);\n const versionInfo = {\n major: 0,\n minor: 0,\n patch: 0,\n };\n versionInfo.major = match && match[1] ? parseInt(match[1], 10) : 0;\n versionInfo.minor = match && match[2] ? parseInt(match[2], 10) : 0;\n versionInfo.patch = match && match[3] ? parseInt(match[3], 10) : 0;\n return versionInfo;\n};\n\nexport const validatePlaywrightVersion = (): void => {\n const minimumSupportedVersion = MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION;\n const installedVersion = getPlaywrightVersion();\n\n const minimumSupportedVersionInfo = getVersionInfo(minimumSupportedVersion);\n const installedVersionInfo = getVersionInfo(installedVersion);\n\n const isInstalledVersionGreater =\n installedVersionInfo.major > minimumSupportedVersionInfo.major ||\n (installedVersionInfo.major === minimumSupportedVersionInfo.major &&\n installedVersionInfo.minor >= minimumSupportedVersionInfo.minor);\n if (!isInstalledVersionGreater) {\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_PLAYWRIGHT_VERSION_ERROR);\n }\n};\n"]}
|
|
@@ -196,7 +196,7 @@ class ReporterUtils {
|
|
|
196
196
|
return runId;
|
|
197
197
|
}
|
|
198
198
|
static calculateSha1(buffer) {
|
|
199
|
-
const hash = (0, node_crypto_1.createHash)("
|
|
199
|
+
const hash = (0, node_crypto_1.createHash)("sha256");
|
|
200
200
|
hash.update(buffer);
|
|
201
201
|
return hash.digest("hex");
|
|
202
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporterUtils.js","sourceRoot":"","sources":["../../../src/utils/reporterUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAWlC,2DAA0C;AAC1C,mDAAqD;AACrD,6CAAqD;AAErD,8DAAyB;AACzB,kEAA6B;AAC7B,yDAAmD;AAGnD,oEAAwD;AAExD,gDAAyD;AAEzD,0DAAqE;AAErE,oDAA8C;AAE9C,2DAAmD;AACnD,2DAAqD;AAErD,yCAA+C;AAC/C,MAAM,aAAa;IAWjB,wEAAwE;IACxE,YAAY,YAAkC,EAAE,MAAkB,EAAE,CAAQ;QAC1E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAA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,CAAC;YACL,CAAC;iBAAM,IAAI,KAAK,CAAC,OAAO;gBAAE,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IAEO,uBAAuB,CAAC,QAAkB;QAChD,OAAO,MAAM,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;IACnE,CAAC;IAEO,UAAU;QAChB,IACE,IAAI,CAAC,MAAM,CAAC,QAAQ;YACpB,eAAe,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ;YACvC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,KAAK,QAAQ,EACtD,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC5C,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IAC7B,CAAC;;AAlVa,uCAAyB,GAA6B;IAClE,aAAa,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,IAAI,wBAAS,CAAC,0BAA0B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1D,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAyUJ,kBAAe,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n Location,\n TestCase,\n TestResult,\n TestStep,\n FullConfig,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { exec } from \"node:child_process\";\nimport { reporterLogger } from \"../common/logger.js\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport type { IBackOffOptions } from \"../common/types.js\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Constants } from \"../common/constants.js\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables.js\";\nimport type { DedupedStep, RawTestStep } from \"../common/types.js\";\nimport { TokenType } from \"../model/mptTokenDetails.js\";\nimport type { UploadMetadata } from \"../model/shard.js\";\nimport { Shard, TestRunStatus } from \"../model/shard.js\";\nimport type { RawTestResult } from \"../model/testResult.js\";\nimport { TestResult as MPTTestResult } from \"../model/testResult.js\";\nimport type { TestRunConfig } from \"../model/testRun.js\";\nimport { TestRun } from \"../model/testRun.js\";\nimport type { CIInfo } from \"./cIInfoProvider.js\";\nimport { CI_PROVIDERS } from \"./cIInfoProvider.js\";\nimport { CIInfoProvider } from \"./cIInfoProvider.js\";\nimport type { StorageUri } from \"../model/storageUri.js\";\nimport { getPackageVersion } from \"./utils.js\";\nclass ReporterUtils {\n private envVariables: EnvironmentVariables;\n\n private config: FullConfig;\n totalTests: number;\n failedTests: number;\n skippedTests: number;\n passedTests: number;\n flakyTests: number;\n startTime: number;\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n constructor(envVariables: EnvironmentVariables, config: FullConfig, _: Suite) {\n this.config = config;\n this.envVariables = envVariables;\n this.startTime = Date.now();\n\n this.totalTests = 0;\n this.failedTests = 0;\n this.skippedTests = 0;\n this.passedTests = 0;\n this.flakyTests = 0;\n }\n\n public async getTestRunObject(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = new TestRun();\n const runName = this.envVariables.runName || (await this.getRunName(ciInfo));\n testRun.testRunId = this.envVariables.runId;\n testRun.displayName = ReporterUtils.isNullOrEmpty(runName) ? this.envVariables.runId : runName;\n testRun.creatorName = this.envVariables.userName;\n testRun.creatorId = this.envVariables.userId!;\n testRun.startTime = ReporterUtils.timestampToRFC3339(this.startTime);\n testRun.ciConfig = {\n ciProviderName: ciInfo.provider!,\n branch: ciInfo.branch!,\n author: ciInfo.author!,\n commitId: ciInfo.commitId!,\n revisionUrl: ciInfo.revisionUrl!,\n };\n testRun.testRunConfig = this.getTestRunConfig();\n testRun.cloudReportingEnabled = \"true\";\n return testRun;\n }\n\n public getTestRunShardStartObject(): Shard {\n const shard = new Shard();\n if (this.config.shard !== null && this.config.shard !== undefined) {\n this.envVariables.shardId = this.config.shard.current.toString();\n } else {\n this.envVariables.shardId = \"1\";\n }\n shard.shardId = this.envVariables.shardId;\n shard.summary = {\n startTime: ReporterUtils.timestampToRFC3339(this.startTime),\n };\n shard.uploadCompleted = false;\n return shard;\n }\n\n public getTestRunShardEndObject(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Shard {\n shard.shardId = this.envVariables.shardId ?? \"1\";\n shard.summary.totalTime = result.duration;\n shard.summary.endTime = ReporterUtils.timestampToRFC3339(Date.now());\n shard.summary.status = TestRunStatus.CLIENT_COMPLETE;\n shard.summary.errorMessages = errorMessages;\n shard.summary.uploadMetadata = attachmentMetadata;\n shard.uploadCompleted = true;\n shard.workers = workers;\n return shard;\n }\n\n public getOSName(result: TestResult, data: string): string {\n try {\n for (const attachment of result.attachments) {\n if (attachment.name === data) {\n const match = attachment?.contentType?.match(/charset=(.*)/);\n const charset = match && match.length > 1 ? match[1] : \"utf-8\";\n return attachment.body?.toString((charset as any) || \"utf-8\").toUpperCase() || \"\";\n }\n }\n } catch (error) {\n reporterLogger.error(`Error in fetching OS - ${error}`);\n }\n return \"\";\n }\n\n public getTestResultObject(test: TestCase, result: TestResult, jobName: string): MPTTestResult {\n switch (test.outcome()) {\n case \"skipped\":\n this.skippedTests++;\n this.totalTests++;\n break;\n case \"expected\":\n this.passedTests++;\n this.totalTests++;\n break;\n case \"unexpected\":\n if (result.retry === test.retries) {\n this.failedTests++;\n this.totalTests++;\n }\n break;\n case \"flaky\":\n this.totalTests++;\n this.flakyTests++;\n break;\n default:\n break;\n }\n\n const testResult = new MPTTestResult();\n testResult.runId = this.envVariables.runId;\n testResult.shardId = this.envVariables.runId + \"_\" + this.envVariables.shardId;\n testResult.accountId = this.envVariables.accountId!;\n testResult.suiteId = ReporterUtils.calculateSha1(`${test.parent.title}-${test.location.file}`);\n testResult.testId = testResult.suiteId.concat(`-${ReporterUtils.calculateSha1(test.title)}`);\n testResult.testCombinationId = test.id;\n testResult.testExecutionId = randomUUID();\n testResult.testTitle = test.title;\n testResult.suiteTitle = this.extractRootParentTitle(test.parent)!;\n testResult.fileName = test.location.file;\n testResult.status = this.getTestStatus(test, result);\n testResult.lineNumber = test.location.line;\n testResult.retry = result.retry ? result.retry : 0;\n let browserName = test.parent.project()?.use.browserName?.toLowerCase();\n if (!browserName) {\n browserName = test.parent.project()?.use.defaultBrowserType?.toLowerCase();\n }\n testResult.webTestConfig = {\n jobName: jobName,\n projectName: test.parent.project()!.name,\n browserType: browserName ? browserName.toUpperCase() : \"\",\n os: this.getOSName(result, Constants.OS),\n };\n testResult.annotations = this.extractTestAnnotations(test.annotations);\n testResult.tags = this.extractTestTags(test);\n testResult.resultsSummary = {\n status: result.status.toUpperCase(),\n duration: result.duration,\n startTime: result.startTime.toISOString().replace(/\\.\\d+Z$/, \"Z\"),\n attachmentsMetadata: this.getAttachmentStatus(result),\n };\n testResult.artifactsPath = result.attachments\n .filter((attachment) => attachment?.path !== null && attachment?.path !== undefined) // Filter attachments with defined and non-null path property\n .map(\n (attachment) =>\n `${testResult.testExecutionId}/${ReporterUtils.getFileRelativePath(attachment.path!)}`,\n );\n return testResult;\n }\n\n public generateMarkdownSummary(testRunUrl: string): void {\n try {\n if (CIInfoProvider.getCIProvider() === CI_PROVIDERS.GITHUB) {\n const markdownContent = `\n#### Microsoft Playwright Testing run summary\n\n#### Results:\n \n **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: this.getTestError(result),\n stdErr: result.stderr ? JSON.stringify(result.stderr, null, 2) : \"\",\n stdOut: result.stdout ? JSON.stringify(result.stdout, null, 2) : \"\",\n };\n return rawTestResult;\n }\n\n public static getRunId(cIInfo: CIInfo): string {\n if (cIInfo === null || cIInfo.provider === CI_PROVIDERS.DEFAULT) {\n return randomUUID();\n }\n\n const concatString = `${cIInfo.provider}-${cIInfo.repo}-${cIInfo.runId}-${cIInfo.runAttempt}`;\n const runId = ReporterUtils.calculateSha1(concatString);\n return runId;\n }\n\n public static calculateSha1(buffer: Buffer | string): string {\n const hash = createHash(\"sha1\");\n hash.update(buffer);\n return hash.digest(\"hex\");\n }\n\n /*\n public static getTokenDetails(accessToken: string) {\n let tokenDetails = new MPTTokenDetails();\n try {\n const token = accessToken.split('.')[1];\n const _token = Buffer.from(token, 'base64');\n tokenDetails = JSON.parse(_token.toString());\n } catch (err) {\n throw err;\n }\n return tokenDetails;\n }\n */\n\n public static getTokenDetails<T>(accessToken: string, tokenType: TokenType): T {\n const token = accessToken.split(\".\")[1]!;\n const _token = Buffer.from(token, \"base64\");\n const tokenDetails = JSON.parse(_token.toString());\n\n switch (tokenType) {\n case TokenType.MPT:\n return tokenDetails as T;\n case TokenType.ENTRA:\n return tokenDetails as T;\n default:\n throw new Error(\"Unsupported token type\");\n }\n }\n\n public static hasAudienceClaim(token: string): boolean {\n try {\n // Split the token into its three parts\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"Invalid token format\");\n }\n\n // Base64 decode the payload\n const payload = parts[1]!;\n const decodedPayload = Buffer.from(payload, \"base64\");\n\n // Parse the decoded payload as JSON\n const payloadObject = JSON.parse(decodedPayload.toString());\n\n // Check if the payload has an 'aud' claim\n return \"aud\" in payloadObject;\n } catch (error) {\n return false;\n }\n }\n\n public static timestampToRFC3339(timestamp: number): string {\n const date = new Date(timestamp);\n const dateString = date.toISOString().replace(/\\.\\d+Z$/, \"Z\");\n return dateString;\n }\n\n public static getFileRelativePath(filePath: string): string {\n if (filePath) {\n let parts = filePath.split(\"/\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n\n parts = filePath.split(\"\\\\\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n }\n\n return filePath;\n }\n\n public static getReporterBackOffOptions: Partial<IBackOffOptions> = {\n numOfAttempts: 3,\n jitter: \"full\",\n retry: (error) => {\n if (error.response) {\n const status = error.response.status;\n if (Constants.NON_RETRYABLE_STATUS_CODES.includes(status)) {\n return false;\n }\n }\n return true;\n },\n };\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n public static isTimeGreaterThanCurrentPlus10Minutes(sasUri: StorageUri): boolean {\n try {\n const url = new URL(sasUri.uri);\n const params = new URLSearchParams(url.search);\n const expiryTime = params.get(\"se\"); // 'se' is the query parameter for the expiry time\n if (expiryTime) {\n const timestampFromIsoString = new Date(expiryTime).getTime();\n const currentTimestampPlus10Minutes = Date.now() + 10 * 60 * 1000;\n const isSasValidityGreaterThanCurrentTimePlus10Minutes =\n timestampFromIsoString > currentTimestampPlus10Minutes;\n if (!isSasValidityGreaterThanCurrentTimePlus10Minutes) {\n reporterLogger.info(\n `Sas rotation required because close to expiry, SasUriValidTillTime: ${timestampFromIsoString}, CurrentTime: ${currentTimestampPlus10Minutes}`,\n );\n }\n return isSasValidityGreaterThanCurrentTimePlus10Minutes;\n }\n reporterLogger.error(`Sas rotation required because expiry param not found.`);\n return false;\n } catch (error) {\n reporterLogger.error(`Sas rotation required because of ${error}.`);\n return false;\n }\n }\n\n public static getFileSize(attachmentPath: string): number {\n try {\n const stats = fs.statSync(attachmentPath);\n return stats.size;\n } catch (error) {\n return 0;\n }\n }\n\n public static getBufferSize(attachmentBody: Buffer): number {\n try {\n const fileSizeInBytes = attachmentBody.length;\n return fileSizeInBytes;\n } catch (error) {\n return 0;\n }\n }\n\n public redactAccessToken(info: string | undefined): string {\n if (!info || ReporterUtils.isNullOrEmpty(this.envVariables.accessToken)) {\n return \"\";\n }\n const accessTokenRegex = new RegExp(this.envVariables.accessToken, \"g\");\n return info.replace(accessTokenRegex, Constants.DEFAULT_REDACTED_MESSAGE);\n }\n public static getRegionFromAccountID(accountId: string): string | undefined {\n if (accountId.includes(\"_\")) {\n return accountId.split(\"_\")[0]!;\n } else {\n return;\n } // Handling for older workspaces without region in id\n }\n\n public progressBar(current: number, total: number): void {\n const width = 40;\n const percent = current / total;\n const completed = Math.round(width * percent);\n const remaining = width - completed;\n\n if (current % Math.round(total / 5) === 0 || current === total) {\n process.stdout.write(\"\\r\");\n process.stdout.write(\n `[${\"=\".repeat(completed)}${\" \".repeat(remaining)}] ${Math.round(percent * 100)}%`,\n );\n }\n }\n\n private getTestRunConfig(): TestRunConfig {\n const testRunConfig: TestRunConfig = {\n workers: this.getWorkers(),\n pwVersion: this.config.version,\n timeout: this.config.globalTimeout,\n repeatEach: this.config.projects[0].repeatEach,\n retries: this.config.projects[0].retries,\n shards: this.config.shard ? this.config.shard : { total: 1 },\n testFramework: {\n name: Constants.TEST_FRAMEWORK_NAME,\n version: this.config.version,\n runnerName: Constants.TEST_FRAMEWORK_RUNNERNAME,\n },\n testType: Constants.TEST_TYPE,\n testSdkLanguage: Constants.TEST_SDK_LANGUAGE,\n reporterPackageVersion: getPackageVersion(),\n };\n return testRunConfig;\n }\n\n private relativeLocation(location: Location | undefined): Location | undefined {\n if (!location) {\n return undefined;\n }\n const file = this.toPosixPath(path.relative(this.config.rootDir, location.file));\n return {\n file,\n line: location.line,\n column: location.column,\n };\n }\n\n private extractTestTags(input: TestCase): string[] {\n let tags: string[] = [];\n if (\"tags\" in input && Array.isArray(input.tags) && input.tags.length > 0) {\n tags = input.tags.map((tag) => tag.slice(1));\n return tags;\n }\n\n // Check if the input string contains tags directly\n const regex = /@(\\w+)/g;\n const matches = input.title.match(regex);\n if (matches) {\n tags = tags.concat(matches.map((match) => match.slice(1)));\n }\n\n // Try parsing the input string as a JavaScript object\n try {\n const obj = JSON.parse(`{${input}}`);\n if (obj.tag && Array.isArray(obj.tag)) {\n tags = tags.concat(obj.tag);\n }\n } catch (error) {\n // Ignore parsing errors\n }\n return tags;\n }\n\n private extractTestAnnotations(annotations: TestCase[\"annotations\"]): string[] {\n const result = annotations.map((annotation) => {\n if (annotation.type && annotation.description) {\n return `${annotation.type}: ${annotation.description}`;\n }\n return annotation.type;\n });\n return result;\n }\n\n private toPosixPath(aPath: string): string {\n return aPath.split(path.sep).join(path.posix.sep);\n }\n\n private getAttachmentStatus(testResult: TestResult): string {\n let attachmentStatus: string = \"\";\n for (const attachment of testResult.attachments) {\n if (attachment.contentType.includes(\"image\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"image\";\n } else if (attachment.contentType.includes(\"video\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"video\";\n } else if (attachment.contentType === \"application/zip\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"trace\";\n } else if (attachment.contentType === \"text/plain\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"txt\";\n }\n }\n return attachmentStatus;\n }\n\n private dedupeSteps(steps: TestStep[]): DedupedStep[] {\n const result: DedupedStep[] = [];\n let lastResult = undefined;\n for (const step of steps) {\n const canDedupe =\n !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;\n const lastStep = lastResult?.step;\n if (\n canDedupe &&\n lastResult &&\n lastStep &&\n step.category === lastStep.category &&\n step.title === lastStep.title &&\n step.location?.file === lastStep.location?.file &&\n step.location?.line === lastStep.location?.line &&\n step.location?.column === lastStep.location?.column\n ) {\n ++lastResult.count;\n lastResult.duration += step.duration;\n continue;\n }\n lastResult = { step, count: 1, duration: step.duration };\n result.push(lastResult);\n if (!canDedupe) {\n lastResult = undefined;\n }\n }\n return result;\n }\n\n private serializeTestStep(dedupedStep: DedupedStep): RawTestStep {\n const { step, duration, count } = dedupedStep;\n const result: RawTestStep = {\n title: step.title,\n category: step.category,\n startTime: step.startTime.toISOString(),\n duration,\n error: step.error ? step.error.message : undefined,\n location: this.relativeLocation(step.location),\n steps: this.dedupeSteps(step.steps).map((subStep) => this.serializeTestStep(subStep)),\n count: count,\n };\n return result;\n }\n\n private getTestStatus(test: TestCase, result: TestResult): string {\n if (test.expectedStatus === result.status) {\n if (result.status === \"skipped\") {\n return \"SKIPPED\";\n } else {\n return \"PASSED\";\n }\n } else if (result.status === \"interrupted\") {\n return \"SKIPPED\";\n } else {\n return \"FAILED\";\n }\n }\n\n private extractRootParentTitle(suite: Suite): string | undefined {\n // Traverse through the parent properties until reaching the root parent\n let currentSuite: Suite | undefined = suite;\n let depthCount: number = 0;\n let suiteTitle: string = currentSuite.title;\n const projectName = currentSuite.project()!.name;\n while (currentSuite?.parent && !ReporterUtils.isNullOrEmpty(currentSuite.parent.title)) {\n if (depthCount > 10 || currentSuite.parent.title === projectName) {\n break;\n }\n suiteTitle = suiteTitle + \" > \" + currentSuite.parent.title;\n currentSuite = currentSuite.parent;\n depthCount++;\n }\n return suiteTitle;\n }\n\n private async getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.provider === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n let gitCommitMessage: string | null = null;\n try {\n const gitVersion = await this.runCommand(Constants.GIT_VERSION_COMMAND);\n if (ReporterUtils.isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await this.runCommand(Constants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n gitCommitMessage = await this.runCommand(Constants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n reporterLogger.error(`\\nError in getting git commit message: ${err}.`);\n return \"\";\n }\n }\n\n private async runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n }\n\n public static isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n }\n\n private getTestError(result: TestResult): string {\n if (!result.errors || result.errors.length === 0) return \"\";\n const errorMessages: { message: string }[] = [];\n result.errors.forEach((error) => {\n if (error.message) errorMessages.push({ message: error.message });\n if (error.snippet && error.location) {\n errorMessages.push({\n message: error.snippet + \"\\n\\n\" + this.getReadableLineLocation(error.location),\n });\n } else if (error.snippet) errorMessages.push({ message: error.snippet });\n });\n return JSON.stringify(errorMessages, null, 2);\n }\n\n private getReadableLineLocation(location: Location): string {\n return `at ${location.file}:${location.line}:${location.column}`;\n }\n\n private getWorkers(): number {\n if (\n this.config.metadata &&\n \"actualWorkers\" in this.config.metadata &&\n typeof this.config.metadata.actualWorkers === \"number\"\n ) {\n return this.config.metadata.actualWorkers;\n }\n return this.config.workers;\n }\n}\n\nexport default ReporterUtils;\n"]}
|
|
1
|
+
{"version":3,"file":"reporterUtils.js","sourceRoot":"","sources":["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AM,EAAE,MAAM;IACd,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,IAAI,wBAAS,CAAC,0BAA0B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1D,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAyUJ,kBAAe,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n Location,\n TestCase,\n TestResult,\n TestStep,\n FullConfig,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { exec } from \"node:child_process\";\nimport { reporterLogger } from \"../common/logger.js\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport type { IBackOffOptions } from \"../common/types.js\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Constants } from \"../common/constants.js\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables.js\";\nimport type { DedupedStep, RawTestStep } from \"../common/types.js\";\nimport { TokenType } from \"../model/mptTokenDetails.js\";\nimport type { UploadMetadata } from \"../model/shard.js\";\nimport { Shard, TestRunStatus } from \"../model/shard.js\";\nimport type { RawTestResult } from \"../model/testResult.js\";\nimport { TestResult as MPTTestResult } from \"../model/testResult.js\";\nimport type { TestRunConfig } from \"../model/testRun.js\";\nimport { TestRun } from \"../model/testRun.js\";\nimport type { CIInfo } from \"./cIInfoProvider.js\";\nimport { CI_PROVIDERS } from \"./cIInfoProvider.js\";\nimport { CIInfoProvider } from \"./cIInfoProvider.js\";\nimport type { StorageUri } from \"../model/storageUri.js\";\nimport { getPackageVersion } from \"./utils.js\";\nclass ReporterUtils {\n private envVariables: EnvironmentVariables;\n\n private config: FullConfig;\n totalTests: number;\n failedTests: number;\n skippedTests: number;\n passedTests: number;\n flakyTests: number;\n startTime: number;\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n constructor(envVariables: EnvironmentVariables, config: FullConfig, _: Suite) {\n this.config = config;\n this.envVariables = envVariables;\n this.startTime = Date.now();\n\n this.totalTests = 0;\n this.failedTests = 0;\n this.skippedTests = 0;\n this.passedTests = 0;\n this.flakyTests = 0;\n }\n\n public async getTestRunObject(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = new TestRun();\n const runName = this.envVariables.runName || (await this.getRunName(ciInfo));\n testRun.testRunId = this.envVariables.runId;\n testRun.displayName = ReporterUtils.isNullOrEmpty(runName) ? this.envVariables.runId : runName;\n testRun.creatorName = this.envVariables.userName;\n testRun.creatorId = this.envVariables.userId!;\n testRun.startTime = ReporterUtils.timestampToRFC3339(this.startTime);\n testRun.ciConfig = {\n ciProviderName: ciInfo.provider!,\n branch: ciInfo.branch!,\n author: ciInfo.author!,\n commitId: ciInfo.commitId!,\n revisionUrl: ciInfo.revisionUrl!,\n };\n testRun.testRunConfig = this.getTestRunConfig();\n testRun.cloudReportingEnabled = \"true\";\n return testRun;\n }\n\n public getTestRunShardStartObject(): Shard {\n const shard = new Shard();\n if (this.config.shard !== null && this.config.shard !== undefined) {\n this.envVariables.shardId = this.config.shard.current.toString();\n } else {\n this.envVariables.shardId = \"1\";\n }\n shard.shardId = this.envVariables.shardId;\n shard.summary = {\n startTime: ReporterUtils.timestampToRFC3339(this.startTime),\n };\n shard.uploadCompleted = false;\n return shard;\n }\n\n public getTestRunShardEndObject(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Shard {\n shard.shardId = this.envVariables.shardId ?? \"1\";\n shard.summary.totalTime = result.duration;\n shard.summary.endTime = ReporterUtils.timestampToRFC3339(Date.now());\n shard.summary.status = TestRunStatus.CLIENT_COMPLETE;\n shard.summary.errorMessages = errorMessages;\n shard.summary.uploadMetadata = attachmentMetadata;\n shard.uploadCompleted = true;\n shard.workers = workers;\n return shard;\n }\n\n public getOSName(result: TestResult, data: string): string {\n try {\n for (const attachment of result.attachments) {\n if (attachment.name === data) {\n const match = attachment?.contentType?.match(/charset=(.*)/);\n const charset = match && match.length > 1 ? match[1] : \"utf-8\";\n return attachment.body?.toString((charset as any) || \"utf-8\").toUpperCase() || \"\";\n }\n }\n } catch (error) {\n reporterLogger.error(`Error in fetching OS - ${error}`);\n }\n return \"\";\n }\n\n public getTestResultObject(test: TestCase, result: TestResult, jobName: string): MPTTestResult {\n switch (test.outcome()) {\n case \"skipped\":\n this.skippedTests++;\n this.totalTests++;\n break;\n case \"expected\":\n this.passedTests++;\n this.totalTests++;\n break;\n case \"unexpected\":\n if (result.retry === test.retries) {\n this.failedTests++;\n this.totalTests++;\n }\n break;\n case \"flaky\":\n this.totalTests++;\n this.flakyTests++;\n break;\n default:\n break;\n }\n\n const testResult = new MPTTestResult();\n testResult.runId = this.envVariables.runId;\n testResult.shardId = this.envVariables.runId + \"_\" + this.envVariables.shardId;\n testResult.accountId = this.envVariables.accountId!;\n testResult.suiteId = ReporterUtils.calculateSha1(`${test.parent.title}-${test.location.file}`);\n testResult.testId = testResult.suiteId.concat(`-${ReporterUtils.calculateSha1(test.title)}`);\n testResult.testCombinationId = test.id;\n testResult.testExecutionId = randomUUID();\n testResult.testTitle = test.title;\n testResult.suiteTitle = this.extractRootParentTitle(test.parent)!;\n testResult.fileName = test.location.file;\n testResult.status = this.getTestStatus(test, result);\n testResult.lineNumber = test.location.line;\n testResult.retry = result.retry ? result.retry : 0;\n let browserName = test.parent.project()?.use.browserName?.toLowerCase();\n if (!browserName) {\n browserName = test.parent.project()?.use.defaultBrowserType?.toLowerCase();\n }\n testResult.webTestConfig = {\n jobName: jobName,\n projectName: test.parent.project()!.name,\n browserType: browserName ? browserName.toUpperCase() : \"\",\n os: this.getOSName(result, Constants.OS),\n };\n testResult.annotations = this.extractTestAnnotations(test.annotations);\n testResult.tags = this.extractTestTags(test);\n testResult.resultsSummary = {\n status: result.status.toUpperCase(),\n duration: result.duration,\n startTime: result.startTime.toISOString().replace(/\\.\\d+Z$/, \"Z\"),\n attachmentsMetadata: this.getAttachmentStatus(result),\n };\n testResult.artifactsPath = result.attachments\n .filter((attachment) => attachment?.path !== null && attachment?.path !== undefined) // Filter attachments with defined and non-null path property\n .map(\n (attachment) =>\n `${testResult.testExecutionId}/${ReporterUtils.getFileRelativePath(attachment.path!)}`,\n );\n return testResult;\n }\n\n public generateMarkdownSummary(testRunUrl: string): void {\n try {\n if (CIInfoProvider.getCIProvider() === CI_PROVIDERS.GITHUB) {\n const markdownContent = `\n#### Microsoft Playwright Testing run summary\n\n#### Results:\n \n **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: this.getTestError(result),\n stdErr: result.stderr ? JSON.stringify(result.stderr, null, 2) : \"\",\n stdOut: result.stdout ? JSON.stringify(result.stdout, null, 2) : \"\",\n };\n return rawTestResult;\n }\n\n public static getRunId(cIInfo: CIInfo): string {\n if (cIInfo === null || cIInfo.provider === CI_PROVIDERS.DEFAULT) {\n return randomUUID();\n }\n\n const concatString = `${cIInfo.provider}-${cIInfo.repo}-${cIInfo.runId}-${cIInfo.runAttempt}`;\n const runId = ReporterUtils.calculateSha1(concatString);\n return runId;\n }\n\n public static calculateSha1(buffer: Buffer | string): string {\n const hash = createHash(\"sha256\");\n hash.update(buffer);\n return hash.digest(\"hex\");\n }\n\n /*\n public static getTokenDetails(accessToken: string) {\n let tokenDetails = new MPTTokenDetails();\n try {\n const token = accessToken.split('.')[1];\n const _token = Buffer.from(token, 'base64');\n tokenDetails = JSON.parse(_token.toString());\n } catch (err) {\n throw err;\n }\n return tokenDetails;\n }\n */\n\n public static getTokenDetails<T>(accessToken: string, tokenType: TokenType): T {\n const token = accessToken.split(\".\")[1]!;\n const _token = Buffer.from(token, \"base64\");\n const tokenDetails = JSON.parse(_token.toString());\n\n switch (tokenType) {\n case TokenType.MPT:\n return tokenDetails as T;\n case TokenType.ENTRA:\n return tokenDetails as T;\n default:\n throw new Error(\"Unsupported token type\");\n }\n }\n\n public static hasAudienceClaim(token: string): boolean {\n try {\n // Split the token into its three parts\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"Invalid token format\");\n }\n\n // Base64 decode the payload\n const payload = parts[1]!;\n const decodedPayload = Buffer.from(payload, \"base64\");\n\n // Parse the decoded payload as JSON\n const payloadObject = JSON.parse(decodedPayload.toString());\n\n // Check if the payload has an 'aud' claim\n return \"aud\" in payloadObject;\n } catch (error) {\n return false;\n }\n }\n\n public static timestampToRFC3339(timestamp: number): string {\n const date = new Date(timestamp);\n const dateString = date.toISOString().replace(/\\.\\d+Z$/, \"Z\");\n return dateString;\n }\n\n public static getFileRelativePath(filePath: string): string {\n if (filePath) {\n let parts = filePath.split(\"/\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n\n parts = filePath.split(\"\\\\\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n }\n\n return filePath;\n }\n\n public static getReporterBackOffOptions: Partial<IBackOffOptions> = {\n numOfAttempts: 3,\n jitter: \"full\",\n retry: (error) => {\n if (error.response) {\n const status = error.response.status;\n if (Constants.NON_RETRYABLE_STATUS_CODES.includes(status)) {\n return false;\n }\n }\n return true;\n },\n };\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n public static isTimeGreaterThanCurrentPlus10Minutes(sasUri: StorageUri): boolean {\n try {\n const url = new URL(sasUri.uri);\n const params = new URLSearchParams(url.search);\n const expiryTime = params.get(\"se\"); // 'se' is the query parameter for the expiry time\n if (expiryTime) {\n const timestampFromIsoString = new Date(expiryTime).getTime();\n const currentTimestampPlus10Minutes = Date.now() + 10 * 60 * 1000;\n const isSasValidityGreaterThanCurrentTimePlus10Minutes =\n timestampFromIsoString > currentTimestampPlus10Minutes;\n if (!isSasValidityGreaterThanCurrentTimePlus10Minutes) {\n reporterLogger.info(\n `Sas rotation required because close to expiry, SasUriValidTillTime: ${timestampFromIsoString}, CurrentTime: ${currentTimestampPlus10Minutes}`,\n );\n }\n return isSasValidityGreaterThanCurrentTimePlus10Minutes;\n }\n reporterLogger.error(`Sas rotation required because expiry param not found.`);\n return false;\n } catch (error) {\n reporterLogger.error(`Sas rotation required because of ${error}.`);\n return false;\n }\n }\n\n public static getFileSize(attachmentPath: string): number {\n try {\n const stats = fs.statSync(attachmentPath);\n return stats.size;\n } catch (error) {\n return 0;\n }\n }\n\n public static getBufferSize(attachmentBody: Buffer): number {\n try {\n const fileSizeInBytes = attachmentBody.length;\n return fileSizeInBytes;\n } catch (error) {\n return 0;\n }\n }\n\n public redactAccessToken(info: string | undefined): string {\n if (!info || ReporterUtils.isNullOrEmpty(this.envVariables.accessToken)) {\n return \"\";\n }\n const accessTokenRegex = new RegExp(this.envVariables.accessToken, \"g\");\n return info.replace(accessTokenRegex, Constants.DEFAULT_REDACTED_MESSAGE);\n }\n public static getRegionFromAccountID(accountId: string): string | undefined {\n if (accountId.includes(\"_\")) {\n return accountId.split(\"_\")[0]!;\n } else {\n return;\n } // Handling for older workspaces without region in id\n }\n\n public progressBar(current: number, total: number): void {\n const width = 40;\n const percent = current / total;\n const completed = Math.round(width * percent);\n const remaining = width - completed;\n\n if (current % Math.round(total / 5) === 0 || current === total) {\n process.stdout.write(\"\\r\");\n process.stdout.write(\n `[${\"=\".repeat(completed)}${\" \".repeat(remaining)}] ${Math.round(percent * 100)}%`,\n );\n }\n }\n\n private getTestRunConfig(): TestRunConfig {\n const testRunConfig: TestRunConfig = {\n workers: this.getWorkers(),\n pwVersion: this.config.version,\n timeout: this.config.globalTimeout,\n repeatEach: this.config.projects[0].repeatEach,\n retries: this.config.projects[0].retries,\n shards: this.config.shard ? this.config.shard : { total: 1 },\n testFramework: {\n name: Constants.TEST_FRAMEWORK_NAME,\n version: this.config.version,\n runnerName: Constants.TEST_FRAMEWORK_RUNNERNAME,\n },\n testType: Constants.TEST_TYPE,\n testSdkLanguage: Constants.TEST_SDK_LANGUAGE,\n reporterPackageVersion: getPackageVersion(),\n };\n return testRunConfig;\n }\n\n private relativeLocation(location: Location | undefined): Location | undefined {\n if (!location) {\n return undefined;\n }\n const file = this.toPosixPath(path.relative(this.config.rootDir, location.file));\n return {\n file,\n line: location.line,\n column: location.column,\n };\n }\n\n private extractTestTags(input: TestCase): string[] {\n let tags: string[] = [];\n if (\"tags\" in input && Array.isArray(input.tags) && input.tags.length > 0) {\n tags = input.tags.map((tag) => tag.slice(1));\n return tags;\n }\n\n // Check if the input string contains tags directly\n const regex = /@(\\w+)/g;\n const matches = input.title.match(regex);\n if (matches) {\n tags = tags.concat(matches.map((match) => match.slice(1)));\n }\n\n // Try parsing the input string as a JavaScript object\n try {\n const obj = JSON.parse(`{${input}}`);\n if (obj.tag && Array.isArray(obj.tag)) {\n tags = tags.concat(obj.tag);\n }\n } catch (error) {\n // Ignore parsing errors\n }\n return tags;\n }\n\n private extractTestAnnotations(annotations: TestCase[\"annotations\"]): string[] {\n const result = annotations.map((annotation) => {\n if (annotation.type && annotation.description) {\n return `${annotation.type}: ${annotation.description}`;\n }\n return annotation.type;\n });\n return result;\n }\n\n private toPosixPath(aPath: string): string {\n return aPath.split(path.sep).join(path.posix.sep);\n }\n\n private getAttachmentStatus(testResult: TestResult): string {\n let attachmentStatus: string = \"\";\n for (const attachment of testResult.attachments) {\n if (attachment.contentType.includes(\"image\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"image\";\n } else if (attachment.contentType.includes(\"video\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"video\";\n } else if (attachment.contentType === \"application/zip\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"trace\";\n } else if (attachment.contentType === \"text/plain\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"txt\";\n }\n }\n return attachmentStatus;\n }\n\n private dedupeSteps(steps: TestStep[]): DedupedStep[] {\n const result: DedupedStep[] = [];\n let lastResult = undefined;\n for (const step of steps) {\n const canDedupe =\n !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;\n const lastStep = lastResult?.step;\n if (\n canDedupe &&\n lastResult &&\n lastStep &&\n step.category === lastStep.category &&\n step.title === lastStep.title &&\n step.location?.file === lastStep.location?.file &&\n step.location?.line === lastStep.location?.line &&\n step.location?.column === lastStep.location?.column\n ) {\n ++lastResult.count;\n lastResult.duration += step.duration;\n continue;\n }\n lastResult = { step, count: 1, duration: step.duration };\n result.push(lastResult);\n if (!canDedupe) {\n lastResult = undefined;\n }\n }\n return result;\n }\n\n private serializeTestStep(dedupedStep: DedupedStep): RawTestStep {\n const { step, duration, count } = dedupedStep;\n const result: RawTestStep = {\n title: step.title,\n category: step.category,\n startTime: step.startTime.toISOString(),\n duration,\n error: step.error ? step.error.message : undefined,\n location: this.relativeLocation(step.location),\n steps: this.dedupeSteps(step.steps).map((subStep) => this.serializeTestStep(subStep)),\n count: count,\n };\n return result;\n }\n\n private getTestStatus(test: TestCase, result: TestResult): string {\n if (test.expectedStatus === result.status) {\n if (result.status === \"skipped\") {\n return \"SKIPPED\";\n } else {\n return \"PASSED\";\n }\n } else if (result.status === \"interrupted\") {\n return \"SKIPPED\";\n } else {\n return \"FAILED\";\n }\n }\n\n private extractRootParentTitle(suite: Suite): string | undefined {\n // Traverse through the parent properties until reaching the root parent\n let currentSuite: Suite | undefined = suite;\n let depthCount: number = 0;\n let suiteTitle: string = currentSuite.title;\n const projectName = currentSuite.project()!.name;\n while (currentSuite?.parent && !ReporterUtils.isNullOrEmpty(currentSuite.parent.title)) {\n if (depthCount > 10 || currentSuite.parent.title === projectName) {\n break;\n }\n suiteTitle = suiteTitle + \" > \" + currentSuite.parent.title;\n currentSuite = currentSuite.parent;\n depthCount++;\n }\n return suiteTitle;\n }\n\n private async getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.provider === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n let gitCommitMessage: string | null = null;\n try {\n const gitVersion = await this.runCommand(Constants.GIT_VERSION_COMMAND);\n if (ReporterUtils.isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await this.runCommand(Constants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n gitCommitMessage = await this.runCommand(Constants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n reporterLogger.error(`\\nError in getting git commit message: ${err}.`);\n return \"\";\n }\n }\n\n private async runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n }\n\n public static isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n }\n\n private getTestError(result: TestResult): string {\n if (!result.errors || result.errors.length === 0) return \"\";\n const errorMessages: { message: string }[] = [];\n result.errors.forEach((error) => {\n if (error.message) errorMessages.push({ message: error.message });\n if (error.snippet && error.location) {\n errorMessages.push({\n message: error.snippet + \"\\n\\n\" + this.getReadableLineLocation(error.location),\n });\n } else if (error.snippet) errorMessages.push({ message: error.snippet });\n });\n return JSON.stringify(errorMessages, null, 2);\n }\n\n private getReadableLineLocation(location: Location): string {\n return `at ${location.file}:${location.line}:${location.column}`;\n }\n\n private getWorkers(): number {\n if (\n this.config.metadata &&\n \"actualWorkers\" in this.config.metadata &&\n typeof this.config.metadata.actualWorkers === \"number\"\n ) {\n return this.config.metadata.actualWorkers;\n }\n return this.config.workers;\n }\n}\n\nexport default ReporterUtils;\n"]}
|
|
@@ -9,7 +9,7 @@ const messages_js_1 = require("../common/messages.js");
|
|
|
9
9
|
const logger_js_1 = require("../common/logger.js");
|
|
10
10
|
const reporterUtils_js_1 = tslib_1.__importDefault(require("./reporterUtils.js"));
|
|
11
11
|
const cIInfoProvider_js_1 = require("./cIInfoProvider.js");
|
|
12
|
-
const
|
|
12
|
+
const node_process_1 = tslib_1.__importDefault(require("node:process"));
|
|
13
13
|
const parseJwt_js_1 = require("./parseJwt.js");
|
|
14
14
|
const getPlaywrightVersion_js_1 = require("./getPlaywrightVersion.js");
|
|
15
15
|
const entraIdAccessToken_js_1 = require("../common/entraIdAccessToken.js");
|
|
@@ -22,12 +22,12 @@ const exitWithFailureMessage = (error) => {
|
|
|
22
22
|
console.log();
|
|
23
23
|
console.error(error.message);
|
|
24
24
|
// eslint-disable-next-line n/no-process-exit
|
|
25
|
-
|
|
25
|
+
node_process_1.default.exit(1);
|
|
26
26
|
};
|
|
27
27
|
exports.exitWithFailureMessage = exitWithFailureMessage;
|
|
28
28
|
const populateValuesFromServiceUrl = () => {
|
|
29
29
|
// Service URL format: wss://<region>.api.playwright.microsoft.com/accounts/<workspace-id>/browsers
|
|
30
|
-
const url =
|
|
30
|
+
const url = node_process_1.default.env["PLAYWRIGHT_SERVICE_URL"];
|
|
31
31
|
if (!reporterUtils_js_1.default.isNullOrEmpty(url)) {
|
|
32
32
|
const parts = url.split("/");
|
|
33
33
|
if (parts.length > 2) {
|
|
@@ -41,16 +41,16 @@ const populateValuesFromServiceUrl = () => {
|
|
|
41
41
|
};
|
|
42
42
|
exports.populateValuesFromServiceUrl = populateValuesFromServiceUrl;
|
|
43
43
|
const getAccessToken = () => {
|
|
44
|
-
return
|
|
44
|
+
return node_process_1.default.env[constants_js_1.ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];
|
|
45
45
|
};
|
|
46
46
|
exports.getAccessToken = getAccessToken;
|
|
47
47
|
const getServiceBaseURL = () => {
|
|
48
|
-
return
|
|
48
|
+
return node_process_1.default.env[constants_js_1.ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_URL];
|
|
49
49
|
};
|
|
50
50
|
exports.getServiceBaseURL = getServiceBaseURL;
|
|
51
51
|
const getAndSetRunId = () => {
|
|
52
52
|
const runId = reporterUtils_js_1.default.getRunId(cIInfoProvider_js_1.CIInfoProvider.getCIInfo());
|
|
53
|
-
|
|
53
|
+
node_process_1.default.env[constants_js_1.InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = runId;
|
|
54
54
|
return runId;
|
|
55
55
|
};
|
|
56
56
|
exports.getAndSetRunId = getAndSetRunId;
|
|
@@ -124,7 +124,7 @@ const emitReportingUrl = () => {
|
|
|
124
124
|
const match = url === null || url === void 0 ? void 0 : url.match(regex);
|
|
125
125
|
if (match && match.length >= 3) {
|
|
126
126
|
const [, region, domain] = match;
|
|
127
|
-
|
|
127
|
+
node_process_1.default.env[constants_js_1.InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL] =
|
|
128
128
|
`https://${region}.reporting.api.${domain}`;
|
|
129
129
|
}
|
|
130
130
|
};
|