Skip to content

Commit

Permalink
Adding CI coverage to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joperezr authored and ericstj committed Jul 13, 2020
1 parent ba1bef6 commit 0ef3fc9
Show file tree
Hide file tree
Showing 9 changed files with 326 additions and 73 deletions.
6 changes: 5 additions & 1 deletion eng/pipelines/common/templates/runtimes/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ parameters:
runtimeFlavor: 'coreclr'
runtimeFlavorDisplayName: 'CoreCLR'
runtimeVariant: ''
dependsOn: []

### Build managed test components (native components are getting built as part
### of the the product build job).
Expand Down Expand Up @@ -63,10 +64,13 @@ jobs:
# See https://docs.microsoft.com/azure/devops/pipelines/process/conditions
condition: and(succeeded(), ${{ parameters.condition }})

${{ if ne(parameters.dependsOn[0], '') }}:
dependsOn: ${{ parameters.dependsOn }}

# TODO: Build of managed test components currently depends on the corresponding build job
# because it needs System.Private.Corelib; we should be able to remove this dependency
# by switching over to using reference assembly.
${{ if ne(parameters.stagedBuild, true) }}:
${{ if and(ne(parameters.stagedBuild, true), eq(parameters.dependsOn[0], '')) }}:
dependsOn:
- ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig)) }}
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
Expand Down
23 changes: 14 additions & 9 deletions eng/pipelines/common/templates/runtimes/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ parameters:
pool: ''
runtimeFlavor: 'coreclr'
runtimeFlavorDisplayName: 'CoreCLR'
dependsOn: []

### Test run job

Expand Down Expand Up @@ -47,15 +48,19 @@ jobs:
${{ if eq(variables['System.TeamProject'], 'internal') }}:
continueOnError: true

dependsOn:
- ${{ if eq(parameters.testGroup, 'innerloop') }}:
- '${{ parameters.runtimeFlavor }}_common_test_build_p0_AnyOS_AnyCPU_${{parameters.buildConfig }}'
- ${{ if ne(parameters.testGroup, 'innerloop') }}:
- '${{ parameters.runtimeFlavor }}_common_test_build_p1_AnyOS_AnyCPU_${{parameters.buildConfig }}'
- ${{ if ne(parameters.stagedBuild, true) }}:
- ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }}
${{ if ne(parameters.dependsOn[0], '') }}:
dependsOn: ${{ parameters.dependsOn }}

${{ if eq(parameters.dependsOn[0], '') }}:
dependsOn:
- ${{ if eq(parameters.testGroup, 'innerloop') }}:
- '${{ parameters.runtimeFlavor }}_common_test_build_p0_AnyOS_AnyCPU_${{parameters.buildConfig }}'
- ${{ if ne(parameters.testGroup, 'innerloop') }}:
- '${{ parameters.runtimeFlavor }}_common_test_build_p1_AnyOS_AnyCPU_${{parameters.buildConfig }}'
- ${{ if ne(parameters.stagedBuild, true) }}:
- ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }}

# Compute job name from template parameters
${{ if eq(parameters.testGroup, 'innerloop') }}:
Expand Down
54 changes: 4 additions & 50 deletions eng/pipelines/libraries/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,62 +97,16 @@ jobs:
displayName: Disk Usage after Build
- ${{ if eq(parameters.runTests, false) }}:
- ${{ if ne(parameters.isOfficialBuild, true) }}:
- task: CopyFiles@2
displayName: Prepare testhost folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/testhost
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/testhost

- task: CopyFiles@2
displayName: Prepare artifacts toolset folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/toolset
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/toolset

- task: CopyFiles@2
displayName: Prepare runtime folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/runtime
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/runtime

- task: CopyFiles@2
displayName: Prepare ref folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref

- task: CopyFiles@2
displayName: Prepare shared framework ref assemblies to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref/microsoft.netcore.app
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref/microsoft.netcore.app

