@azure/microsoft-playwright-testing 1.0.0-alpha.20250117.3 → 1.0.0-alpha.20250123.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/common/constants.d.ts +2 -3
  3. package/dist/common/constants.d.ts.map +1 -1
  4. package/dist/common/constants.js +2 -3
  5. package/dist/common/constants.js.map +1 -1
  6. package/dist/common/playwrightServiceConfig.d.ts.map +1 -1
  7. package/dist/common/playwrightServiceConfig.js +2 -2
  8. package/dist/common/playwrightServiceConfig.js.map +1 -1
  9. package/dist/common/types.d.ts +26 -67
  10. package/dist/common/types.d.ts.map +1 -1
  11. package/dist/common/types.js.map +1 -1
  12. package/dist/core/global/playwright-service-global-setup.d.ts +1 -1
  13. package/dist/core/global/playwright-service-global-setup.d.ts.map +1 -1
  14. package/dist/core/global/playwright-service-global-setup.js.map +1 -1
  15. package/dist/core/global/playwright-service-global-teardown.d.ts +1 -1
  16. package/dist/core/global/playwright-service-global-teardown.d.ts.map +1 -1
  17. package/dist/core/global/playwright-service-global-teardown.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/reporter/mptReporter.d.ts +2 -2
  22. package/dist/reporter/mptReporter.d.ts.map +1 -1
  23. package/dist/reporter/mptReporter.js +3 -3
  24. package/dist/reporter/mptReporter.js.map +1 -1
  25. package/dist/utils/cIInfoProvider.d.ts +1 -1
  26. package/dist/utils/cIInfoProvider.d.ts.map +1 -1
  27. package/dist/utils/cIInfoProvider.js +3 -5
  28. package/dist/utils/cIInfoProvider.js.map +1 -1
  29. package/dist/utils/reporterUtils.d.ts +1 -0
  30. package/dist/utils/reporterUtils.d.ts.map +1 -1
  31. package/dist/utils/reporterUtils.js +9 -1
  32. package/dist/utils/reporterUtils.js.map +1 -1
  33. package/dist/utils/serviceClient.js +1 -1
  34. package/dist/utils/serviceClient.js.map +1 -1
  35. package/dist/utils/utils.js +1 -1
  36. package/dist/utils/utils.js.map +1 -1
  37. package/package.json +2 -2
  38. package/types/microsoft-playwright-testing.d.ts +37 -79
  39. package/types/reporter/microsoft-playwright-testing.d.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"mptReporter.js","sourceRoot":"","sources":["../../src/reporter/mptReporter.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAUlC,6CAAkD;AAClD,mDAI6B;AAC7B,yEAAsE;AACtE,iDAA8C;AAG9C,8DAAqD;AAMrD,4DAAyD;AACzD,mFAAmD;AACnD,0DAAuD;AACvD,0DAAuD;AAEvD,iDAAkE;AAClE,0CAA8E;AAE9E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW;IA4Bf,YAAY,MAAkC;QA3BtC,iBAAY,GAAY,IAAI,CAAC;QAC7B,wBAAmB,GAAG,IAAI,CAAC;QAC3B,kBAAa,GAAY,IAAI,CAAC;QAE9B,0BAAqB,GAAY,KAAK,CAAC;QACvC,WAAM,GAAW,+BAAc,CAAC,SAAS,EAAE,CAAC;QAK5C,mBAAc,GAAG,IAAI,mBAAQ,EAAkB,CAAC;QAEhD,qBAAgB,GAAoB,EAAE,CAAC;QACvC,oBAAe,GAAuB,IAAI,GAAG,EAAiB,CAAC;QAC/D,kBAAa,GAAa,EAAE,CAAC;QAC7B,0BAAqB,GAAa,EAAE,CAAC;QACrC,8BAAyB,GAAa,EAAE,CAAC;QAEzC,mBAAc,GAAmB;YACvC,cAAc,EAAE,CAAC;YACjB,mBAAmB,EAAE,CAAC;YACtB,oBAAoB,EAAE,CAAC;SACxB,CAAC;QACM,eAAU,GAAW,CAAC,CAAC,CAAC;QACxB,eAAU,GAAW,EAAE,CAAC;QACxB,wBAAmB,GAAY,IAAI,CAAC;QAgBpC,6BAAwB,GAAG,CAAC,OAAe,EAAQ,EAAE;YAC3D,IAAI,CAAC,qBAAqB,CAAC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,EAC1B,CAAC;YACD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC9B,oCAAwB,CAAC,OAAO,CAAC,CAAC,uBAAuB,EAAE,EAAE;oBAC3D,IAAI,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC;wBACzE,OAAO;oBACT,CAAC;oBACD,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;oBACnC,IAAI,CAAC,YAAY;wBAAE,OAAO;oBAC1B,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBAClE,IAAI,KAAK,EAAE,CAAC;wBACV,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;wBACjE,IAAI,CAAC,wBAAwB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,aAAa;QACX,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AACD,kBAAe,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n TestCase,\n TestResult,\n FullConfig,\n Reporter,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { reporterLogger } from \"../common/logger\";\nimport {\n Constants,\n InternalEnvironmentVariables,\n TestResultErrorConstants,\n} from \"../common/constants\";\nimport { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { MultiMap } from \"../common/multimap\";\nimport type { EntraTokenDetails } from \"../model/entraTokenDetails\";\nimport type { MPTTokenDetails } from \"../model/mptTokenDetails\";\nimport { TokenType } from \"../model/mptTokenDetails\";\nimport type { Shard, UploadMetadata } from \"../model/shard\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport type { TestResult as MPTTestResult, RawTestResult } from \"../model/testResult\";\nimport type { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"../utils/cIInfoProvider\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider\";\nimport ReporterUtils from \"../utils/reporterUtils\";\nimport { ServiceClient } from \"../utils/serviceClient\";\nimport { StorageClient } from \"../utils/storageClient\";\nimport type { MPTReporterConfig } from \"../common/types\";\nimport { ServiceErrorMessageConstants } from \"../common/messages\";\nimport { validateMptPAT, populateValuesFromServiceUrl } from \"../utils/utils\";\n\n/**\n * @public\n *\n * Extends Playwright's Reporter class to enable Microsoft Playwright Testing's Reporting\n * feature to publish test results and related artifacts and\n * view them in the service portal for faster and easier troubleshooting.\n *\n * @example\n *\n * ```\n * import { defineConfig } from \"@playwright/test\";\n *\n * export default defineConfig({\n * reporter: [[\"@azure/microsoft-playwright-testing/reporter\"]]\n * });\n * ```\n */\nclass MPTReporter implements Reporter {\n private isTokenValid: boolean = true;\n private enableGitHubSummary = true;\n private isRegionValid: boolean = true;\n private shard!: Shard;\n private isTestRunStartSuccess: boolean = false;\n private ciInfo: CIInfo = CIInfoProvider.getCIInfo();\n private serviceClient!: ServiceClient;\n private storageClient!: StorageClient;\n private reporterUtils!: ReporterUtils;\n private envVariables!: EnvironmentVariables;\n private testRawResults = new MultiMap<string, string>();\n private promiseOnBegin!: Promise<boolean>;\n private _testEndPromises: Promise<void>[] = [];\n private testResultBatch: Set<MPTTestResult> = new Set<MPTTestResult>();\n private errorMessages: string[] = [];\n private informationalMessages: string[] = [];\n private processedErrorMessageKeys: string[] = [];\n private sasUri!: StorageUri;\n private uploadMetadata: UploadMetadata = {\n numTestResults: 0,\n numTotalAttachments: 0,\n sizeTotalAttachments: 0,\n };\n private numWorkers: number = -1;\n private testRunUrl: string = \"\";\n private enableResultPublish: boolean = true;\n\n constructor(config: Partial<MPTReporterConfig>) {\n if (config?.enableGitHubSummary !== undefined) {\n this.enableGitHubSummary = config.enableGitHubSummary;\n }\n if (config?.enableResultPublish !== undefined) {\n this.enableResultPublish = config.enableResultPublish;\n }\n }\n private _addError(errorMessage: string): void {\n if (this.errorMessages.length < Constants.ERROR_MESSAGES_MAX_LENGTH) {\n this.errorMessages.push(this.reporterUtils.redactAccessToken(errorMessage));\n }\n }\n\n private _addInformationalMessage = (message: string): void => {\n this.informationalMessages.push(message);\n };\n\n private _addKeyToInformationMessage = (key: string): void => {\n this.processedErrorMessageKeys.push(key);\n };\n\n private _isInformationMessagePresent = (key: string): boolean => {\n return this.processedErrorMessageKeys.includes(key);\n };\n private _reporterFailureHandler = (error: { key: string; message: string }): void => {\n if (!this._isInformationMessagePresent(error.key)) {\n this._addKeyToInformationMessage(error.key);\n this._addInformationalMessage(error.message);\n }\n this.isTokenValid = false;\n };\n /**\n * @public\n *\n * Called once before running tests.\n *\n * @param config - Resolved configuration.\n * @param suite - The root suite that contains all projects, files and test cases.\n */\n onBegin(config: FullConfig, suite: Suite): void {\n if (!this.enableResultPublish) return;\n this.initializeMPTReporter();\n this.reporterUtils = new ReporterUtils(this.envVariables, config, suite);\n if (this.isTokenValid && this.isRegionValid) {\n this.serviceClient = new ServiceClient(\n this.envVariables,\n this.reporterUtils,\n this._addInformationalMessage,\n this._isInformationMessagePresent,\n this._addKeyToInformationMessage,\n );\n this.promiseOnBegin = this._onBegin();\n }\n }\n\n /**\n * @public\n *\n * Called after a test has been finished in the worker process.\n *\n * @param test - Test that has been finished.\n * @param result - Result of the test run.\n */\n onTestEnd(test: TestCase, result: TestResult): void {\n this.numWorkers = Math.max(this.numWorkers, result.parallelIndex + 1);\n this.processTestResult(result);\n if (!this.enableResultPublish) return;\n // Process test result\n this._onTestEnd(test, result);\n // Upload the test results batch\n try {\n if (this.testResultBatch.size >= Constants.TEST_BATCH_SIZE) {\n const currResultBatch: MPTTestResult[] = [...this.testResultBatch];\n if (this.isTestRunStartSuccess) {\n this._testEndPromises.push(this.serviceClient.postTestResults(currResultBatch));\n reporterLogger.info(`\\nAdded test results batch for upload.`);\n this.testResultBatch.clear();\n }\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test results: ${err.message}.`);\n }\n }\n\n /**\n * @public\n *\n * Called after all tests have been run, or testing has been interrupted. Note that this method may return a [Promise]\n * and Playwright Test will await it. Reporter is allowed to override the status and hence affect the exit code of the\n * test runner.\n *\n * @param result - Result of the full test run, `status` can be one of:\n * - `'passed'` - Everything went as expected.\n * - `'failed'` - Any test has failed.\n * - `'timedout'` - The\n * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout | testConfig.globalTimeout} has\n * been reached.\n * - `'interrupted'` - Interrupted by the user.\n */\n async onEnd(result: FullResult): Promise<void> {\n if (this.enableResultPublish) {\n await this._onEnd(result);\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n } else {\n let count: number = 0;\n process.stdout.write(\"\\nUploading test results.\");\n await Promise.allSettled(this._testEndPromises).then((values) => {\n values.forEach((value) => {\n if (value.status === \"fulfilled\") {\n count++;\n this.reporterUtils.progressBar(count, this._testEndPromises.length);\n }\n return value.status;\n });\n reporterLogger.info(`\\nTest result processing completed.`);\n return values;\n });\n try {\n await this.serviceClient.postTestRunShardEnd(\n result,\n this.shard,\n this.errorMessages,\n this.uploadMetadata,\n this.numWorkers,\n );\n reporterLogger.info(`\\nTest run successfully uploaded.`);\n\n if (this.enableGitHubSummary) {\n this.reporterUtils.generateMarkdownSummary(this.testRunUrl);\n }\n\n process.stdout.write(`\\nTest report: ${this.testRunUrl}\\n`);\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in completing test run: ${err.message}`);\n process.stdout.write(`\\nUnable to complete test results upload.`);\n }\n }\n }\n this.displayAdditionalInformation();\n }\n\n private async _onBegin(): Promise<boolean> {\n process.stdout.write(`\\n`);\n try {\n const testRunResponse: TestRun | undefined = await this.serviceClient.patchTestRun(\n this.ciInfo,\n );\n reporterLogger.info(\n `\\nTest run report successfully initialized: ${testRunResponse?.displayName}.`,\n );\n process.stdout.write(\n `Initializing reporting for this test run. You can view the results at: https://playwright.microsoft.com/workspaces/${encodeURIComponent(this.envVariables.accountId!)}/runs/${encodeURIComponent(this.envVariables.runId!)}\\n`,\n );\n const shardResponse = await this.serviceClient.postTestRunShardStart();\n this.shard = shardResponse;\n // Set test report link as environment variable. If/else to check if environment variable defined or not.\n if (\n Constants.DEFAULT_SERVICE_ENDPOINT &&\n this.envVariables.accountId &&\n this.envVariables.runId\n ) {\n this.testRunUrl = `${Constants.DEFAULT_DASHBOARD_ENDPOINT}/workspaces/${encodeURIComponent(\n this.envVariables.accountId,\n )}/runs/${encodeURIComponent(this.envVariables.runId)}`;\n }\n return true;\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in initializing test run report: ${err.message}.`);\n return false;\n }\n }\n\n private async _onTestEnd(test: TestCase, result: TestResult): Promise<undefined> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n this.uploadMetadata.numTestResults++;\n const testResultObject: MPTTestResult = this.reporterUtils.getTestResultObject(\n test,\n result,\n this.ciInfo.jobId!,\n );\n this.testResultBatch.add(testResultObject);\n // Store test attachments in array\n const testAttachments: string[] = [];\n const otherAttachments: any[] = [];\n for (const attachment of result.attachments) {\n if (attachment.path !== undefined && attachment.path !== \"\") {\n testAttachments.push(attachment.path);\n this.uploadMetadata.numTotalAttachments++;\n this.uploadMetadata.sizeTotalAttachments += ReporterUtils.getFileSize(attachment.path);\n } else if (attachment.body instanceof Buffer) {\n otherAttachments.push(attachment);\n this.uploadMetadata.numTotalAttachments++;\n this.uploadMetadata.sizeTotalAttachments += ReporterUtils.getBufferSize(attachment.body);\n }\n }\n\n // Get raw result object and store it in map\n const rawTestResult: RawTestResult = this.reporterUtils.getRawTestResultObject(result);\n this.testRawResults.set(testResultObject.testExecutionId, JSON.stringify(rawTestResult));\n this._testEndPromises.push(\n this._uploadTestResultAttachments(\n testResultObject.testExecutionId,\n testAttachments,\n otherAttachments,\n ),\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in processing test result: ${err.message}.`);\n }\n }\n\n private async _onEnd(_: FullResult): Promise<void> {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n try {\n // Upload the remaining test results\n if (this.testResultBatch.size > 0) {\n await this.serviceClient.postTestResults([...this.testResultBatch]);\n reporterLogger.info(`\\nUploaded test results batch successfully.`);\n this.testResultBatch.clear();\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test run information: ${err.message}`);\n }\n }\n private renewSasUriIfNeeded = async (): Promise<void> => {\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n this.sasUri = await this.serviceClient.createStorageUri();\n reporterLogger.info(\n `\\nFetched SAS URI with validity: ${this.sasUri.expiresAt} and access: ${this.sasUri.accessLevel}.`,\n );\n }\n };\n private async _uploadTestResultAttachments(\n testExecutionId: string,\n testAttachments: string[],\n otherAttachments: any[],\n ): Promise<void> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n\n for (const attachmentPath of testAttachments) {\n const fileRelativePath = `${testExecutionId}/${ReporterUtils.getFileRelativePath(attachmentPath)}`;\n await this.renewSasUriIfNeeded();\n await this.storageClient.uploadFile(this.sasUri.uri, attachmentPath, fileRelativePath);\n }\n\n for (const otherAttachment of otherAttachments) {\n await this.renewSasUriIfNeeded();\n const match = otherAttachment?.contentType?.match(/charset=(.*)/);\n const charset = match && match.length > 1 ? match[1] : \"utf-8\";\n await this.storageClient.uploadBuffer(\n this.sasUri.uri,\n otherAttachment.body.toString((charset as any) || \"utf-8\"),\n `${testExecutionId}/${otherAttachment.name}`,\n );\n }\n\n const rawTestResult = this.testRawResults.get(testExecutionId);\n await this.renewSasUriIfNeeded();\n await this.storageClient.uploadBuffer(\n this.sasUri.uri,\n rawTestResult[0]!,\n `${testExecutionId}/rawTestResult.json`,\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test result attachments: ${err.message}`);\n }\n }\n\n private initializeMPTReporter(): void {\n this.envVariables = new EnvironmentVariables();\n if (process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] === \"true\") {\n this.isTokenValid = false;\n return;\n }\n if (!process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]) {\n process.stdout.write(\"\\nReporting service url not found.\");\n this.isTokenValid = false;\n return;\n }\n reporterLogger.info(`Reporting url - ${process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]}`);\n if (this.envVariables.accessToken === undefined || this.envVariables.accessToken === \"\") {\n process.stdout.write(`\\n${ServiceErrorMessageConstants.NO_AUTH_ERROR.message}`);\n this.isTokenValid = false;\n } else if (ReporterUtils.hasAudienceClaim(this.envVariables.accessToken)) {\n const result = populateValuesFromServiceUrl();\n this.envVariables.region = result!.region;\n this.envVariables.accountId = result!.accountId;\n const entraTokenDetails: EntraTokenDetails = ReporterUtils.getTokenDetails<EntraTokenDetails>(\n this.envVariables.accessToken,\n TokenType.ENTRA,\n );\n this.envVariables.userId = entraTokenDetails.oid;\n this.envVariables.userName = entraTokenDetails.name;\n } else {\n const mptTokenDetails: MPTTokenDetails = ReporterUtils.getTokenDetails<MPTTokenDetails>(\n this.envVariables.accessToken,\n TokenType.MPT,\n );\n validateMptPAT(this._reporterFailureHandler);\n this.envVariables.accountId = mptTokenDetails.aid;\n this.envVariables.userId = mptTokenDetails.oid;\n this.envVariables.userName = mptTokenDetails.userName;\n this.envVariables.region = ReporterUtils.getRegionFromAccountID(this.envVariables.accountId!);\n }\n this.storageClient = new StorageClient();\n if (\n this.envVariables.region &&\n !Constants.SupportedRegions.includes(this.envVariables.region!) &&\n this.isTokenValid\n ) {\n process.stdout.write(\n `\\nUnsupported region's workspace used to generate the input Access Token; the supported regions are ${Constants.SupportedRegions.join(\n \", \",\n )}`,\n );\n this.isRegionValid = false;\n }\n if (this.envVariables.runId === undefined || this.envVariables.runId === \"\") {\n this.envVariables.runId = ReporterUtils.getRunId(this.ciInfo);\n }\n }\n\n private displayAdditionalInformation(): void {\n if (this.informationalMessages.length > 0) console.info(); // Add a new line before displaying the messages\n this.informationalMessages.forEach((message, index) => {\n console.info(`${index + 1}. ${message}`);\n });\n }\n\n private processTestResult(result: TestResult): void {\n if (\n process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] &&\n result.status !== \"passed\"\n ) {\n result.errors.forEach((error) => {\n TestResultErrorConstants.forEach((testResultErrorParseObj) => {\n if (this.processedErrorMessageKeys.includes(testResultErrorParseObj.key)) {\n return;\n }\n const errorMessage = error.message;\n if (!errorMessage) return;\n const match = errorMessage.match(testResultErrorParseObj.pattern);\n if (match) {\n this.processedErrorMessageKeys.push(testResultErrorParseObj.key);\n this._addInformationalMessage(testResultErrorParseObj.message);\n }\n });\n });\n }\n }\n\n /**\n * @public\n *\n * Whether this reporter uses stdio for reporting. When it does not, Playwright Test could add some output to enhance\n * user experience. If your reporter does not print to the terminal, it is strongly recommended to return `false`.\n */\n printsToStdio(): boolean {\n return true;\n }\n}\nexport default MPTReporter;\n"]}
