Skip to content

Commit

Permalink
trying to fix slicing
Browse files Browse the repository at this point in the history
  • Loading branch information
aishwaryabh committed Jan 22, 2025
1 parent c5eb85a commit bd5acd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion slice.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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"
Expand Down

0 comments on commit bd5acd1

Please sign in to comment.