chore: override host platform with env variable (#33434)

This commit is contained in:
Yury Semikhatsky 2024-11-04 14:14:24 -08:00 committed by GitHub
parent ab22f81922
commit 36a975c30b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,12 @@ export type HostPlatform = 'win64' |
'<unknown>';
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));