1
+ {"version":3,"file":"mptReporter.js","sourceRoot":"","sources":["../../src/reporter/mptReporter.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAUlC,6CAA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G,KAAK,CAAC,OAAO,CAAC;oBACnC,IAAI,CAAC,YAAY;wBAAE,OAAO;oBAC1B,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBAClE,IAAI,KAAK,EAAE,CAAC;wBACV,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;wBACjE,IAAI,CAAC,wBAAwB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,aAAa;QACX,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AACD,kBAAe,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n TestCase,\n TestResult,\n FullConfig,\n Reporter,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { reporterLogger } from \"../common/logger\";\nimport {\n Constants,\n InternalEnvironmentVariables,\n TestResultErrorConstants,\n} from \"../common/constants\";\nimport { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { MultiMap } from \"../common/multimap\";\nimport type { EntraTokenDetails } from \"../model/entraTokenDetails\";\nimport type { MPTTokenDetails } from \"../model/mptTokenDetails\";\nimport { TokenType } from \"../model/mptTokenDetails\";\nimport type { Shard, UploadMetadata } from \"../model/shard\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport type { TestResult as MPTTestResult, RawTestResult } from \"../model/testResult\";\nimport type { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"../utils/cIInfoProvider\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider\";\nimport ReporterUtils from \"../utils/reporterUtils\";\nimport { ServiceClient } from \"../utils/serviceClient\";\nimport { StorageClient } from \"../utils/storageClient\";\nimport type { ReporterConfiguration } from \"../common/types\";\nimport { ServiceErrorMessageConstants } from \"../common/messages\";\nimport { validateMptPAT, populateValuesFromServiceUrl } from \"../utils/utils\";\n\n/**\n * @public\n *\n * Extends Playwright's Reporter class to enable Microsoft Playwright Testing's Reporting\n * feature to publish test results and related artifacts and\n * view them in the service portal for faster and easier troubleshooting.\n *\n * @example\n *\n * ```\n * import { defineConfig } from \"@playwright/test\";\n *\n * export default defineConfig({\n * reporter: [[\"@azure/microsoft-playwright-testing/reporter\"]]\n * });\n * ```\n */\nclass MPTReporter implements Reporter {\n private isTokenValid: boolean = true;\n private enableGitHubSummary = true;\n private isRegionValid: boolean = true;\n private shard!: Shard;\n private isTestRunStartSuccess: boolean = false;\n private ciInfo: CIInfo = CIInfoProvider.getCIInfo();\n private serviceClient!: ServiceClient;\n private storageClient!: StorageClient;\n private reporterUtils!: ReporterUtils;\n private envVariables!: EnvironmentVariables;\n private testRawResults = new MultiMap<string, string>();\n private promiseOnBegin!: Promise<boolean>;\n private _testEndPromises: Promise<void>[] = [];\n private testResultBatch: Set<MPTTestResult> = new Set<MPTTestResult>();\n private errorMessages: string[] = [];\n private informationalMessages: string[] = [];\n private processedErrorMessageKeys: string[] = [];\n private sasUri!: StorageUri;\n private uploadMetadata: UploadMetadata = {\n numTestResults: 0,\n numTotalAttachments: 0,\n sizeTotalAttachments: 0,\n };\n private numWorkers: number = -1;\n private testRunUrl: string = \"\";\n private enableResultPublish: boolean = true;\n\n constructor(config: Partial<ReporterConfiguration>) {\n if (config?.enableGitHubSummary !== undefined) {\n this.enableGitHubSummary = config.enableGitHubSummary;\n }\n if (config?.enableResultPublish !== undefined) {\n this.enableResultPublish = config.enableResultPublish;\n }\n }\n private _addError(errorMessage: string): void {\n if (this.errorMessages.length < Constants.ERROR_MESSAGES_MAX_LENGTH) {\n this.errorMessages.push(this.reporterUtils.redactAccessToken(errorMessage));\n }\n }\n\n private _addInformationalMessage = (message: string): void => {\n this.informationalMessages.push(message);\n };\n\n private _addKeyToInformationMessage = (key: string): void => {\n this.processedErrorMessageKeys.push(key);\n };\n\n private _isInformationMessagePresent = (key: string): boolean => {\n return this.processedErrorMessageKeys.includes(key);\n };\n private _reporterFailureHandler = (error: { key: string; message: string }): void => {\n if (!this._isInformationMessagePresent(error.key)) {\n this._addKeyToInformationMessage(error.key);\n this._addInformationalMessage(error.message);\n }\n this.isTokenValid = false;\n };\n /**\n * @public\n *\n * Called once before running tests.\n *\n * @param config - Resolved configuration.\n * @param suite - The root suite that contains all projects, files and test cases.\n */\n onBegin(config: FullConfig, suite: Suite): void {\n if (!this.enableResultPublish) return;\n this.initializeMPTReporter();\n this.reporterUtils = new ReporterUtils(this.envVariables, config, suite);\n if (this.isTokenValid && this.isRegionValid) {\n this.serviceClient = new ServiceClient(\n this.envVariables,\n this.reporterUtils,\n this._addInformationalMessage,\n this._isInformationMessagePresent,\n this._addKeyToInformationMessage,\n );\n this.promiseOnBegin = this._onBegin();\n }\n }\n\n /**\n * @public\n *\n * Called after a test has been finished in the worker process.\n *\n * @param test - Test that has been finished.\n * @param result - Result of the test run.\n */\n onTestEnd(test: TestCase, result: TestResult): void {\n this.numWorkers = Math.max(this.numWorkers, result.parallelIndex + 1);\n this.processTestResult(result);\n if (!this.enableResultPublish) return;\n // Process test result\n this._onTestEnd(test, result);\n // Upload the test results batch\n try {\n if (this.testResultBatch.size >= Constants.TEST_BATCH_SIZE) {\n const currResultBatch: MPTTestResult[] = [...this.testResultBatch];\n if (this.isTestRunStartSuccess) {\n this._testEndPromises.push(this.serviceClient.postTestResults(currResultBatch));\n reporterLogger.info(`\\nAdded test results batch for upload.`);\n this.testResultBatch.clear();\n }\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test results: ${err.message}.`);\n }\n }\n\n /**\n * @public\n *\n * Called after all tests have been run, or testing has been interrupted. Note that this method may return a [Promise]\n * and Playwright Test will await it. Reporter is allowed to override the status and hence affect the exit code of the\n * test runner.\n *\n * @param result - Result of the full test run, `status` can be one of:\n * - `'passed'` - Everything went as expected.\n * - `'failed'` - Any test has failed.\n * - `'timedout'` - The\n * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout | testConfig.globalTimeout} has\n * been reached.\n * - `'interrupted'` - Interrupted by the user.\n */\n async onEnd(result: FullResult): Promise<void> {\n if (this.enableResultPublish) {\n await this._onEnd(result);\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n } else {\n let count: number = 0;\n process.stdout.write(\"\\nUploading test results.\");\n await Promise.allSettled(this._testEndPromises).then((values) => {\n values.forEach((value) => {\n if (value.status === \"fulfilled\") {\n count++;\n this.reporterUtils.progressBar(count, this._testEndPromises.length);\n }\n return value.status;\n });\n reporterLogger.info(`\\nTest result processing completed.`);\n return values;\n });\n try {\n await this.serviceClient.postTestRunShardEnd(\n result,\n this.shard,\n this.errorMessages,\n this.uploadMetadata,\n this.numWorkers,\n );\n reporterLogger.info(`\\nTest run successfully uploaded.`);\n\n if (this.enableGitHubSummary) {\n this.reporterUtils.generateMarkdownSummary(this.testRunUrl);\n }\n\n process.stdout.write(`\\nTest report: ${this.testRunUrl}\\n`);\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in completing test run: ${err.message}`);\n process.stdout.write(`\\nUnable to complete test results upload.`);\n }\n }\n }\n this.displayAdditionalInformation();\n }\n\n private async _onBegin(): Promise<boolean> {\n process.stdout.write(`\\n`);\n try {\n const testRunResponse: TestRun | undefined = await this.serviceClient.patchTestRun(\n this.ciInfo,\n );\n reporterLogger.info(\n `\\nTest run report successfully initialized: ${testRunResponse?.displayName}.`,\n );\n process.stdout.write(\n `Initializing reporting for this test run. You can view the results at: https://playwright.microsoft.com/workspaces/${encodeURIComponent(this.envVariables.accountId!)}/runs/${encodeURIComponent(this.envVariables.runId!)}\\n`,\n );\n const shardResponse = await this.serviceClient.postTestRunShardStart();\n this.shard = shardResponse;\n // Set test report link as environment variable. If/else to check if environment variable defined or not.\n if (\n Constants.DEFAULT_SERVICE_ENDPOINT &&\n this.envVariables.accountId &&\n this.envVariables.runId\n ) {\n this.testRunUrl = `${Constants.DEFAULT_DASHBOARD_ENDPOINT}/workspaces/${encodeURIComponent(\n this.envVariables.accountId,\n )}/runs/${encodeURIComponent(this.envVariables.runId)}`;\n }\n return true;\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in initializing test run report: ${err.message}.`);\n return false;\n }\n }\n\n private async _onTestEnd(test: TestCase, result: TestResult): Promise<undefined> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n this.uploadMetadata.numTestResults++;\n const testResultObject: MPTTestResult = this.reporterUtils.getTestResultObject(\n test,\n result,\n this.ciInfo.jobName!,\n );\n this.testResultBatch.add(testResultObject);\n // Store test attachments in array\n const testAttachments: string[] = [];\n const otherAttachments: any[] = [];\n for (const attachment of result.attachments) {\n if (attachment.path !== undefined && attachment.path !== \"\") {\n testAttachments.push(attachment.path);\n this.uploadMetadata.numTotalAttachments++;\n this.uploadMetadata.sizeTotalAttachments += ReporterUtils.getFileSize(attachment.path);\n } else if (attachment.body instanceof Buffer) {\n otherAttachments.push(attachment);\n this.uploadMetadata.numTotalAttachments++;\n this.uploadMetadata.sizeTotalAttachments += ReporterUtils.getBufferSize(attachment.body);\n }\n }\n\n // Get raw result object and store it in map\n const rawTestResult: RawTestResult = this.reporterUtils.getRawTestResultObject(result);\n this.testRawResults.set(testResultObject.testExecutionId, JSON.stringify(rawTestResult));\n this._testEndPromises.push(\n this._uploadTestResultAttachments(\n testResultObject.testExecutionId,\n testAttachments,\n otherAttachments,\n ),\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in processing test result: ${err.message}.`);\n }\n }\n\n private async _onEnd(_: FullResult): Promise<void> {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n try {\n // Upload the remaining test results\n if (this.testResultBatch.size > 0) {\n await this.serviceClient.postTestResults([...this.testResultBatch]);\n reporterLogger.info(`\\nUploaded test results batch successfully.`);\n this.testResultBatch.clear();\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test run information: ${err.message}`);\n }\n }\n private renewSasUriIfNeeded = async (): Promise<void> => {\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n this.sasUri = await this.serviceClient.createStorageUri();\n reporterLogger.info(\n `\\nFetched SAS URI with validity: ${this.sasUri.expiresAt} and access: ${this.sasUri.accessLevel}.`,\n );\n }\n };\n private async _uploadTestResultAttachments(\n testExecutionId: string,\n testAttachments: string[],\n otherAttachments: any[],\n ): Promise<void> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n\n for (const attachmentPath of testAttachments) {\n const fileRelativePath = `${testExecutionId}/${ReporterUtils.getFileRelativePath(attachmentPath)}`;\n await this.renewSasUriIfNeeded();\n await this.storageClient.uploadFile(this.sasUri.uri, attachmentPath, fileRelativePath);\n }\n\n for (const otherAttachment of otherAttachments) {\n await this.renewSasUriIfNeeded();\n const match = otherAttachment?.contentType?.match(/charset=(.*)/);\n const charset = match && match.length > 1 ? match[1] : \"utf-8\";\n await this.storageClient.uploadBuffer(\n this.sasUri.uri,\n otherAttachment.body.toString((charset as any) || \"utf-8\"),\n `${testExecutionId}/${otherAttachment.name}`,\n );\n }\n\n const rawTestResult = this.testRawResults.get(testExecutionId);\n await this.renewSasUriIfNeeded();\n await this.storageClient.uploadBuffer(\n this.sasUri.uri,\n rawTestResult[0]!,\n `${testExecutionId}/rawTestResult.json`,\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test result attachments: ${err.message}`);\n }\n }\n\n private initializeMPTReporter(): void {\n this.envVariables = new EnvironmentVariables();\n if (process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] === \"true\") {\n this.isTokenValid = false;\n return;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL]) {\n process.stdout.write(\"\\nReporting service url not found.\");\n this.isTokenValid = false;\n return;\n }\n reporterLogger.info(\n `Reporting url - ${process.env[InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL]}`,\n );\n if (this.envVariables.accessToken === undefined || this.envVariables.accessToken === \"\") {\n process.stdout.write(`\\n${ServiceErrorMessageConstants.NO_AUTH_ERROR.message}`);\n this.isTokenValid = false;\n } else if (ReporterUtils.hasAudienceClaim(this.envVariables.accessToken)) {\n const result = populateValuesFromServiceUrl();\n this.envVariables.region = result!.region;\n this.envVariables.accountId = result!.accountId;\n const entraTokenDetails: EntraTokenDetails = ReporterUtils.getTokenDetails<EntraTokenDetails>(\n this.envVariables.accessToken,\n TokenType.ENTRA,\n );\n this.envVariables.userId = entraTokenDetails.oid;\n this.envVariables.userName = entraTokenDetails.name;\n } else {\n const mptTokenDetails: MPTTokenDetails = ReporterUtils.getTokenDetails<MPTTokenDetails>(\n this.envVariables.accessToken,\n TokenType.MPT,\n );\n validateMptPAT(this._reporterFailureHandler);\n this.envVariables.accountId = mptTokenDetails.aid;\n this.envVariables.userId = mptTokenDetails.oid;\n this.envVariables.userName = mptTokenDetails.userName;\n this.envVariables.region = ReporterUtils.getRegionFromAccountID(this.envVariables.accountId!);\n }\n this.storageClient = new StorageClient();\n if (\n this.envVariables.region &&\n !Constants.SupportedRegions.includes(this.envVariables.region!) &&\n this.isTokenValid\n ) {\n process.stdout.write(\n `\\nUnsupported region's workspace used to generate the input Access Token; the supported regions are ${Constants.SupportedRegions.join(\n \", \",\n )}`,\n );\n this.isRegionValid = false;\n }\n if (this.envVariables.runId === undefined || this.envVariables.runId === \"\") {\n this.envVariables.runId = ReporterUtils.getRunId(this.ciInfo);\n }\n }\n\n private displayAdditionalInformation(): void {\n if (this.informationalMessages.length > 0) console.info(); // Add a new line before displaying the messages\n this.informationalMessages.forEach((message, index) => {\n console.info(`${index + 1}. ${message}`);\n });\n }\n\n private processTestResult(result: TestResult): void {\n if (\n process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] &&\n result.status !== \"passed\"\n ) {\n result.errors.forEach((error) => {\n TestResultErrorConstants.forEach((testResultErrorParseObj) => {\n if (this.processedErrorMessageKeys.includes(testResultErrorParseObj.key)) {\n return;\n }\n const errorMessage = error.message;\n if (!errorMessage) return;\n const match = errorMessage.match(testResultErrorParseObj.pattern);\n if (match) {\n this.processedErrorMessageKeys.push(testResultErrorParseObj.key);\n this._addInformationalMessage(testResultErrorParseObj.message);\n }\n });\n });\n }\n }\n\n /**\n * @public\n *\n * Whether this reporter uses stdio for reporting. When it does not, Playwright Test could add some output to enhance\n * user experience. If your reporter does not print to the terminal, it is strongly recommended to return `false`.\n */\n printsToStdio(): boolean {\n return true;\n }\n}\nexport default MPTReporter;\n"]}
@@ -12,7 +12,7 @@ export type CIInfo = {
12
12
  revisionUrl: string | null;
13
13
  runId: string | null;
14
14
  runAttempt: number | null;
15
- jobId: string | null;
15
+ jobName: string | null;
16
16
  };
