From 36a975c30b12b39b81375800a34d5dbc3165cc52 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 4 Nov 2024 14:14:24 -0800 Subject: [PATCH] chore: override host platform with env variable (#33434) --- packages/playwright-core/src/utils/hostPlatform.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/playwright-core/src/utils/hostPlatform.ts b/packages/playwright-core/src/utils/hostPlatform.ts index 9664418e3d..7d81f39da3 100644 --- a/packages/playwright-core/src/utils/hostPlatform.ts +++ b/packages/playwright-core/src/utils/hostPlatform.ts @@ -35,6 +35,12 @@ export type HostPlatform = 'win64' | ''; function calculatePlatform(): { hostPlatform: HostPlatform, isOfficiallySupportedPlatform: boolean } { + if (process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE) { + return { + hostPlatform: process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE as HostPlatform, + isOfficiallySupportedPlatform: false + }; + } const platform = os.platform(); if (platform === 'darwin') { const ver = os.release().split('.').map((a: string) => parseInt(a, 10));