Skip to content

Commit dd69c9b

Browse files
committed
win changes cleanup
1 parent 68736b3 commit dd69c9b

File tree

4 files changed

+353
-448
lines changed

4 files changed

+353
-448
lines changed

win/common-utils.ps1

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,12 @@ $script:PROJECT_FOLDER = "NOW"
66

77
$script:GLOBAL_DIR = Join-Path $WORKSPACE_DIR $PROJECT_FOLDER
88
$script:LOG_DIR = Join-Path $GLOBAL_DIR "logs"
9-
$script:GLOBAL_LOG = Join-Path $LOG_DIR "global.log"
10-
$script:WEB_LOG = Join-Path $LOG_DIR "web_run_result.log"
11-
$script:MOBILE_LOG = Join-Path $LOG_DIR "mobile_run_result.log"
129

1310
# Script state
1411
$script:BROWSERSTACK_USERNAME = ""
1512
$script:BROWSERSTACK_ACCESS_KEY = ""
1613
$script:TEST_TYPE = "" # Web / App / Both
1714
$script:TECH_STACK = "" # Java / Python / JS
18-
[double]$script:PARALLEL_PERCENTAGE = 1.00
1915

2016
$script:WEB_PLAN_FETCHED = $false
2117
$script:MOBILE_PLAN_FETCHED = $false
@@ -33,12 +29,6 @@ $script:APP_PLATFORM = "" # ios | android | all
3329
# Chosen Python command tokens (set during validation when Python is selected)
3430
$script:PY_CMD = @()
3531

36-
# ===== Error patterns =====
37-
$script:WEB_SETUP_ERRORS = @("")
38-
$script:WEB_LOCAL_ERRORS = @("")
39-
$script:MOBILE_SETUP_ERRORS= @("")
40-
$script:MOBILE_LOCAL_ERRORS= @("")
41-
4232
# ===== Workspace Management =====
4333
function Ensure-Workspace {
4434
if (!(Test-Path $GLOBAL_DIR)) {
@@ -339,4 +329,38 @@ function Fetch-Plan-Details {
339329
Log-Line "ℹ️ Plan summary: Web $WEB_PLAN_FETCHED ($TEAM_PARALLELS_MAX_ALLOWED_WEB max), Mobile $MOBILE_PLAN_FETCHED ($TEAM_PARALLELS_MAX_ALLOWED_MOBILE max)" $GLOBAL_LOG
340330
}
341331

332+
# ===== Dynamic config generators =====
333+
334+
function Generate-Web-Platforms {
335+
param(
336+
[int]$max_total_parallels,
337+
[string]$platformsListContentFormat
338+
)
339+
340+
$platform = "web"
341+
$env:NOW_PLATFORM = $platform
342+
343+
$platformsList = pick_terminal_devices `
344+
-platformName $platform `
345+
-count $max_total_parallels `
346+
-platformsListContentFormat $platformsListContentFormat
347+
348+
return $platformsList
349+
}
350+
351+
352+
function Generate-Mobile-Platforms {
353+
param(
354+
[int]$max_total_parallels,
355+
[string]$platformsListContentFormat
356+
)
357+
358+
$app_platform = $env:APP_PLATFORM
359+
360+
$platformsList = pick_terminal_devices `
361+
-platformName $app_platform `
362+
-count $max_total_parallels `
363+
-platformsListContentFormat $platformsListContentFormat
342364

365+
return $platformsList
366+
}

0 commit comments

Comments
 (0)