17
17
  export declare class CIInfoProvider {
18
18
  private static isGitHubActions;
@@ -1 +1 @@
1
- {"version":3,"file":"cIInfoProvider.d.ts","sourceRoot":"","sources":["../../src/utils/cIInfoProvider.ts"],"names":[],"mappings":"AAGA,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,OAAO,YAAY;CAEpB;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,E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B,CAAC;AAEF,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B,MAAM,CAAC,aAAa,IAAI,MAAM,GAAG,IAAI;IAUrC,MAAM,CAAC,SAAS,IAAI,MAAM;IAqD1B,OAAO,CAAC,MAAM,CAAC,aAAa;IAM5B,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B,OAAO,CAAC,MAAM,CAAC,eAAe;CAU/B"}
@@ -43,7 +43,7 @@ class CIInfoProvider {
43
43
  runAttempt: process.env["GITHUB_RUN_ATTEMPT"]
44
44
  ? parseInt(process.env["GITHUB_RUN_ATTEMPT"], 10)
45
45
  : null,
46
- jobId: process.env["GITHUB_JOB"] || null,
46
+ jobName: process.env["GITHUB_JOB"] || null,
47
47
  };
48
48
  }
49
49
  else if (ciProvider === CI_PROVIDERS.ADO) {
@@ -61,9 +61,7 @@ class CIInfoProvider {
61
61
  runAttempt: process.env["RELEASE_ATTEMPTNUMBER"]
62
62
  ? parseInt(process.env["RELEASE_ATTEMPTNUMBER"], 10)
63
63
  : parseInt((_a = process.env["SYSTEM_JOBATTEMPT"]) !== null && _a !== void 0 ? _a : "", 10),
64
- jobId: process.env["RELEASE_DEPLOYMENTID"]
65
- ? process.env["RELEASE_DEPLOYMENTID"]
66
- : process.env["SYSTEM_JOBID"] || null,
64
+ jobName: process.env["SYSTEM_JOBDISPLAYNAME"] || process.env["RELEASE_DEPLOYMENTID"] || null,
67
65
  };
68
66
  }
