Skip to content

Commit

Permalink
Create pipeline to run Visual Studio integration tests (#5936)
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkan committed Jul 31, 2024
1 parent 6e878d0 commit 50907a2
Show file tree
Hide file tree
Showing 4 changed files with 560 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ stages:
- ${{if gt(length(parameters.variables), 0)}}:
- ${{parameters.variables}}
runSettingsURI: ${{parameters.runSettingsURI}}
visualStudioBootstrapperURI: $(bootstrapperUrl)
visualStudioBootstrapperURI: $(bootstrapperUrl)
baseVisualStudioBootstrapperURI: https://vsdrop.microsoft.com/file/v1/$(VisualStudio.BaseBuild.ProductsDropName);bootstrappers/Enterprise/vs_enterprise.exe
candidateBaselineBuilds: $(BaselineBuildCommitIds)
testLabPoolName: VS-Platform
Expand All @@ -56,14 +56,18 @@ stages:
testExecutionJobTimeoutInMinutes: ${{parameters.testExecutionJobTimeoutInMinutes}}
testMachineCleanUpStrategy: ${{parameters.testMachineCleanUpStrategy}}
testAgentElevated: true

##############################
## preTestMachineConfigurationStepList
##############################
preTestMachineConfigurationStepList:
- template: \steps\powershell\execute-script.yml@DartLabTemplates
parameters:
displayName: Get Baseline Build ID using CloudBuild Session ID
continueOnError: true
filePath: $(DartLab.Path)\Scripts\AzureDevOps\Build\Get-BuildIdFromCloudBuildSessionID.ps1
arguments: -ClientSecret (ConvertTo-SecureString '$(CloudBuild-ClientSecret)' -AsPlainText -Force) -ClientID '$(CloudBuild-ClientID)' -SessionID '${{ parameters.QBuildSessionId }}' -OutVariableName 'BaselineBuildID'

- task: PowerShell@2
displayName: "Get Baseline build commit ids"
name: "getbaselinebuildcommitids"
Expand All @@ -74,7 +78,7 @@ stages:
script: |
try {
Write-Host "Getting Baseline build commit ids for build: '$(BaselineBuildID)'"
$artifactName = 'BuildArtifacts'
$baselineBuildsFile = Join-Path $(Agent.TempDirectory) "BaselineBuilds.json"
Expand Down Expand Up @@ -117,6 +121,10 @@ stages:
$buildDrop = "${{parameters.baseBuildDrop}}" -split "/"
$dropName = "Products/DevDiv/VS/$($buildDrop[-2])/$($buildDrop[-1])"
Write-Host "##vso[task.setvariable variable=VisualStudio.BaseBuild.ProductsDropName]$dropName"
##############################
## preDeployAndRunTestsStepList
##############################
preDeployAndRunTestsStepList:
- task: PowerShell@1
displayName: "Print Environment Variables"
Expand All @@ -125,32 +133,13 @@ stages:
inlineScript: |
Get-ChildItem Env: | Sort-Object Name | Format-Table -Wrap -AutoSize
- task: DownloadPipelineArtifact@0
displayName: "Download Pipeline artifacts"
- task: DownloadPipelineArtifact@2
displayName: "Download scripts"
inputs:
artifactName: "VS15"
downloadPath: "$(Build.Repository.LocalPath)/artifacts"

- powershell: |
$zipPath = "$(Build.Repository.Localpath)/artifacts/VS15/EndToEnd.zip"
$dest = "$(System.DefaultWorkingDirectory)/artifacts/EndToEnd/"
Write-Output "Extracting '$zipPath' to '$dest'"
Expand-Archive -Path "$zipPath" -DestinationPath "$dest"
$nugetExePath = "$(Build.Repository.Localpath)/artifacts/VS15/NuGet.exe"
Write-Output "Copying '$nugetExePath' to '$dest'"
Copy-Item -Path "$nugetExePath" -Destination "$dest"
displayName: "Extract EndToEnd.zip"
artifactName: "scripts"
downloadPath: "$(Build.StagingDirectory)/scripts"

- task: PowerShell@1
displayName: "SetupFunctionalTests.ps1"
inputs:
scriptName: "$(System.DefaultWorkingDirectory)/artifacts/EndToEnd/scripts/SetupFunctionalTests.ps1"
postDeployAndRunTestsStepList:
- task: PowerShell@1
displayName: "Initialize Git Commit Status on GitHub"
inputs:
scriptType: "inlineScript"
inlineScript: |
. $(System.DefaultWorkingDirectory)\\artifacts\\EndToEnd\\scripts\\PostGitCommitStatus.ps1
SetCommitStatusForTestResult -PersonalAccessToken $(NuGetLurkerPersonalAccessToken) -VstsPersonalAccessToken $(System.AccessToken) -CommitSha $(Build.SourceVersion) -TestName "$(GitHubStatusName)"
condition: "not(eq(variables['ManualGitHubChecks'], 'false'))"
scriptName: "$(Build.StagingDirectory)/scripts/e2etests/SetupFunctionalTests.ps1"
Loading

0 comments on commit 50907a2

Please sign in to comment.