Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(playwrighttesting): scalable error message regex parsing #31056

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class Constants {
public static readonly TEST_TYPE = "WebTest";
public static readonly TEST_SDK_LANGUAGE = "JAVASCRIPT";
// Placeholder version
public static readonly REPORTER_PACKAGE_VERSION = "1.0.0-beta.1";
public static readonly REPORTER_PACKAGE_VERSION = "1.0.0-beta.2";
public static readonly DEFAULT_DASHBOARD_ENDPOINT = "https://playwright.microsoft.com";
public static readonly DEFAULT_SERVICE_ENDPOINT =
"https://{region}.reporting.api.playwright-test.io";
Expand Down Expand Up @@ -166,7 +166,7 @@ export const TestResultErrorConstants = [
message: `You do not have the required permissions to run tests. This could be because:

a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.
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 and login using the command 'az login --tenant <TENANT_ID>'.
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>'.
`,
pattern:
/(?=.*browserType\.connect)(?=.*403 Forbidden)(?=[\s\S]*CheckAccess API call with non successful response)/i,
Expand All @@ -176,14 +176,29 @@ export const TestResultErrorConstants = [
key: "InvalidWorkspace_Scalable",
message: "The specified workspace does not exist. Please verify your workspace settings.",
pattern:
/(?=.*browserType\.connect)(?=.*403 Forbidden)(?=.*InvalidAccountOrSubscriptionState)/i,
/(?=.*browserType\.connect)(?=.*403 Forbidden)(?=[\s\S]*InvalidAccountOrSubscriptionState)/i,
type: TestErrorType.Scalable,
},
{
key: "InvalidAccessToken_Scalable",
message:
"The provided access token does not match the specified workspace URL. Please verify that both values are correct.",
pattern: /(?=.*browserType\.connect)(?=.*403 Forbidden)(?=[\s\S]*InvalidAccessToken)/i,
type: TestErrorType.Scalable,
},
{
key: "AccessTokenOrUserOrWorkspaceNotFound_Scalable",
message:
"The data for the user, workspace or access token was not found. Please check the request or create new token and try again.",
pattern: /(?=.*browserType\.connect)(?=.*404 Not Found)(?=[\s\S]*NotFound)/i,
type: TestErrorType.Scalable,
},
{
key: "AccessKeyBasedAuthNotSupported_Scalable",
message:
"Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.",
pattern: /(?=.*browserType\.connect)(?=.*403 Forbidden)(?=.*AccessKeyBasedAuthNotSupported)/i,
pattern:
/(?=.*browserType\.connect)(?=.*403 Forbidden)(?=[\s\S]*AccessKeyBasedAuthNotSupported)/i,
type: TestErrorType.Scalable,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const getServiceConfig = (
}
if (!process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED]) {
process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] = "true";
console.log("\nRunning tests using Microsoft Playwright Testing service.");
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class MPTReporter implements Reporter {
}
this.storageClient = new StorageClient();
if (
this.envVariables.region !== null &&
this.envVariables.region &&
!Constants.SupportedRegions.includes(this.envVariables.region!) &&
this.isTokenValid
) {
Expand Down