69
67
  else {
@@ -77,7 +75,7 @@ class CIInfoProvider {
77
75
  revisionUrl: (_f = process.env["REVISION_URL"]) !== null && _f !== void 0 ? _f : null,
78
76
  runId: (_g = process.env["RUN_ID"]) !== null && _g !== void 0 ? _g : null,
79
77
  runAttempt: process.env["RUN_ATTEMPT"] ? parseInt(process.env["RUN_ATTEMPT"], 10) : null,
80
- jobId: (_h = process.env["JOB_ID"]) !== null && _h !== void 0 ? _h : null,
78
+ jobName: (_h = process.env["JOB_ID"]) !== null && _h !== void 0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T\",\n // Add more CI providers as needed\n}\n\nexport type CIInfo = {\n provider: CI_PROVIDERS | null;\n repo: string | null;\n branch: string | null;\n author: string | null;\n commitId: string | null;\n revisionUrl: string | null;\n runId: string | null;\n runAttempt: number | null;\n jobId: string | null;\n};\n\nexport class CIInfoProvider {\n private static isGitHubActions(): boolean {\n return process.env[\"GITHUB_ACTIONS\"] === \"true\";\n }\n\n static getCIProvider(): string | null {\n if (CIInfoProvider.isGitHubActions()) {\n return CI_PROVIDERS.GITHUB;\n } else if (CIInfoProvider.isAzureDevOps()) {\n return CI_PROVIDERS.ADO;\n } else {\n return CI_PROVIDERS.DEFAULT;\n }\n }\n\n static getCIInfo(): CIInfo {\n const ciProvider = CIInfoProvider.getCIProvider();\n if (ciProvider === CI_PROVIDERS.GITHUB) {\n // Logic to get GitHub Actions CIInfo\n return {\n provider: CI_PROVIDERS.GITHUB,\n repo: process.env[\"GITHUB_REPOSITORY_ID\"] || null,\n branch: this.getGHBranchName() || null,\n author: process.env[\"GITHUB_ACTOR\"] || null,\n commitId: process.env[\"GITHUB_SHA\"] || null,\n revisionUrl: process.env[\"GITHUB_SERVER_URL\"]\n ? `${process.env[\"GITHUB_SERVER_URL\"]}/${process.env[\"GITHUB_REPOSITORY\"]}/commit/${process.env[\"GITHUB_SHA\"]}`\n : null,\n runId: process.env[\"GITHUB_RUN_ID\"] || null,\n runAttempt: process.env[\"GITHUB_RUN_ATTEMPT\"]\n ? parseInt(process.env[\"GITHUB_RUN_ATTEMPT\"], 10)\n : null,\n jobId: process.env[\"GITHUB_JOB\"] || null,\n };\n } else if (ciProvider === CI_PROVIDERS.ADO) {\n // Logic to get Azure DevOps CIInfo\n return {\n provider: CI_PROVIDERS.ADO,\n repo: process.env[\"BUILD_REPOSITORY_ID\"] || null,\n branch: process.env[\"BUILD_SOURCEBRANCH\"] || null,\n author: process.env[\"BUILD_REQUESTEDFOR\"] || null,\n commitId: process.env[\"BUILD_SOURCEVERSION\"] || null,\n revisionUrl: process.env[\"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\"]\n ? `${process.env[\"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\"]}${process.env[\"SYSTEM_TEAMPROJECT\"]}/_git/${process.env[\"BUILD_REPOSITORY_NAME\"]}/commit/${process.env[\"BUILD_SOURCEVERSION\"]}`\n : null,\n runId: this.getADORunId() || null,\n runAttempt: process.env[\"RELEASE_ATTEMPTNUMBER\"]\n ? parseInt(process.env[\"RELEASE_ATTEMPTNUMBER\"], 10)\n : parseInt(process.env[\"SYSTEM_JOBATTEMPT\"] ?? \"\", 10),\n jobId: process.env[\"RELEASE_DEPLOYMENTID\"]\n ? process.env[\"RELEASE_DEPLOYMENTID\"]\n : process.env[\"SYSTEM_JOBID\"] || null,\n };\n } else {\n // Handle unsupported CI provider\n return {\n provider: CI_PROVIDERS.DEFAULT,\n repo: process.env[\"REPO\"] ?? null,\n branch: process.env[\"BRANCH\"] ?? null,\n author: process.env[\"AUTHOR\"] ?? null,\n commitId: process.env[\"COMMIT_ID\"] ?? null,\n revisionUrl: process.env[\"REVISION_URL\"] ?? null,\n runId: process.env[\"RUN_ID\"] ?? null,\n runAttempt: process.env[\"RUN_ATTEMPT\"] ? parseInt(process.env[\"RUN_ATTEMPT\"], 10) : null,\n jobId: process.env[\"JOB_ID\"] ?? null,\n };\n }\n }\n\n private static isAzureDevOps(): boolean {\n return (\n process.env[\"AZURE_HTTP_USER_AGENT\"] !== undefined && process.env[\"TF_BUILD\"] !== undefined\n );\n }\n\n private static getADORunId(): string | null {\n if (process.env[\"RELEASE_DEFINITIONID\"] && process.env[\"RELEASE_DEPLOYMENTID\"]) {\n return `${process.env[\"RELEASE_DEFINITIONID\"]}-${process.env[\"RELEASE_DEPLOYMENTID\"]}`;\n } else if (process.env[\"SYSTEM_DEFINITIONID\"] && process.env[\"SYSTEM_JOBID\"]) {\n return `${process.env[\"SYSTEM_DEFINITIONID\"]}-${process.env[\"SYSTEM_JOBID\"]}`;\n }\n return null;\n }\n\n private static getGHBranchName(): string {\n if (\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\" ||\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request_target\"\n ) {\n return process.env[\"GITHUB_HEAD_REF\"]!;\n } else {\n return process.env[\"GITHUB_REF_NAME\"]!;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"cIInfoProvider.js","sourceRoot":"","sources":["../../src/utils/cIInfoProvider.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,mCAAmB,CAAA;IACnB,kCAAkC;AACpC,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAcD,MAAa,cAAc;IACjB,MAAM,CAAC,eAAe;QAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,aAAa;QAClB,IAAI,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC;YACrC,OAAO,YAAY,CAAC,MAAM,CAAC;QAC7B,CAAC;aAAM,IAAI,cAAc,CAAC,aAAa,EAAE,EAAE,CAAC;YAC1C,OAAO,YAAY,CAAC,GAAG,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,MAAM,CAAC,SAAS;;QACd,MAAM,UAAU,GAAG,cAAc,CAAC,aAAa,EAAE,CAAC;QAClD,IAAI,UAAU,KAAK,YAAY,CAAC,MAAM,EAAE,CAAC;YACvC,qCAAqC;YACrC,OAAO;gBACL,QAAQ,EAAE,YAAY,CAAC,MAAM;gBAC7B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,IAAI,IAAI;gBACjD,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,IAAI;gBACtC,MAAM,EAAE,OAAO,C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the MIT License.\n\nexport enum CI_PROVIDERS {\n GITHUB = \"GITHUB\",\n ADO = \"ADO\",\n DEFAULT = \"DEFAULT\",\n // Add more CI providers as needed\n}\n\nexport type CIInfo = {\n provider: CI_PROVIDERS | null;\n repo: string | null;\n branch: string | null;\n author: string | null;\n commitId: string | null;\n revisionUrl: string | null;\n runId: string | null;\n runAttempt: number | null;\n jobName: string | null;\n};\n\nexport class CIInfoProvider {\n private static isGitHubActions(): boolean {\n return process.env[\"GITHUB_ACTIONS\"] === \"true\";\n }\n\n static getCIProvider(): string | null {\n if (CIInfoProvider.isGitHubActions()) {\n return CI_PROVIDERS.GITHUB;\n } else if (CIInfoProvider.isAzureDevOps()) {\n return CI_PROVIDERS.ADO;\n } else {\n return CI_PROVIDERS.DEFAULT;\n }\n }\n\n static getCIInfo(): CIInfo {\n const ciProvider = CIInfoProvider.getCIProvider();\n if (ciProvider === CI_PROVIDERS.GITHUB) {\n // Logic to get GitHub Actions CIInfo\n return {\n provider: CI_PROVIDERS.GITHUB,\n repo: process.env[\"GITHUB_REPOSITORY_ID\"] || null,\n branch: this.getGHBranchName() || null,\n author: process.env[\"GITHUB_ACTOR\"] || null,\n commitId: process.env[\"GITHUB_SHA\"] || null,\n revisionUrl: process.env[\"GITHUB_SERVER_URL\"]\n ? `${process.env[\"GITHUB_SERVER_URL\"]}/${process.env[\"GITHUB_REPOSITORY\"]}/commit/${process.env[\"GITHUB_SHA\"]}`\n : null,\n runId: process.env[\"GITHUB_RUN_ID\"] || null,\n runAttempt: process.env[\"GITHUB_RUN_ATTEMPT\"]\n ? parseInt(process.env[\"GITHUB_RUN_ATTEMPT\"], 10)\n : null,\n jobName: process.env[\"GITHUB_JOB\"] || null,\n };\n } else if (ciProvider === CI_PROVIDERS.ADO) {\n // Logic to get Azure DevOps CIInfo\n return {\n provider: CI_PROVIDERS.ADO,\n repo: process.env[\"BUILD_REPOSITORY_ID\"] || null,\n branch: process.env[\"BUILD_SOURCEBRANCH\"] || null,\n author: process.env[\"BUILD_REQUESTEDFOR\"] || null,\n commitId: process.env[\"BUILD_SOURCEVERSION\"] || null,\n revisionUrl: process.env[\"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\"]\n ? `${process.env[\"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\"]}${process.env[\"SYSTEM_TEAMPROJECT\"]}/_git/${process.env[\"BUILD_REPOSITORY_NAME\"]}/commit/${process.env[\"BUILD_SOURCEVERSION\"]}`\n : null,\n runId: this.getADORunId() || null,\n runAttempt: process.env[\"RELEASE_ATTEMPTNUMBER\"]\n ? parseInt(process.env[\"RELEASE_ATTEMPTNUMBER\"], 10)\n : parseInt(process.env[\"SYSTEM_JOBATTEMPT\"] ?? \"\", 10),\n jobName:\n process.env[\"SYSTEM_JOBDISPLAYNAME\"] || process.env[\"RELEASE_DEPLOYMENTID\"] || null,\n };\n } else {\n // Handle unsupported CI provider\n return {\n provider: CI_PROVIDERS.DEFAULT,\n repo: process.env[\"REPO\"] ?? null,\n branch: process.env[\"BRANCH\"] ?? null,\n author: process.env[\"AUTHOR\"] ?? null,\n commitId: process.env[\"COMMIT_ID\"] ?? null,\n revisionUrl: process.env[\"REVISION_URL\"] ?? null,\n runId: process.env[\"RUN_ID\"] ?? null,\n runAttempt: process.env[\"RUN_ATTEMPT\"] ? parseInt(process.env[\"RUN_ATTEMPT\"], 10) : null,\n jobName: process.env[\"JOB_ID\"] ?? null,\n };\n }\n }\n\n private static isAzureDevOps(): boolean {\n return (\n process.env[\"AZURE_HTTP_USER_AGENT\"] !== undefined && process.env[\"TF_BUILD\"] !== undefined\n );\n }\n\n private static getADORunId(): string | null {\n if (process.env[\"RELEASE_DEFINITIONID\"] && process.env[\"RELEASE_DEPLOYMENTID\"]) {\n return `${process.env[\"RELEASE_DEFINITIONID\"]}-${process.env[\"RELEASE_DEPLOYMENTID\"]}`;\n } else if (process.env[\"SYSTEM_DEFINITIONID\"] && process.env[\"SYSTEM_JOBID\"]) {\n return `${process.env[\"SYSTEM_DEFINITIONID\"]}-${process.env[\"SYSTEM_JOBID\"]}`;\n }\n return null;\n }\n\n private static getGHBranchName(): string {\n if (\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\" ||\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request_target\"\n ) {\n return process.env[\"GITHUB_HEAD_REF\"]!;\n } else {\n return process.env[\"GITHUB_REF_NAME\"]!;\n }\n }\n}\n"]}
@@ -54,6 +54,7 @@ declare class ReporterUtils {
54
54
  static isNullOrEmpty(str: string | null | undefined): boolean;
55
55
  private getTestError;
56
56
  private getReadableLineLocation;
57
+ private getWorkers;
57
58
  }
58
59
  export default ReporterUtils;
59
60
  //# sourceMappingURL=reporterUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reporterUtils.d.ts","sourceRoot":"","sources":["../../src/utils/reporterUtils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EAEV,QAAQ,EACR,UAAU,EAEV,UAAU,EACV,KAAK,EACN,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAiB,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,cAAM,aAAa;IACjB,O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@@ -331,7 +331,7 @@ class ReporterUtils {
331
331
  }
