parameters: buildConfig: '' archType: '' osGroup: '' osIdentifier: '' testGroup: '' readyToRun: false helixQueues: '' crossrootfsDir: '' ### Test job ### Each test job depends on a corresponding build job with the same ### buildConfig and archType. jobs: - template: xplat-job.yml parameters: buildConfig: ${{ parameters.buildConfig }} archType: ${{ parameters.archType }} osGroup: ${{ parameters.osGroup }} osIdentifier: ${{ parameters.osIdentifier }} # Compute job name from template parameters ${{ if and(eq(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, false)) }}: name: ${{ format('testbuild_pri0_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('Test Pri0 {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} ${{ if and(eq(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, true)) }}: name: ${{ format('testbuild_pri0_r2r_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('Test Pri0 R2R {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} ${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, false)) }}: name: ${{ format('testbuild_pri1_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('Test Pri1 {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} ${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, true)) }}: name: ${{ format('testbuild_pri1_r2r_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('Test Pri1 R2R {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} crossrootfsDir: ${{ parameters.crossrootfsDir }} variables: - group: DotNet-HelixApi-Access # Map template parameters to command line arguments - name: priorityArg value: '' - ${{ if ne(parameters.testGroup, 'innerloop') }}: - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - name: priorityArg value: 'priority1' - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - name: priorityArg value: '-priority=1' - name: crossgenArg value: '' - ${{ if eq(parameters.readyToRun, true) }}: - name: crossgenArg value: 'crossgen' - name: clangArg value: '' # Our FreeBSD doesn't yet detect available clang versions, so pass it explicitly. - ${{ if eq(parameters.osGroup, 'FreeBSD') }}: - name: clangArg value: '-clang6.0' - ${{ if and(eq(parameters.osIdentifier, 'Linux_musl'), eq(parameters.archType, 'arm64')) }}: - name: clangArg value: '-clang5.0' # TODO: Enable crossgen in build-test.sh. It currently doesn't # accept a crossgen arg, so disable the macos/linux crossgen test # build jobs. ${{ if and(eq(parameters.readyToRun, true), in(parameters.osGroup, 'Linux', 'OSX')) }}: condition: false # FreeBSD test jobs are disabled since we don't have any FreeBSD helix queues. ${{ if eq(parameters.osGroup, 'FreeBSD') }}: condition: false # Test job depends on the corresponding build job dependsOn: ${{ format('build_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} # Run all steps in the container. # Note that the containers are resources defined in azure-pipelines.yml containerName: ${{ parameters.containerName }} # "Total" means building tests, waiting for a queue in Helix to become available, and running the tests. # In case test-job.yml gets split into two separate jobs (e.g. build-test-job.yml and run-test.yml) # this number should be adjusted accordingly. ${{ if eq(parameters.testGroup, 'innerloop') }}: timeoutInMinutes: 240 ${{ if eq(parameters.testGroup, 'outerloop') }}: timeoutInMinutes: 360 ${{ if in(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2', 'outerloop-jitstressregs', 'outerloop-jitstress2-jitstressregs', 'outerloop-gcstress0x3-gcstress0xc') }}: timeoutInMinutes: 480 steps: # Install test build dependencies - ${{ if eq(parameters.osGroup, 'OSX') }}: - script: sh eng/install-native-dependencies.sh $(osGroup) displayName: Install native dependencies # Download product build from pipeline artifact storage - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - task: DownloadPipelineArtifact@0 displayName: Download product build pipeline artifact inputs: artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} targetPath: $(Build.SourcesDirectory)/bin/Product/$(osGroup).$(archType).$(buildConfigUpper) - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - task: DownloadPipelineArtifact@0 displayName: Download product build pipeline artifact inputs: artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }} targetPath: $(Build.SourcesDirectory)\bin\Product\Windows_NT.$(archType).$(buildConfigUpper) # Build tests # TODO: enable crossgen in build-test.sh - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - script: ./build-test.sh $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(crossgenArg) $(clangArg) displayName: Build tests - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - script: build-test.cmd $(buildConfig) $(archType) $(priorityArg) $(crossgenArg) displayName: Build tests # Send tests to Helix - template: /eng/send-to-helix-step.yml parameters: displayName: Send tests to Helix buildConfig: ${{ parameters.buildConfig }} archType: ${{ parameters.archType }} osGroup: ${{ parameters.osGroup }} ${{ if eq(variables['System.TeamProject'], 'public') }}: creator: $(Build.DefinitionName) helixBuild: $(Build.BuildNumber) ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: helixSource: official/dotnet/coreclr/$(Build.SourceBranch) ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: helixSource: pr/dotnet/coreclr/$(Build.SourceBranch) ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: helixSource: ci/dotnet/coreclr/$(Build.SourceBranch) ${{ if eq(parameters.readyToRun, false) }}: helixType: 'test/functional/cli/' ${{ if eq(parameters.readyToRun, true) }}: helixType: 'test/functional/r2r/cli/' helixQueues: ${{ parameters.helixQueues }} ${{ if eq(parameters.helixQueues.asString, '') }}: condition: false publishTestResults: true ${{ if eq(parameters.testGroup, 'innerloop') }}: # "PerCollection" is time needed for the "biggest" xUnit test collection to complete. # In case xUnit test wrappers get refactored this number should also be adjusted. timeoutPerTestCollectionInMinutes: 30 # "PerTest" corresponds to individual test running time (i.e. __TestTimeout). timeoutPerTestInMinutes: 10 ${{ if eq(parameters.testGroup, 'outerloop') }}: timeoutPerTestCollectionInMinutes: 60 timeoutPerTestInMinutes: 10 ${{ if in(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2', 'outerloop-jitstressregs', 'outerloop-jitstress2-jitstressregs', 'outerloop-gcstress0x3-gcstress0xc') }}: timeoutPerTestCollectionInMinutes: 120 timeoutPerTestInMinutes: 30 runCrossGen: ${{ parameters.readyToRun }} ${{ if eq(variables['System.TeamProject'], 'internal') }}: # Access token variable for internal project from the # DotNet-HelixApi-Access variable group helixAccessToken: $(HelixApiAccessToken) ${{ if in(parameters.testGroup, 'innerloop', 'outerloop') }}: scenarios: asString: 'normal,no_tiered_compilation' asArray: - normal - no_tiered_compilation ${{ if eq(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2') }}: scenarios: asString: 'jitminopts,jitstress1,jitstress1_tiered,jitstress2,jitstress2_tiered' asArray: - jitminopts - jitstress1 - jitstress1_tiered - jitstress2 - jitstress2_tiered ${{ if eq(parameters.testGroup, 'outerloop-jitstressregs') }}: scenarios: asString: 'jitstressregs1,jitstressregs2,jitstressregs3,jitstressregs4,jitstressregs8,jitstressregs0x10,jitstressregs0x80,jitstressregs0x1000' asArray: - jitstressregs1 - jitstressregs2 - jitstressregs3 - jitstressregs4 - jitstressregs8 - jitstressregs0x10 - jitstressregs0x80 - jitstressregs0x1000 ${{ if eq(parameters.testGroup, 'outerloop-jitstress2-jitstressregs') }}: scenarios: asString: 'jitstress2_jitstressregs1,jitstress2_jitstressregs2,jitstress2_jitstressregs3,jitstress2_jitstressregs4,jitstress2_jitstressregs8,jitstress2_jitstressregs0x10,jitstress2_jitstressregs0x80,jitstress2_jitstressregs0x1000' asArray: - jitstress2_jitstressregs1 - jitstress2_jitstressregs2 - jitstress2_jitstressregs3 - jitstress2_jitstressregs4 - jitstress2_jitstressregs8 - jitstress2_jitstressregs0x10 - jitstress2_jitstressregs0x80 - jitstress2_jitstressregs0x1000 ${{ if eq(parameters.testGroup, 'outerloop-gcstress0x3-gcstress0xc') }}: scenarios: asString: 'gcstress0x3,gcstress0xc' asArray: - gcstress0x3 - gcstress0xc # Publish Logs - task: PublishPipelineArtifact@0 displayName: Publish Logs inputs: ${{ if eq(parameters.readyToRun, false) }}: artifactName: ${{ format('testbuild_{0}_{1}_{2}_{3}_Logs', parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }} ${{ if eq(parameters.readyToRun, true) }}: artifactName: ${{ format('testbuild_{0}_{1}_{2}_{3}_r2r_Logs', parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }} targetPath: $(Build.SourcesDirectory)/bin/Logs continueOnError: true condition: always()