@azure/microsoft-playwright-testing 1.0.0-alpha.20241218.1 → 1.0.0-alpha.20241220.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +1 -0
- package/dist/common/constants.js.map +1 -1
- package/dist/reporter/mptReporter.d.ts +1 -0
- package/dist/reporter/mptReporter.d.ts.map +1 -1
- package/dist/reporter/mptReporter.js +24 -13
- package/dist/reporter/mptReporter.js.map +1 -1
- package/dist/utils/reporterUtils.d.ts +2 -1
- package/dist/utils/reporterUtils.d.ts.map +1 -1
- package/dist/utils/reporterUtils.js +37 -20
- package/dist/utils/reporterUtils.js.map +1 -1
- package/package.json +2 -2
- package/types/reporter/microsoft-playwright-testing.d.ts +1 -0
|
@@ -55,6 +55,7 @@ export declare class Constants {
|
|
|
55
55
|
static readonly GIT_COMMIT_MESSAGE_COMMAND = "git log -1 --pretty=format:\"%s\"";
|
|
56
56
|
static readonly ERROR_MESSAGES_MAX_LENGTH = 100;
|
|
57
57
|
static readonly API_VERSION = "2024-09-01-preview";
|
|
58
|
+
static readonly OS = "Os";
|
|
58
59
|
static readonly NON_RETRYABLE_STATUS_CODES: number[];
|
|
59
60
|
static readonly SupportedRegions: string[];
|
|
60
61
|
static readonly CONFLICT_409_ERROR_MESSAGE = "Test run with id {runId} already exists. Provide a unique run id.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,2BAA2B;;;;CAIvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX;;;GAGG;AACH,eA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ACtE,gBAAuB,2BAA2B,uOACoL;IAEtO,gBAAuB,gBAAgB,EAAE,MAAM,CAAwC;IACvF,gBAAuB,qBAAqB,EAAE,MAAM,CAC0B;IAC9E,gBAAuB,kBAAkB,EAAE,MAAM,CAC+B;IAChF,gBAAuB,mBAAmB,EAAE,MAAM,CACK;IACvD,gBAAuB,YAAY,EAAE,MAAM,CAAkB;IAC7D,gBAAuB,UAAU,EAAE,MAAM,CAAgB;IACzD,gBAAuB,sBAAsB,EAAE,MAAM,CAA4B;IACjF,gBAAuB,oBAAoB,EAAE,MAAM,CAA0B;IAC7E,gBAAuB,eAAe,EAAE,MAAM,CAAqB;IACnE,gBAAuB,aAAa,EAAE,MAAM,CAAmB;IAC/D,gBAAuB,aAAa,EAAE,eAAe,CAsDnD;CACH;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;GAwEpC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;CAMxC,CAAC;AAEF,eAAO,MAAM,oCAAoC,WAAW,CAAC"}
|
package/dist/common/constants.js
CHANGED
|
@@ -63,6 +63,7 @@ Constants.GIT_REV_PARSE = "git rev-parse --is-inside-work-tree";
|
|
|
63
63
|
Constants.GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:"%s"';
|
|
64
64
|
Constants.ERROR_MESSAGES_MAX_LENGTH = 100;
|
|
65
65
|
Constants.API_VERSION = "2024-09-01-preview";
|
|
66
|
+
Constants.OS = "Os";
|
|
66
67
|
Constants.NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];
|
|
67
68
|
Constants.SupportedRegions = [
|
|
68
69
|
"eastus",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAm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,mHAAmH;QACrH,OAAO,EAAE,6EAA6E;QACtF,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,+CAA+C;QACpD,OAAO,EACL,6HAA6H;QAC/H,OAAO,EAAE,mEAAmE;QAC5E,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EACL,kHAAkH;QACpH,OAAO,EACL,yFAAyF;QAC3F,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,sFAAsF;QAC/F,OAAO,EAAE,0DAA0D;QACnE,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,+DAA+D;QACxE,OAAO,EAAE,sDAAsD;QAC/D,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,0BAA0B;QAC/B,OAAO,EACL,mKAAmK;QACrK,OAAO,EAAE,2CAA2C;QACpD,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,yEAAyE;QAClF,OAAO,EAAE,uEAAuE;QAChF,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;CACF,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,6BAA6B,EAAE,gCAAgC;CAChE,CAAC;AAEW,QAAA,oCAAoC,GAAG,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ApiErrorMessage } from \"./types\";\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Microsoft Playwright Testing cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Microsoft Playwright Testing\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Microsoft Playwright Testing\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_OS: \"PLAYWRIGHT_SERVICE_OS\",\n PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: \"PLAYWRIGHT_SERVICE_EXPOSE_NETWORK\",\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n PLAYWRIGHT_SERVICE_REPORTING_URL: \"PLAYWRIGHT_SERVICE_REPORTING_URL\",\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n};\n\nexport const API_VERSION = \"2023-10-01-preview\";\n\n// Do not put an ending slash for the urls,\n// for example use https://www.microsoft.com/en-in and not https://www.microsoft.com/en-in/\n\nexport class Constants {\n // Config related constants\n public static readonly TEST_FRAMEWORK_NAME = \"PLAYWRIGHT\";\n public static readonly TEST_FRAMEWORK_RUNNERNAME = \"PLAYWRIGHT\";\n public static readonly TEST_TYPE = \"WebTest\";\n public static readonly TEST_SDK_LANGUAGE = \"JAVASCRIPT\";\n // Placeholder version\n public static readonly DEFAULT_DASHBOARD_ENDPOINT = \"https://playwright.microsoft.com\";\n public static readonly DEFAULT_SERVICE_ENDPOINT =\n \"https://{region}.reporting.api.playwright-test.io\";\n public static readonly DEFAULT_REDACTED_MESSAGE = \"***REDACTED***\";\n public static readonly SAS_URI_SEPARATOR = \"?\";\n public static readonly DEFAULT_TEST_RUN_NAME = \"MPTReporterTests\";\n public static readonly TEST_BATCH_SIZE = 50;\n public static readonly UPLOAD_MODE = \"sdk\";\n public static readonly GIT_VERSION_COMMAND = \"git --version\";\n public static readonly GIT_REV_PARSE = \"git rev-parse --is-inside-work-tree\";\n public static readonly GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:\"%s\"';\n public static readonly ERROR_MESSAGES_MAX_LENGTH = 100;\n public static readonly API_VERSION = \"2024-09-01-preview\";\n public static readonly NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];\n public static readonly SupportedRegions: string[] = [\n \"eastus\",\n \"eastasia\",\n \"westeurope\",\n \"westus3\",\n \"centraluseuap\",\n \"eastus2euap\",\n ];\n // Error messages\n public static readonly CONFLICT_409_ERROR_MESSAGE =\n \"Test run with id {runId} already exists. Provide a unique run id.\";\n public static readonly FORBIDDEN_403_ERROR_MESSAGE =\n \"Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general\";\n // API Endpoints\n public static readonly testRunsEndpoint: string = \"workspaces/{workspaceId}/test-runs\";\n public static readonly testRunsShardEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:updateShardExecutionStatus\";\n public static readonly storageUriEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:createArtifactsUploadBaseUri\";\n public static readonly testResultsEndpoint: string =\n \"workspaces/{workspaceId}/test-results/upload-batch\";\n public static readonly patchTestRun: string = \"patchTestRun\";\n public static readonly getTestRun: string = \"getTestRun\";\n public static readonly patchTestRunShardStart: string = \"patchTestRunShardStart\";\n public static readonly patchTestRunShardEnd: string = \"patchTestRunShardEnd\";\n public static readonly postTestResults: string = \"postTestResults\";\n public static readonly getStorageUri: string = \"getStorageUri\";\n public static readonly ERROR_MESSAGE: ApiErrorMessage = {\n patchTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardStart: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardEnd: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n postTestResults: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getStorageUri: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n };\n}\n\nexport const TestErrorType = {\n Scalable: \"Scalable\",\n Reporting: \"Reporting\",\n};\n\nexport const TestResultErrorConstants = [\n {\n key: \"401\",\n message: \"The authentication token provided is invalid. Please check the token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*401 Unauthorized)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"NoPermissionOnWorkspace_Scalable\",\n message: `You do not have the required permissions to run tests. This could be because:\n\n a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n b. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>'.\n `,\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*CheckAccess API call with non successful response)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidWorkspace_Scalable\",\n message: \"The specified workspace does not exist. Please verify your workspace settings.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccountOrSubscriptionState)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n pattern: /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccessToken)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessTokenOrUserOrWorkspaceNotFound_Scalable\",\n message:\n \"The data for the user, workspace or access token was not found. Please check the request or create new token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*404 Not Found)(?=[\\s\\S]*NotFound)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessKeyBasedAuthNotSupported_Scalable\",\n message:\n \"Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*AccessKeyBasedAuthNotSupported)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"503\",\n message: \"The service is currently unavailable. Please check the service status and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*503 Service Unavailable)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"504\",\n message: \"The request to the service timed out. Please try again later.\",\n pattern: /(?=.*browserType\\.connect)(?=.*504 Gateway Timeout)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"QuotaLimitError_Scalable\",\n message:\n \"It is possible that the maximum number of concurrent sessions allowed for your workspace has been exceeded. Check the quota at https://aka.ms/mpt/resource-quota.\",\n pattern: /browserType.connect: Timeout .* exceeded/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"BrowserConnectionError_Scalable\",\n message: \"The service is currently unavailable. Please try again after some time.\",\n pattern: /browserType.connect: Target page, context or browser has been closed/i,\n type: TestErrorType.Scalable,\n },\n];\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n};\n\nexport const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = \"1.47.0\";\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,qBAAqB,EAAE,uBAAuB;IAC9C,sDAAsD,EAAE,mCAAmC;IAC3F,+BAA+B,EAAE,iCAAiC;IAClE,sBAAsB,EAAE,wBAAwB;IAChD,gCAAgC,EAAE,kCAAkC;CACrE,CAAC;AAEW,QAAA,8BAA8B,GAAG;IAC5C,eAAe,EAAE,KAAK;IACtB,eAAe,EAAE,CAAC;IAClB,sBAAsB,EAAE,YAAY;IACpC,kBAAkB,EAAE,iBAAS,CAAC,KAAK;CACpC,CAAC;AAEW,QAAA,WAAW,GAAG,oBAAoB,CAAC;AAEhD,2CAA2C;AAC3C,2FAA2F;AAE3F,MAAa,SAAS;;AAAtB,8BAwGC;AAvGC,2BAA2B;AACJ,6BAAmB,GAAG,YAAY,CAAC;AACn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CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,yEAAyE;QAClF,OAAO,EAAE,uEAAuE;QAChF,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;CACF,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,6BAA6B,EAAE,gCAAgC;CAChE,CAAC;AAEW,QAAA,oCAAoC,GAAG,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ApiErrorMessage } from \"./types\";\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Microsoft Playwright Testing cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Microsoft Playwright Testing\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Microsoft Playwright Testing\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_OS: \"PLAYWRIGHT_SERVICE_OS\",\n PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: \"PLAYWRIGHT_SERVICE_EXPOSE_NETWORK\",\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n PLAYWRIGHT_SERVICE_REPORTING_URL: \"PLAYWRIGHT_SERVICE_REPORTING_URL\",\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n};\n\nexport const API_VERSION = \"2023-10-01-preview\";\n\n// Do not put an ending slash for the urls,\n// for example use https://www.microsoft.com/en-in and not https://www.microsoft.com/en-in/\n\nexport class Constants {\n // Config related constants\n public static readonly TEST_FRAMEWORK_NAME = \"PLAYWRIGHT\";\n public static readonly TEST_FRAMEWORK_RUNNERNAME = \"PLAYWRIGHT\";\n public static readonly TEST_TYPE = \"WebTest\";\n public static readonly TEST_SDK_LANGUAGE = \"JAVASCRIPT\";\n // Placeholder version\n public static readonly DEFAULT_DASHBOARD_ENDPOINT = \"https://playwright.microsoft.com\";\n public static readonly DEFAULT_SERVICE_ENDPOINT =\n \"https://{region}.reporting.api.playwright-test.io\";\n public static readonly DEFAULT_REDACTED_MESSAGE = \"***REDACTED***\";\n public static readonly SAS_URI_SEPARATOR = \"?\";\n public static readonly DEFAULT_TEST_RUN_NAME = \"MPTReporterTests\";\n public static readonly TEST_BATCH_SIZE = 50;\n public static readonly UPLOAD_MODE = \"sdk\";\n public static readonly GIT_VERSION_COMMAND = \"git --version\";\n public static readonly GIT_REV_PARSE = \"git rev-parse --is-inside-work-tree\";\n public static readonly GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:\"%s\"';\n public static readonly ERROR_MESSAGES_MAX_LENGTH = 100;\n public static readonly API_VERSION = \"2024-09-01-preview\";\n public static readonly OS = \"Os\";\n public static readonly NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];\n public static readonly SupportedRegions: string[] = [\n \"eastus\",\n \"eastasia\",\n \"westeurope\",\n \"westus3\",\n \"centraluseuap\",\n \"eastus2euap\",\n ];\n // Error messages\n public static readonly CONFLICT_409_ERROR_MESSAGE =\n \"Test run with id {runId} already exists. Provide a unique run id.\";\n public static readonly FORBIDDEN_403_ERROR_MESSAGE =\n \"Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general\";\n // API Endpoints\n public static readonly testRunsEndpoint: string = \"workspaces/{workspaceId}/test-runs\";\n public static readonly testRunsShardEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:updateShardExecutionStatus\";\n public static readonly storageUriEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:createArtifactsUploadBaseUri\";\n public static readonly testResultsEndpoint: string =\n \"workspaces/{workspaceId}/test-results/upload-batch\";\n public static readonly patchTestRun: string = \"patchTestRun\";\n public static readonly getTestRun: string = \"getTestRun\";\n public static readonly patchTestRunShardStart: string = \"patchTestRunShardStart\";\n public static readonly patchTestRunShardEnd: string = \"patchTestRunShardEnd\";\n public static readonly postTestResults: string = \"postTestResults\";\n public static readonly getStorageUri: string = \"getStorageUri\";\n public static readonly ERROR_MESSAGE: ApiErrorMessage = {\n patchTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardStart: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardEnd: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n postTestResults: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getStorageUri: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n };\n}\n\nexport const TestErrorType = {\n Scalable: \"Scalable\",\n Reporting: \"Reporting\",\n};\n\nexport const TestResultErrorConstants = [\n {\n key: \"401\",\n message: \"The authentication token provided is invalid. Please check the token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*401 Unauthorized)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"NoPermissionOnWorkspace_Scalable\",\n message: `You do not have the required permissions to run tests. This could be because:\n\n a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n b. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>'.\n `,\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*CheckAccess API call with non successful response)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidWorkspace_Scalable\",\n message: \"The specified workspace does not exist. Please verify your workspace settings.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccountOrSubscriptionState)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n pattern: /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccessToken)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessTokenOrUserOrWorkspaceNotFound_Scalable\",\n message:\n \"The data for the user, workspace or access token was not found. Please check the request or create new token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*404 Not Found)(?=[\\s\\S]*NotFound)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessKeyBasedAuthNotSupported_Scalable\",\n message:\n \"Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*AccessKeyBasedAuthNotSupported)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"503\",\n message: \"The service is currently unavailable. Please check the service status and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*503 Service Unavailable)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"504\",\n message: \"The request to the service timed out. Please try again later.\",\n pattern: /(?=.*browserType\\.connect)(?=.*504 Gateway Timeout)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"QuotaLimitError_Scalable\",\n message:\n \"It is possible that the maximum number of concurrent sessions allowed for your workspace has been exceeded. Check the quota at https://aka.ms/mpt/resource-quota.\",\n pattern: /browserType.connect: Timeout .* exceeded/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"BrowserConnectionError_Scalable\",\n message: \"The service is currently unavailable. Please try again after some time.\",\n pattern: /browserType.connect: Target page, context or browser has been closed/i,\n type: TestErrorType.Scalable,\n },\n];\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n};\n\nexport const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = \"1.47.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mptReporter.d.ts","sourceRoot":"","sources":["../../src/reporter/mptReporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACN,MAAM,2BAA2B,CAAC;AAqBnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD;;;;;;;;;;;;;;;;GAgBG;AACH,cAAM,WAAY,YAAW,QAAQ;IACnC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;IACH,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAgB/C;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAsBnD;;;;;;;;;;;;;;OAcG;IACG,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;YA4ChC,QAAQ;YAgCR,UAAU;YA6CV,MAAM;IAkBpB,OAAO,CAAC,mBAAmB,CAUzB;YACY,4BAA4B;IA0C1C,OAAO,CAAC,qBAAqB;IAsD7B,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,iBAAiB;IAsBzB;;;;;OAKG;IACH,aAAa,IAAI,OAAO;CAGzB;AACD,eAAe,WAAW,CAAC"}
|
|
@@ -68,6 +68,13 @@ class MPTReporter {
|
|
|
68
68
|
}
|
|
69
69
|
this.isTokenValid = false;
|
|
70
70
|
};
|
|
71
|
+
this.renewSasUriIfNeeded = async () => {
|
|
72
|
+
if (this.sasUri === undefined ||
|
|
73
|
+
!reporterUtils_1.default.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)) {
|
|
74
|
+
this.sasUri = await this.serviceClient.createStorageUri();
|
|
75
|
+
logger_1.reporterLogger.info(`\nFetched SAS URI with validity: ${this.sasUri.expiresAt} and access: ${this.sasUri.accessLevel}.`);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
71
78
|
if ((config === null || config === void 0 ? void 0 : config.enableGitHubSummary) !== undefined) {
|
|
72
79
|
this.enableGitHubSummary = config.enableGitHubSummary;
|
|
73
80
|
}
|
|
@@ -215,17 +222,23 @@ class MPTReporter {
|
|
|
215
222
|
this.testResultBatch.add(testResultObject);
|
|
216
223
|
// Store test attachments in array
|
|
217
224
|
const testAttachments = [];
|
|
225
|
+
const otherAttachments = [];
|
|
218
226
|
for (const attachment of result.attachments) {
|
|
219
227
|
if (attachment.path !== undefined && attachment.path !== "") {
|
|
220
228
|
testAttachments.push(attachment.path);
|
|
221
229
|
this.uploadMetadata.numTotalAttachments++;
|
|
222
230
|
this.uploadMetadata.sizeTotalAttachments += reporterUtils_1.default.getFileSize(attachment.path);
|
|
223
231
|
}
|
|
232
|
+
else if (attachment.body instanceof Buffer) {
|
|
233
|
+
otherAttachments.push(attachment);
|
|
234
|
+
this.uploadMetadata.numTotalAttachments++;
|
|
235
|
+
this.uploadMetadata.sizeTotalAttachments += reporterUtils_1.default.getBufferSize(attachment.body);
|
|
236
|
+
}
|
|
224
237
|
}
|
|
225
238
|
// Get raw result object and store it in map
|
|
226
239
|
const rawTestResult = this.reporterUtils.getRawTestResultObject(result);
|
|
227
240
|
this.testRawResults.set(testResultObject.testExecutionId, JSON.stringify(rawTestResult));
|
|
228
|
-
this._testEndPromises.push(this._uploadTestResultAttachments(testResultObject.testExecutionId, testAttachments));
|
|
241
|
+
this._testEndPromises.push(this._uploadTestResultAttachments(testResultObject.testExecutionId, testAttachments, otherAttachments));
|
|
229
242
|
}
|
|
230
243
|
catch (err) {
|
|
231
244
|
this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);
|
|
@@ -251,7 +264,8 @@ class MPTReporter {
|
|
|
251
264
|
logger_1.reporterLogger.error(`\nError in uploading test run information: ${err.message}`);
|
|
252
265
|
}
|
|
253
266
|
}
|
|
254
|
-
async _uploadTestResultAttachments(testExecutionId, testAttachments) {
|
|
267
|
+
async _uploadTestResultAttachments(testExecutionId, testAttachments, otherAttachments) {
|
|
268
|
+
var _a;
|
|
255
269
|
try {
|
|
256
270
|
this.isTestRunStartSuccess = await this.promiseOnBegin;
|
|
257
271
|
if (!this.isTestRunStartSuccess) {
|
|
@@ -260,20 +274,17 @@ class MPTReporter {
|
|
|
260
274
|
}
|
|
261
275
|
for (const attachmentPath of testAttachments) {
|
|
262
276
|
const fileRelativePath = `${testExecutionId}/${reporterUtils_1.default.getFileRelativePath(attachmentPath)}`;
|
|
263
|
-
|
|
264
|
-
!reporterUtils_1.default.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)) {
|
|
265
|
-
// Renew the sas uri
|
|
266
|
-
this.sasUri = await this.serviceClient.createStorageUri();
|
|
267
|
-
logger_1.reporterLogger.info(`\nFetched SAS URI with validity: ${this.sasUri.expiresAt} and access: ${this.sasUri.accessLevel}.`);
|
|
268
|
-
}
|
|
277
|
+
await this.renewSasUriIfNeeded();
|
|
269
278
|
await this.storageClient.uploadFile(this.sasUri.uri, attachmentPath, fileRelativePath);
|
|
270
279
|
}
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
this.sasUri
|
|
280
|
+
for (const otherAttachment of otherAttachments) {
|
|
281
|
+
await this.renewSasUriIfNeeded();
|
|
282
|
+
const match = (_a = otherAttachment === null || otherAttachment === void 0 ? void 0 : otherAttachment.contentType) === null || _a === void 0 ? void 0 : _a.match(/charset=(.*)/);
|
|
283
|
+
const charset = match && match.length > 1 ? match[1] : "utf-8";
|
|
284
|
+
await this.storageClient.uploadBuffer(this.sasUri.uri, otherAttachment.body.toString(charset || "utf-8"), `${testExecutionId}/${otherAttachment.name}`);
|
|
276
285
|
}
|
|
286
|
+
const rawTestResult = this.testRawResults.get(testExecutionId);
|
|
287
|
+
await this.renewSasUriIfNeeded();
|
|
277
288
|
await this.storageClient.uploadBuffer(this.sasUri.uri, rawTestResult[0], `${testExecutionId}/rawTestResult.json`);
|
|
278
289
|
}
|
|
279
290
|
catch (err) {
|
|
@@ -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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C,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 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 }\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(testResultObject.testExecutionId, testAttachments),\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\n private async _uploadTestResultAttachments(\n testExecutionId: string,\n testAttachments: string[],\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 for (const attachmentPath of testAttachments) {\n const fileRelativePath = `${testExecutionId}/${ReporterUtils.getFileRelativePath(\n attachmentPath,\n )}`;\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n // Renew the sas uri\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 await this.storageClient.uploadFile(this.sasUri.uri, attachmentPath, fileRelativePath);\n }\n const rawTestResult = this.testRawResults.get(testExecutionId);\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n // Renew the sas uri\n this.sasUri = await this.serviceClient.createStorageUri();\n }\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,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,S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G;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"]}
|
|
@@ -22,6 +22,7 @@ declare class ReporterUtils {
|
|
|
22
22
|
getTestRunObject(ciInfo: CIInfo): Promise<TestRun>;
|
|
23
23
|
getTestRunShardStartObject(): Shard;
|
|
24
24
|
getTestRunShardEndObject(result: FullResult, shard: Shard, errorMessages: string[], attachmentMetadata: UploadMetadata, workers: number): Shard;
|
|
25
|
+
getOSName(result: TestResult, data: string): string;
|
|
25
26
|
getTestResultObject(test: TestCase, result: TestResult, jobName: string): MPTTestResult;
|
|
26
27
|
generateMarkdownSummary(testRunUrl: string): void;
|
|
27
28
|
getRawTestResultObject(result: TestResult): RawTestResult;
|
|
@@ -34,6 +35,7 @@ declare class ReporterUtils {
|
|
|
34
35
|
static getReporterBackOffOptions: Partial<IBackOffOptions>;
|
|
35
36
|
static isTimeGreaterThanCurrentPlus10Minutes(sasUri: StorageUri): boolean;
|
|
36
37
|
static getFileSize(attachmentPath: string): number;
|
|
38
|
+
static getBufferSize(attachmentBody: Buffer): number;
|
|
37
39
|
redactAccessToken(info: string | undefined): string;
|
|
38
40
|
static getRegionFromAccountID(accountId: string): string | undefined;
|
|
39
41
|
progressBar(current: number, total: number): void;
|
|
@@ -50,7 +52,6 @@ declare class ReporterUtils {
|
|
|
50
52
|
private getRunName;
|
|
51
53
|
private runCommand;
|
|
52
54
|
static isNullOrEmpty(str: string | null | undefined): boolean;
|
|
53
|
-
private getOsName;
|
|
54
55
|
}
|
|
55
56
|
export default ReporterUtils;
|
|
56
57
|
//# 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;
|
|
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,OAAO,CAAC,YAAY,CAAuB;IAE3C,OAAO,CAAC,MAAM,CAAa;IAC3B,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AU,GAAG,OAAO;WAyBlE,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;WAS3C,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;IASpD,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;WAO5C,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQpE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAcxD,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,WAAW;IA8BnB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,sBAAsB;YAiBhB,UAAU;YA4BV,UAAU;WAgBV,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO;CAGrE;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -7,7 +7,6 @@ const child_process_1 = require("child_process");
|
|
|
7
7
|
const logger_1 = require("../common/logger");
|
|
8
8
|
const crypto_1 = require("crypto");
|
|
9
9
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
10
|
-
const os_1 = tslib_1.__importDefault(require("os"));
|
|
11
10
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
11
|
const constants_1 = require("../common/constants");
|
|
13
12
|
const mptTokenDetails_1 = require("../model/mptTokenDetails");
|
|
@@ -77,8 +76,24 @@ class ReporterUtils {
|
|
|
77
76
|
shard.workers = workers;
|
|
78
77
|
return shard;
|
|
79
78
|
}
|
|
80
|
-
|
|
79
|
+
getOSName(result, data) {
|
|
81
80
|
var _a, _b;
|
|
81
|
+
try {
|
|
82
|
+
for (const attachment of result.attachments) {
|
|
83
|
+
if (attachment.name === data) {
|
|
84
|
+
const match = (_a = attachment === null || attachment === void 0 ? void 0 : attachment.contentType) === null || _a === void 0 ? void 0 : _a.match(/charset=(.*)/);
|
|
85
|
+
const charset = match && match.length > 1 ? match[1] : "utf-8";
|
|
86
|
+
return ((_b = attachment.body) === null || _b === void 0 ? void 0 : _b.toString(charset || "utf-8").toUpperCase()) || "";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
logger_1.reporterLogger.error(`Error in fetching OS - ${error}`);
|
|
92
|
+
}
|
|
93
|
+
return "";
|
|
94
|
+
}
|
|
95
|
+
getTestResultObject(test, result, jobName) {
|
|
96
|
+
var _a, _b, _c, _d;
|
|
82
97
|
switch (test.outcome()) {
|
|
83
98
|
case "skipped":
|
|
84
99
|
this.skippedTests++;
|
|
@@ -101,10 +116,6 @@ class ReporterUtils {
|
|
|
101
116
|
default:
|
|
102
117
|
break;
|
|
103
118
|
}
|
|
104
|
-
let browserName = (_a = test.parent.project().use.browserName) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
105
|
-
if (!browserName) {
|
|
106
|
-
browserName = (_b = test.parent.project().use.defaultBrowserType) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
107
|
-
}
|
|
108
119
|
const testResult = new testResult_1.TestResult();
|
|
109
120
|
testResult.runId = this.envVariables.runId;
|
|
110
121
|
testResult.shardId = this.envVariables.runId + "_" + this.envVariables.shardId;
|
|
@@ -119,11 +130,15 @@ class ReporterUtils {
|
|
|
119
130
|
testResult.status = this.getTestStatus(test, result);
|
|
120
131
|
testResult.lineNumber = test.location.line;
|
|
121
132
|
testResult.retry = result.retry ? result.retry : 0;
|
|
133
|
+
let browserName = (_b = (_a = test.parent.project()) === null || _a === void 0 ? void 0 : _a.use.browserName) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
134
|
+
if (!browserName) {
|
|
135
|
+
browserName = (_d = (_c = test.parent.project()) === null || _c === void 0 ? void 0 : _c.use.defaultBrowserType) === null || _d === void 0 ? void 0 : _d.toLowerCase();
|
|
136
|
+
}
|
|
122
137
|
testResult.webTestConfig = {
|
|
123
138
|
jobName: jobName,
|
|
124
139
|
projectName: test.parent.project().name,
|
|
125
140
|
browserType: browserName ? browserName.toUpperCase() : "",
|
|
126
|
-
os: this.
|
|
141
|
+
os: this.getOSName(result, constants_1.Constants.OS),
|
|
127
142
|
};
|
|
128
143
|
testResult.annotations = this.extractTestAnnotations(test.annotations);
|
|
129
144
|
testResult.tags = this.extractTestTags(test);
|
|
@@ -280,6 +295,15 @@ class ReporterUtils {
|
|
|
280
295
|
return 0;
|
|
281
296
|
}
|
|
282
297
|
}
|
|
298
|
+
static getBufferSize(attachmentBody) {
|
|
299
|
+
try {
|
|
300
|
+
const fileSizeInBytes = attachmentBody.length;
|
|
301
|
+
return fileSizeInBytes;
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
return 0;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
283
307
|
redactAccessToken(info) {
|
|
284
308
|
if (!info || ReporterUtils.isNullOrEmpty(this.envVariables.accessToken)) {
|
|
285
309
|
return "";
|
|
@@ -392,6 +416,12 @@ class ReporterUtils {
|
|
|
392
416
|
}
|
|
393
417
|
attachmentStatus += "trace";
|
|
394
418
|
}
|
|
419
|
+
else if (attachment.contentType === "text/plain") {
|
|
420
|
+
if (attachmentStatus !== "") {
|
|
421
|
+
attachmentStatus += ",";
|
|
422
|
+
}
|
|
423
|
+
attachmentStatus += "txt";
|
|
424
|
+
}
|
|
395
425
|
}
|
|
396
426
|
return attachmentStatus;
|
|
397
427
|
}
|
|
@@ -512,19 +542,6 @@ class ReporterUtils {
|
|
|
512
542
|
static isNullOrEmpty(str) {
|
|
513
543
|
return !str || str.trim() === "";
|
|
514
544
|
}
|
|
515
|
-
getOsName() {
|
|
516
|
-
const osType = os_1.default.type();
|
|
517
|
-
switch (osType) {
|
|
518
|
-
case "Darwin":
|
|
519
|
-
return "MAC";
|
|
520
|
-
case "Linux":
|
|
521
|
-
return "LINUX";
|
|
522
|
-
case "Windows_NT":
|
|
523
|
-
return "WINDOWS";
|
|
524
|
-
default:
|
|
525
|
-
return "UNKNOWN";
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
545
|
}
|
|
529
546
|
ReporterUtils.getReporterBackOffOptions = {
|
|
530
547
|
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,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,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,MAAc;QAC1C,MAAM,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC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C,CAAC;oBACd,OAAO;gBACT,CAAC;gBACD,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,OAAO;gBACT,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,GAA8B;QACxD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAEO,SAAS;QACf,MAAM,MAAM,GAAG,YAAE,CAAC,IAAI,EAAE,CAAC;QACzB,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,KAAK,CAAC;YACf,KAAK,OAAO;gBACV,OAAO,OAAO,CAAC;YACjB,KAAK,YAAY;gBACf,OAAO,SAAS,CAAC;YACnB;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;;AApTa,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;AA2SJ,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 os from \"os\";\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 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 let browserName = test.parent.project()!.use.browserName?.toLowerCase();\n if (!browserName) {\n browserName = test.parent.project()!.use.defaultBrowserType?.toLowerCase();\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 testResult.webTestConfig = {\n jobName: jobName,\n projectName: test.parent.project()!.name,\n browserType: browserName ? browserName.toUpperCase() : \"\",\n os: this.getOsName(),\n };\n testResult.annotations = this.extractTestAnnotations(test.annotations);\n testResult.tags = this.extractTestTags(test);\n testResult.resultsSummary = {\n status: result.status.toUpperCase(),\n duration: result.duration,\n startTime: result.startTime.toISOString().replace(/\\.\\d+Z$/, \"Z\"),\n attachmentsMetadata: this.getAttachmentStatus(result),\n };\n testResult.artifactsPath = result.attachments\n .filter((attachment) => attachment?.path !== null && attachment?.path !== undefined) // Filter attachments with defined and non-null path property\n .map(\n (attachment) =>\n `${testResult.testExecutionId}/${ReporterUtils.getFileRelativePath(attachment.path!)}`,\n );\n return testResult;\n }\n\n public generateMarkdownSummary(testRunUrl: string): void {\n try {\n if (CIInfoProvider.getCIProvider() === CI_PROVIDERS.GITHUB) {\n const markdownContent = `\n#### Microsoft Playwright Testing run summary\n\n#### Results:\n \n **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: result.errors ? JSON.stringify(result.errors, null, 2) : \"\",\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 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 }\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 getOsName(): string {\n const osType = os.type();\n switch (osType) {\n case \"Darwin\":\n return \"MAC\";\n case \"Linux\":\n return \"LINUX\";\n case \"Windows_NT\":\n return \"WINDOWS\";\n default:\n return \"UNKNOWN\";\n }\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,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,MAAc;QAC1C,MAAM,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,YA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CAAC;oBACd,OAAO;gBACT,CAAC;gBACD,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,OAAO;gBACT,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,GAA8B;QACxD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;;AArTa,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;AA4SJ,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 **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: result.errors ? JSON.stringify(result.errors, null, 2) : \"\",\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\nexport default ReporterUtils;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/microsoft-playwright-testing",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.20241220.1",
|
|
4
4
|
"description": "Package to integrate your Playwright test suite with Microsoft Playwright Testing service",
|
|
5
5
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/microsoft-playwright-testing/README.md",
|
|
6
6
|
"sdk-type": "client",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"eslint": "^9.9.0",
|
|
87
87
|
"mocha": "^11.0.2",
|
|
88
88
|
"sinon": "^17.0.0",
|
|
89
|
-
"typescript": "~5.
|
|
89
|
+
"typescript": "~5.7.2"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@playwright/test": "^1.43.1"
|
|
@@ -96,6 +96,7 @@ declare class MPTReporter implements Reporter {
|
|
|
96
96
|
private _onBegin;
|
|
97
97
|
private _onTestEnd;
|
|
98
98
|
private _onEnd;
|
|
99
|
+
private renewSasUriIfNeeded;
|
|
99
100
|
private _uploadTestResultAttachments;
|
|
100
101
|
private initializeMPTReporter;
|
|
101
102
|
private displayAdditionalInformation;
|