332
332
  getTestRunConfig() {
333
333
  const testRunConfig = {
334
- workers: this.config.workers,
334
+ workers: this.getWorkers(),
335
335
  pwVersion: this.config.version,
336
336
  timeout: this.config.globalTimeout,
337
337
  repeatEach: this.config.projects[0].repeatEach,
@@ -562,6 +562,14 @@ class ReporterUtils {
562
562
  getReadableLineLocation(location) {
563
563
  return `at ${location.file}:${location.line}:${location.column}`;
564
564
  }
565
+ getWorkers() {
566
+ if (this.config.metadata &&
567
+ "actualWorkers" in this.config.metadata &&
568
+ typeof this.config.metadata.actualWorkers === "number") {
569
+ return this.config.metadata.actualWorkers;
570
+ }
571
+ return this.config.workers;
572
+ }
565
573
  }
566
574
  ReporterUtils.getReporterBackOffOptions = {
567
575
  numOfAttempts: 3,
@@ -1 +1 @@
1
- {"version":3,"file":"reporterUtils.js","sourceRoot":"","sources":["../../src/utils/reporterUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAWlC,iDAAqC;AACrC,6CAAkD;AAClD,mCAAgD;AAEhD,oDAAoB;AACpB,wDAAwB;AACxB,mDAAgD;AAGhD,8DAAqD;AAErD,0CAAsD;AAEtD,oDAAkE;AAElE,8CAA2C;AAE3C,qDAAgD;AAChD,qDAAkD;AAElD,mCAA4C;AAC5C,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,CAAC,GAAG,EAAE,CAAC;QAE5B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,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AI,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;;AAvUa,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,qBAAS,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;AA8TJ,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 \"child_process\";\nimport { reporterLogger } from \"../common/logger\";\nimport { createHash, randomUUID } from \"crypto\";\nimport type { IBackOffOptions } from \"../common/types\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { Constants } from \"../common/constants\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables\";\nimport type { DedupedStep, RawTestStep } from \"../common/types\";\nimport { TokenType } from \"../model/mptTokenDetails\";\nimport type { UploadMetadata } from \"../model/shard\";\nimport { Shard, TestRunStatus } from \"../model/shard\";\nimport type { RawTestResult } from \"../model/testResult\";\nimport { TestResult as MPTTestResult } from \"../model/testResult\";\nimport type { TestRunConfig } from \"../model/testRun\";\nimport { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"./cIInfoProvider\";\nimport { CI_PROVIDERS } from \"./cIInfoProvider\";\nimport { CIInfoProvider } from \"./cIInfoProvider\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport { getPackageVersion } from \"./utils\";\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![pass](https://img.shields.io/badge/status-passed-brightgreen) **Passed:** ${this.passedTests}\n \n![fail](https://img.shields.io/badge/status-failed-red) **Failed:** ${this.failedTests}\n \n![flaky](https://img.shields.io/badge/status-flaky-yellow) **Flaky:** ${this.flakyTests}\n \n![skipped](https://img.shields.io/badge/status-skipped-lightgrey) **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.config.workers,\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\nexport default ReporterUtils;\n"]}
1
+ {"version":3,"file":"reporterUtils.js","sourceRoot":"","sources":["../../src/utils/reporterUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAWlC,iDAAqC;AACrC,6CAAkD;AAClD,mCAAgD;AAEhD,oDAAoB;AACpB,wDAAwB;AACxB,mDAAgD;AAGhD,8DAAqD;AAErD,0CAAsD;AAEtD,oDAAkE;AAElE,8CAA2C;AAE3C,qDAAgD;AAChD,qDAAkD;AAElD,mCAA4C;AAC5C,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,CAAC,GAAG,EAAE,CAAC;QAE5B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,YAAY,GA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E,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,qBAAS,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 \"child_process\";\nimport { reporterLogger } from \"../common/logger\";\nimport { createHash, randomUUID } from \"crypto\";\nimport type { IBackOffOptions } from \"../common/types\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { Constants } from \"../common/constants\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables\";\nimport type { DedupedStep, RawTestStep } from \"../common/types\";\nimport { TokenType } from \"../model/mptTokenDetails\";\nimport type { UploadMetadata } from \"../model/shard\";\nimport { Shard, TestRunStatus } from \"../model/shard\";\nimport type { RawTestResult } from \"../model/testResult\";\nimport { TestResult as MPTTestResult } from \"../model/testResult\";\nimport type { TestRunConfig } from \"../model/testRun\";\nimport { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"./cIInfoProvider\";\nimport { CI_PROVIDERS } from \"./cIInfoProvider\";\nimport { CIInfoProvider } from \"./cIInfoProvider\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport { getPackageVersion } from \"./utils\";\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![pass](https://img.shields.io/badge/status-passed-brightgreen) **Passed:** ${this.passedTests}\n \n![fail](https://img.shields.io/badge/status-failed-red) **Failed:** ${this.failedTests}\n \n![flaky](https://img.shields.io/badge/status-flaky-yellow) **Flaky:** ${this.flakyTests}\n \n![skipped](https://img.shields.io/badge/status-skipped-lightgrey) **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"]}
@@ -90,7 +90,7 @@ class ServiceClient {
90
90
  throw new Error(`Received status ${response.status} from service from GET StorageUri call.`);
91
91
  }
92
92
  getServiceEndpoint() {
93
- return process.env["PLAYWRIGHT_SERVICE_REPORTING_URL"];
93
+ return process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL];
94
94
  }
95
95
  handleErrorResponse(response, action) {
96
96
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"serviceClient.js","sourceRoot":"","sources":["../../src/utils/serviceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,mDAAgD;AAEhD,uDAAoD;AAQpD,6CAAkD;AAElD,MAAa,aAAa;IAOxB;IACE,iEAAiE;IACjE,YAAkC,EAClC,aAA4B;IAC5B,gEAAgE;IAChE,mBAAmD,EACnD,2BAAqD,EACrD,0BAAiD;QAEjD,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,uBAAuB,GAAG,mBAAmB,CAAC;QACnD,IAAI,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;QAC/D,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAc;QAC/B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAElE,2DAA2D;QAC3D,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,KAAM,CAAC,CAAC;QAClE,MAAM,QAAQ,GAAqB,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAC/D,OAAO,EACP,GAAG,IAAI,CAAC,kBAAkB,EAAE,IAAI,qBAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,SAAU,CAAC,IAAI,YAAY,gBAAgB,qBAAS,CAAC,WAAW,EAAE,EACxK,IAAI,CAAC,SAAS,CAAC,OAAO,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C;QAC/F,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,IAAI,CAAC,CAAC;IAC5C,CAAC;CACF;AAxKD,sCAwKC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullResult } from \"@playwright/test/reporter\";\nimport { Constants } from \"../common/constants\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { HttpService } from \"../common/httpService\";\nimport type { Shard, UploadMetadata } from \"../model/shard\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport type { TestResult } from \"../model/testResult\";\nimport type { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"./cIInfoProvider\";\nimport type ReporterUtils from \"./reporterUtils\";\nimport type { PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { reporterLogger } from \"../common/logger\";\n\nexport class ServiceClient {\n private httpService: HttpService;\n private readonly envVariables: EnvironmentVariables;\n private readonly reporterUtils: ReporterUtils;\n private readonly addInformationalMessage: (errorMessage: string) => void;\n private isInformationMessagePresent: (key: string) => boolean;\n private addKeyToInformationMessage: (key: string) => void;\n constructor(\n /* eslint-disable @azure/azure-sdk/ts-use-interface-parameters */\n envVariables: EnvironmentVariables,\n reporterUtils: ReporterUtils,\n /* eslint-enable @azure/azure-sdk/ts-use-interface-parameters */\n addErrorInformation: (errorMessage: string) => void,\n isInformationMessagePresent: (key: string) => boolean,\n addKeyToInformationMessage: (key: string) => void,\n ) {\n this.httpService = new HttpService();\n this.envVariables = envVariables;\n this.reporterUtils = reporterUtils;\n this.addInformationalMessage = addErrorInformation;\n this.isInformationMessagePresent = isInformationMessagePresent;\n this.addKeyToInformationMessage = addKeyToInformationMessage;\n }\n\n async patchTestRun(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = await this.reporterUtils.getTestRunObject(ciInfo);\n\n // Escape the runId to avoid issues with special characters\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"PATCH\",\n `${this.getServiceEndpoint()}/${Constants.testRunsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}/${escapedRunId}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(testRun),\n this.envVariables.accessToken,\n \"application/merge-patch+json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n } else if (response.status === 409) {\n const errorMessage = Constants.CONFLICT_409_ERROR_MESSAGE.replace(\n \"{runId}\",\n this.envVariables.runId,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else if (response.status === 403) {\n const errorMessage = Constants.FORBIDDEN_403_ERROR_MESSAGE.replace(\n new RegExp(\"{workspaceId}\", \"g\"),\n this.envVariables.accountId!,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else {\n this.handleErrorResponse(response, Constants.patchTestRun);\n }\n throw new Error(`Received status ${response.status} from service from PATCH TestRun call.`);\n }\n\n async postTestRunShardStart(): Promise<Shard> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardStartObject();\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as Shard;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardStart);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard Start call.`,\n );\n }\n\n async postTestRunShardEnd(\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 ): Promise<TestRun> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardEndObject(\n result,\n shard,\n errorMessages,\n attachmentMetadata,\n workers,\n );\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardEnd);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard End call.`,\n );\n }\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n async postTestResults(testResults: TestResult[]): Promise<void> {\n try {\n const payload: any = {\n value: testResults,\n };\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testResultsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(payload),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return;\n }\n this.handleErrorResponse(response, Constants.postTestResults);\n } catch (error) {\n reporterLogger.error(`Error occurred while posting test results: ${error}`);\n }\n }\n\n async createStorageUri(): Promise<StorageUri> {\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.storageUriEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}?api-version=${Constants.API_VERSION}`,\n null,\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as StorageUri;\n }\n this.handleErrorResponse(response, Constants.getStorageUri);\n\n throw new Error(`Received status ${response.status} from service from GET StorageUri call.`);\n }\n\n private getServiceEndpoint(): string {\n return process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]!;\n }\n\n private handleErrorResponse(response: PipelineResponse, action: string): void {\n const statusCode = response.status;\n const errorMessage = Constants.ERROR_MESSAGE[action]?.[statusCode] ?? \"Unknown error occured.\";\n if (!this.isInformationMessagePresent(statusCode.toString())) {\n this.addKeyToInformationMessage(statusCode.toString());\n this.addInformationalMessage(errorMessage);\n }\n process.stdout.write(`${errorMessage}\\n`);\n }\n}\n"]}
1
+ {"version":3,"file":"serviceClient.js","sourceRoot":"","sources":["../../src/utils/serviceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,mDAA8E;AAE9E,uDAAoD;AAQpD,6CAAkD;AAElD,MAAa,aAAa;IAOxB;IACE,iEAAiE;IACjE,YAAkC,EAClC,aAA4B;IAC5B,gEAAgE;IAChE,mBAAmD,EACnD,2BAAqD,EACrD,0BAAiD;QAEjD,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,uBAAuB,GAAG,mBAAmB,CAAC;QACnD,IAAI,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;QAC/D,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,YAAY,CAA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W,CAAe,CAAC;QACxD,CAAC;QACD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,qBAAS,CAAC,aAAa,CAAC,CAAC;QAE5D,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,MAAM,yCAAyC,CAAC,CAAC;IAC/F,CAAC;IAEO,kBAAkB;QACxB,OAAO,OAAO,CAAC,GAAG,CAAC,wCAA4B,CAAC,yBAAyB,CAAE,CAAC;IAC9E,CAAC;IAEO,mBAAmB,CAAC,QAA0B,EAAE,MAAc;;QACpE,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;QACnC,MAAM,YAAY,GAAG,MAAA,MAAA,qBAAS,CAAC,aAAa,CAAC,MAAM,CAAC,0CAAG,UAAU,CAAC,mCAAI,wBAAwB,CAAC;QAC/F,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,IAAI,CAAC,CAAC;IAC5C,CAAC;CACF;AAxKD,sCAwKC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullResult } from \"@playwright/test/reporter\";\nimport { Constants, InternalEnvironmentVariables } from \"../common/constants\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { HttpService } from \"../common/httpService\";\nimport type { Shard, UploadMetadata } from \"../model/shard\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport type { TestResult } from \"../model/testResult\";\nimport type { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"./cIInfoProvider\";\nimport type ReporterUtils from \"./reporterUtils\";\nimport type { PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { reporterLogger } from \"../common/logger\";\n\nexport class ServiceClient {\n private httpService: HttpService;\n private readonly envVariables: EnvironmentVariables;\n private readonly reporterUtils: ReporterUtils;\n private readonly addInformationalMessage: (errorMessage: string) => void;\n private isInformationMessagePresent: (key: string) => boolean;\n private addKeyToInformationMessage: (key: string) => void;\n constructor(\n /* eslint-disable @azure/azure-sdk/ts-use-interface-parameters */\n envVariables: EnvironmentVariables,\n reporterUtils: ReporterUtils,\n /* eslint-enable @azure/azure-sdk/ts-use-interface-parameters */\n addErrorInformation: (errorMessage: string) => void,\n isInformationMessagePresent: (key: string) => boolean,\n addKeyToInformationMessage: (key: string) => void,\n ) {\n this.httpService = new HttpService();\n this.envVariables = envVariables;\n this.reporterUtils = reporterUtils;\n this.addInformationalMessage = addErrorInformation;\n this.isInformationMessagePresent = isInformationMessagePresent;\n this.addKeyToInformationMessage = addKeyToInformationMessage;\n }\n\n async patchTestRun(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = await this.reporterUtils.getTestRunObject(ciInfo);\n\n // Escape the runId to avoid issues with special characters\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"PATCH\",\n `${this.getServiceEndpoint()}/${Constants.testRunsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}/${escapedRunId}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(testRun),\n this.envVariables.accessToken,\n \"application/merge-patch+json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n } else if (response.status === 409) {\n const errorMessage = Constants.CONFLICT_409_ERROR_MESSAGE.replace(\n \"{runId}\",\n this.envVariables.runId,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else if (response.status === 403) {\n const errorMessage = Constants.FORBIDDEN_403_ERROR_MESSAGE.replace(\n new RegExp(\"{workspaceId}\", \"g\"),\n this.envVariables.accountId!,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else {\n this.handleErrorResponse(response, Constants.patchTestRun);\n }\n throw new Error(`Received status ${response.status} from service from PATCH TestRun call.`);\n }\n\n async postTestRunShardStart(): Promise<Shard> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardStartObject();\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as Shard;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardStart);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard Start call.`,\n );\n }\n\n async postTestRunShardEnd(\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 ): Promise<TestRun> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardEndObject(\n result,\n shard,\n errorMessages,\n attachmentMetadata,\n workers,\n );\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardEnd);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard End call.`,\n );\n }\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n async postTestResults(testResults: TestResult[]): Promise<void> {\n try {\n const payload: any = {\n value: testResults,\n };\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testResultsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(payload),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return;\n }\n this.handleErrorResponse(response, Constants.postTestResults);\n } catch (error) {\n reporterLogger.error(`Error occurred while posting test results: ${error}`);\n }\n }\n\n async createStorageUri(): Promise<StorageUri> {\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.storageUriEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}?api-version=${Constants.API_VERSION}`,\n null,\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as StorageUri;\n }\n this.handleErrorResponse(response, Constants.getStorageUri);\n\n throw new Error(`Received status ${response.status} from service from GET StorageUri call.`);\n }\n\n private getServiceEndpoint(): string {\n return process.env[InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL]!;\n }\n\n private handleErrorResponse(response: PipelineResponse, action: string): void {\n const statusCode = response.status;\n const errorMessage = Constants.ERROR_MESSAGE[action]?.[statusCode] ?? \"Unknown error occured.\";\n if (!this.isInformationMessagePresent(statusCode.toString())) {\n this.addKeyToInformationMessage(statusCode.toString());\n this.addInformationalMessage(errorMessage);\n }\n process.stdout.write(`${errorMessage}\\n`);\n }\n}\n"]}
@@ -133,7 +133,7 @@ const emitReportingUrl = () => {
133
133
  const match = url === null || url === void 0 ? void 0 : url.match(regex);
134
134
  if (match && match.length >= 3) {
135
135
  const [, region, domain] = match;
136
- process.env[constants_1.ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_REPORTING_URL] =
136
+ process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL] =
137
137
  `https://${region}.reporting.api.${domain}`;
138
138
  }
139
139
  };