From bd5acd17093f671c331a9c1095b82b51da4b5acb Mon Sep 17 00:00:00 2001 From: Aishwarya Bhandari Date: Wed, 22 Jan 2025 10:28:35 -0800 Subject: [PATCH] trying to fix slicing --- slice.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slice.ps1 b/slice.ps1 index de84e1423..658665b85 100644 --- a/slice.ps1 +++ b/slice.ps1 @@ -15,7 +15,7 @@ if (-not (Test-Path -Path $tempTestsFile)) { # Read the test names from the file into an array $tests = Get-Content -Path $tempTestsFile $testCount = $tests.Count -$totalAgents = 5 +$totalAgents = $env:SYSTEM_TOTALJOBSINPHASE $agentNumber = $env:SYSTEM_JOBPOSITIONINPHASE if (-not $totalAgents) { $totalAgents = 1 } @@ -28,6 +28,7 @@ Write-Host "Total tests: $testCount" Write-Host "Target tests:" $filter = "" for ($i = $agentNumber; $i -le $testCount; $i += $totalAgents) { + Write-Host "Current index: $i" $targetTestName = $tests[$i - 1] # Arrays are 0-indexed in PowerShell Write-Host "$targetTestName" $filter += "|Name=$targetTestName"