Skip to content

Commit

Permalink
Accelerate tests by dividing them into shards (#1414)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephan T. Lavavej <[email protected]>
  • Loading branch information
cbezault and StephanTLavavej authored Nov 6, 2020
1 parent 9ee5529 commit 32fe05b
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 3 deletions.
7 changes: 4 additions & 3 deletions azure-devops/run-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

jobs:
- job: ${{ parameters.targetPlatform }}
- job: '${{ parameters.targetPlatform }}_${{ parameters.shardNum }}'
timeoutInMinutes: 360

variables:
buildOutputLocation: 'D:\build\${{ parameters.targetPlatform }}'
litFlags: '-j$(testParallelism);--timeout=240;--shuffle;--xunit-xml-output=$(buildOutputLocation)/test-results.xml'
shardFlags: '--num-shards=${{ parameters.numShards }};--run-shard=${{ parameters.shardNum }}'
vcpkgLocation: '$(Build.SourcesDirectory)/vcpkg'
steps:
- script: |
Expand Down Expand Up @@ -62,7 +63,7 @@ jobs:
-host_arch=amd64 -arch=${{ parameters.vsDevCmdArch }} -no_logo
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$(vcpkgLocation)\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=${{ parameters.targetPlatform }}-windows -DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_BUILD_TYPE=Release -DLIT_FLAGS=$(litFlags) ^
-DCMAKE_BUILD_TYPE=Release -DLIT_FLAGS=$(litFlags);$(shardFlags) ^
-DCMAKE_CXX_FLAGS=/analyze:autolog- ^
-S $(Build.SourcesDirectory) -B $(buildOutputLocation)
cmake --build $(buildOutputLocation)
Expand All @@ -88,4 +89,4 @@ jobs:
searchFolder: $(buildOutputLocation)
testResultsFormat: JUnit
testResultsFiles: '**/test-results.xml'
testRunTitle: 'test-${{ parameters.targetPlatform }}'
testRunTitle: 'test-${{ parameters.targetPlatform }}-${{ parameters.shardNum }}'
106 changes: 106 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,124 @@ stages:
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 1

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 2

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 3

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 4

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 5

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 6

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 7

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x86
vsDevCmdArch: x86
numShards: 8
shardNum: 8

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 1

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 2

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 3

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 4

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 5

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 6

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 7

- template: azure-devops/run-build.yml
parameters:
targetPlatform: x64
vsDevCmdArch: amd64
numShards: 8
shardNum: 8

- template: azure-devops/run-build.yml
parameters:
targetPlatform: arm
vsDevCmdArch: arm
numShards: 1
shardNum: 1

- template: azure-devops/run-build.yml
parameters:
targetPlatform: arm64
vsDevCmdArch: arm64
numShards: 1
shardNum: 1

0 comments on commit 32fe05b

Please sign in to comment.