Skip to content

Commit

Permalink
Changes test sharding to distribute the load better.
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-tarafa committed Jun 2, 2020
1 parent cf87c75 commit 50f32c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .kokoro-windows/trampoline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ try {
}

# Run the tests.
github\dotnet-docs-samples\.kokoro\main.ps1 $GroupNumber
github\dotnet-docs-samples\.kokoro\main.ps1 $GroupNumber $true
18 changes: 7 additions & 11 deletions .kokoro/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations under
# the License.

param([int]$GroupNumber = 0)
param([int]$GroupNumber = 0, [bool]$IsRunningOnWindows = $false)

Push-Location
try {
Expand All @@ -33,19 +33,15 @@ try {
# Groups of subdirectories.
$groups = @(
$false, # 0: Everything.
$false, # 1: Everything not in another group.
@('video', 'applications'), # 2
@('iam'), # 3: Runs once every 24 hours to avoid bursting active roles limit of 300.
# 4: There's no shard 4, so this is effectively not currently running on Linux.
# Needed because of BouncyCastle and M2Mqtt dependecies that don't support .NET Core.
@('iot')
$false, # 1: Everything starting from a to c.
$false, # 2: Everything starting from d to l, except for iot when on Linux because of the BouncyCastle and other dependencies.
$false # 3: Everything starting from m to z.
)

$union = $groups[2..($groups.Length-1)] | `
% {$_} # Flatten the list
$groups[0] = $allDirs
$groups[1] = $allDirs | Where-Object { -not $union.Contains($_) }

$groups[1] = $allDirs | Where-Object { ($_.Substring(0, 1).CompareTo("a") -ge 0) -and ($_.Substring(0, 1).CompareTo("f") -le 0) }
$groups[2] = $allDirs | Where-Object { ($_.Substring(0, 1).CompareTo("g") -ge 0) -and ($_.Substring(0, 1).CompareTo("q") -le 0) -and ($IsRunningOnWindows -or -not ($_.Equals("iot"))) }
$groups[3] = $allDirs | Where-Object { ($_.Substring(0, 1).CompareTo("r") -ge 0) -and ($_.Substring(0, 1).CompareTo("z") -le 0) }
$dirs = $groups[$GroupNumber]

# Find all the runTest scripts.
Expand Down

0 comments on commit 50f32c5

Please sign in to comment.