2023-03-01 17:19:54 +00:00
|
|
|
parameters:
|
|
|
|
- name: buildName
|
|
|
|
type: string
|
|
|
|
|
|
|
|
- name: targetRid
|
|
|
|
type: string
|
|
|
|
|
|
|
|
- name: architecture
|
|
|
|
type: string
|
|
|
|
|
2023-03-03 11:17:00 +00:00
|
|
|
- name: dotnetDotnetRunId
|
2023-03-02 12:11:58 +00:00
|
|
|
type: string
|
|
|
|
|
2023-03-01 17:19:54 +00:00
|
|
|
jobs:
|
|
|
|
- job: ${{ parameters.buildName }}_${{ parameters.architecture }}
|
|
|
|
timeoutInMinutes: 150
|
|
|
|
pool:
|
|
|
|
name: NetCore1ESPool-Svc-Internal
|
|
|
|
demands: ImageOverride -equals 1es-ubuntu-2004
|
|
|
|
variables:
|
2023-03-03 10:42:45 +00:00
|
|
|
- template: ../variables/pipelines.yml
|
2023-03-01 17:19:54 +00:00
|
|
|
steps:
|
2023-03-02 12:09:30 +00:00
|
|
|
- script: |
|
2023-03-03 11:17:00 +00:00
|
|
|
vmr_build='${{ replace(parameters.dotnetDotnetRunId, ' ', '') }}'
|
2023-03-02 12:09:30 +00:00
|
|
|
|
|
|
|
if [[ -z "$vmr_build" ]]; then
|
|
|
|
vmr_build=$(az pipelines runs list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --pipeline-ids '$(DOTNET_DOTNET_CI_PIPELINE_ID)' --status completed --top 1 --query "[].id" --output tsv)
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z "$vmr_build" ]]; then
|
|
|
|
fail "Could not find a completed vmr build"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-03-03 12:12:25 +00:00
|
|
|
echo "Vmr build: https://dev.azure.com/dnceng/internal/_build/results?buildId=$vmr_build&view=results"
|
2023-03-02 12:09:30 +00:00
|
|
|
|
|
|
|
installer_sha=$(az pipelines build tag list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --build-id $vmr_build --output tsv | sed "s,installer-,,g")
|
|
|
|
installer_build=$(az pipelines runs list --organization '$(AZDO_ORG)' --project '$(AZDO_PROJECT)' --pipeline-ids '$(INSTALLER_OFFICIAL_CI_PIPELINE_ID)' --query "[?sourceVersion == '$installer_sha'].id" --output tsv)
|
|
|
|
if [[ -z "$installer_build" ]]; then
|
|
|
|
fail "Could not find a build of installer for commit '$installer_sha'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-03-03 12:12:25 +00:00
|
|
|
echo "Installer build: https://dev.azure.com/dnceng/internal/_build/results?buildId=$installer_build&view=results"
|
2023-03-02 12:09:30 +00:00
|
|
|
|
|
|
|
echo "##vso[task.setvariable variable=InstallerBuildId]$installer_build"
|
|
|
|
echo "##vso[task.setvariable variable=VmrBuildId]$vmr_build"
|
2023-03-03 10:47:05 +00:00
|
|
|
displayName: Find associated builds
|
2023-03-02 12:09:30 +00:00
|
|
|
name: Get_Build_Ids
|
|
|
|
env:
|
|
|
|
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
|
|
|
|
|
2023-03-01 17:19:54 +00:00
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download MSFT SDK
|
|
|
|
inputs:
|
|
|
|
buildType: specific
|
|
|
|
buildVersionToDownload: specific
|
|
|
|
project: internal
|
|
|
|
pipeline: $(INSTALLER_OFFICIAL_CI_PIPELINE_ID)
|
|
|
|
buildId: $(InstallerBuildId)
|
|
|
|
artifact: BlobArtifacts
|
|
|
|
patterns: '**/dotnet-sdk-+([0-9]).+([0-9]).+([0-9])?(-@(alpha|preview|rc|rtm)*)-linux-${{ parameters.architecture }}.tar.gz'
|
|
|
|
allowPartiallySucceededBuilds: true
|
|
|
|
allowFailedBuilds: true
|
|
|
|
downloadPath: $(Pipeline.Workspace)/Artifacts
|
|
|
|
checkDownloadedFiles: true
|
|
|
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Source Build SDK
|
|
|
|
inputs:
|
|
|
|
buildType: specific
|
|
|
|
buildVersionToDownload: specific
|
|
|
|
project: internal
|
|
|
|
pipeline: $(DOTNET_DOTNET_CI_PIPELINE_ID)
|
|
|
|
buildId: $(VmrBuildId)
|
|
|
|
artifact: ${{ parameters.buildName }}_${{ parameters.architecture }}_Artifacts
|
|
|
|
patterns: '**/dotnet-sdk-+([0-9]).+([0-9]).+([0-9])?(-@(alpha|preview|rc|rtm)*)-${{ parameters.targetRid }}.tar.gz'
|
|
|
|
allowPartiallySucceededBuilds: true
|
|
|
|
allowFailedBuilds: true
|
|
|
|
downloadPath: $(Pipeline.Workspace)/Artifacts
|
|
|
|
checkDownloadedFiles: true
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -x
|
|
|
|
|
2023-03-03 11:06:01 +00:00
|
|
|
msft_sdk_tarball_name=$(find "$(Pipeline.Workspace)/Artifacts" -name "dotnet-sdk-*-linux-${{ parameters.architecture }}.tar.gz" -exec basename {} \;)
|
2023-03-01 17:19:54 +00:00
|
|
|
|
2023-03-03 11:06:01 +00:00
|
|
|
if [[ -z $msft_sdk_tarball_name ]]; then
|
2023-03-01 17:19:54 +00:00
|
|
|
fail "Microsoft SDK tarball does not exist in '$(Pipeline.Workspace)/Artifacts'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-03-03 11:06:01 +00:00
|
|
|
sdk_tarball_name=$(find "$(Pipeline.Workspace)/Artifacts" -name "dotnet-sdk-*-${{ parameters.targetRid }}.tar.gz" -exec basename {} \;)
|
2023-03-01 17:19:54 +00:00
|
|
|
|
2023-03-03 11:06:01 +00:00
|
|
|
if [[ -z $sdk_tarball_name ]]; then
|
2023-03-01 17:19:54 +00:00
|
|
|
fail "Source-build SDK tarball does not exist in '$(Pipeline.Workspace)/Artifacts'"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
eng/common/build.sh --projects $(Build.SourcesDirectory)/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj --restore
|
|
|
|
|
2023-03-03 11:43:10 +00:00
|
|
|
envArgs+=" -e SMOKE_TESTS_MSFT_SDK_TARBALL_PATH=$(Pipeline.Workspace)/Artifacts/$msft_sdk_tarball_name"
|
|
|
|
envArgs+=" -e SMOKE_TESTS_SDK_TARBALL_PATH=$(Pipeline.Workspace)/Artifacts/$sdk_tarball_name"
|
2023-03-01 17:19:54 +00:00
|
|
|
envArgs+=" -e SMOKE_TESTS_SOURCEBUILT_ARTIFACTS_PATH= "
|
2023-03-03 11:06:01 +00:00
|
|
|
envArgs+=" -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true"
|
|
|
|
envArgs+=" -e SMOKE_TESTS_RUNNING_IN_CI=true"
|
|
|
|
envArgs+=" -e SMOKE_TESTS_TARGET_RID=${{ parameters.targetRid }}"
|
|
|
|
envArgs+=" -e SMOKE_TESTS_PORTABLE_RID=linux-x64"
|
|
|
|
envArgs+=" -e SMOKE_TESTS_CUSTOM_PACKAGES_PATH= "
|
2023-03-02 14:43:22 +00:00
|
|
|
|
2023-03-03 09:59:00 +00:00
|
|
|
.dotnet/dotnet test $(Build.SourcesDirectory)/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj --filter "FullyQualifiedName=Microsoft.DotNet.SourceBuild.SmokeTests.SdkContentTests.CompareMsftToSb" $envArgs --logger:'trx;LogFileName=$(Agent.JobName)_SDKComparisonTests.trx' --logger:'console;verbosity=detailed'
|
2023-03-01 17:19:54 +00:00
|
|
|
displayName: Run Tests
|
|
|
|
workingDirectory: $(Build.SourcesDirectory)
|
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
continueOnError: true
|
|
|
|
inputs:
|
|
|
|
testRunner: vSTest
|
|
|
|
testResultsFiles: '*.trx'
|
|
|
|
searchFolder: $(Build.SourcesDirectory)/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/TestResults
|
|
|
|
mergeTestResults: true
|
|
|
|
publishRunAttachments: true
|
|
|
|
testRunTitle: SourceBuild_SdkComparisonTests_$(Agent.JobName)
|