- task: CopyFiles@2
displayName: Prepare shared framework runtime folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/pkg
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/pkg

- template: /eng/pipelines/libraries/prepare-publish-for-tests.yml
parameters:
isOfficialBuild: ${{ parameters.isOfficialBuild }}

- task: CopyFiles@2
displayName: Prepare docs folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/docs
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/docs

- task: CopyFiles@2
displayName: Prepare native folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/native
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/native

- task: CopyFiles@2
displayName: Prepare artifacts packages folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/packages
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/packages
condition: and(succeeded(), eq(variables['_librariesBuildProducedPackages'], true))

- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.ArtifactStagingDirectory)/artifacts
Expand Down
12 changes: 8 additions & 4 deletions eng/pipelines/libraries/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
variables: {}
condition: true
runTests: false
dependsOn: []

jobs:
- template: /eng/pipelines/libraries/base-job.yml
Expand All @@ -37,10 +38,13 @@ jobs:
displayName: 'Test Build'

dependsOn:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
# Libraries Test also depends on Product, now that the libraries build only depends on corelib
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
- ${{ if ne(parameters.dependsOn[0], '') }}:
- ${{ parameters.dependsOn }}
- ${{ if eq(parameters.dependsOn[0], '') }}:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
# Libraries Test also depends on Product, now that the libraries build only depends on corelib
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}

variables:
- librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }}
Expand Down
55 changes: 55 additions & 0 deletions eng/pipelines/libraries/prepare-publish-for-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Steps used to prepare the Artifacts Staging Directory with required files for
# executing libraries tests as well as shared framework assets
parameters:
isOfficialBuild: ''

steps:
- ${{ if ne(parameters.isOfficialBuild, true) }}:
- task: CopyFiles@2
displayName: Prepare testhost folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/testhost
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/testhost

- task: CopyFiles@2
displayName: Prepare artifacts toolset folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/toolset
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/toolset

- task: CopyFiles@2
displayName: Prepare runtime folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/runtime
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/runtime

- task: CopyFiles@2
displayName: Prepare ref folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref

- task: CopyFiles@2
displayName: Prepare shared framework ref assemblies to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref/microsoft.netcore.app
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref/microsoft.netcore.app

- task: CopyFiles@2
displayName: Prepare shared framework runtime folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/pkg
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/pkg

- task: CopyFiles@2
displayName: Prepare native folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/native
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/native

- task: CopyFiles@2
displayName: Prepare artifacts packages folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/packages
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/packages
condition: and(succeeded(), eq(variables['_librariesBuildProducedPackages'], true))
20 changes: 12 additions & 8 deletions eng/pipelines/libraries/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ parameters:
# stress modes that each test will be run with. This is the same usage as 'testGroup' in
# eng/pipelines/common/templates/runtimes/run-test-job.yml.
coreclrTestGroup: ''
dependsOn: []

jobs:
- template: /eng/pipelines/libraries/base-job.yml
Expand Down Expand Up @@ -50,14 +51,17 @@ jobs:
testDisplayName: ${{ parameters.runtimeFlavor }}_interpreter_${{ parameters.liveRuntimeBuildConfig }}

dependsOn:
- ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ format('libraries_test_build_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
- ${{ if in(parameters.framework, 'allConfigurations', 'net472') }}:
- ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ format('libraries_test_build_{0}_{1}_{2}_{3}', parameters.framework, parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
- ${{ if ne(parameters.dependsOn[0], '') }}:
- ${{ parameters.dependsOn }}
- ${{ if eq(parameters.dependsOn[0], '') }}:
- ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ format('libraries_test_build_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
- ${{ if in(parameters.framework, 'allConfigurations', 'net472') }}:
- ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ format('libraries_test_build_{0}_{1}_{2}_{3}', parameters.framework, parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}

variables:
- librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
Expand Down
Loading

0 comments on commit 0ef3fc9

Please sign in to comment.