-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented live test and integrated into Azure pipeline (#20505)
* Implemented live test and integrated into Azure pipeline * Updated GenerateDocumentationFile from switch to string
- Loading branch information
1 parent
8cbb06f
commit 790025c
Showing
19 changed files
with
1,612 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
parameters: | ||
- name: win_image | ||
displayName: Windows Image Version | ||
type: string | ||
default: windows-2019 | ||
- name: linux_image | ||
displayName: Linux Image Version | ||
type: string | ||
default: ubuntu-20.04 | ||
- name: macOS_image | ||
displayName: MacOS Image Version | ||
type: string | ||
default: macOS-11 | ||
- name: win_ps_5_1 | ||
displayName: Windows PowerShell 5.1 Version | ||
type: string | ||
default: 5.1 | ||
- name: ps_7_0_x | ||
displayName: PowerShell 7.0.x Version | ||
type: string | ||
default: 7.0.13 | ||
- name: ps_7_1_x | ||
displayName: PowerShell 7.1.x Version | ||
type: string | ||
default: 7.1.7 | ||
- name: ps_7_2_x | ||
displayName: PowerShell 7.2.x Version | ||
type: string | ||
default: 7.2.7 | ||
- name: ps_latest | ||
displayName: PowerShell Latest Version | ||
type: string | ||
default: latest | ||
- name: dotnet_sdk_6 | ||
displayName: .NET 6 SDK Version | ||
type: string | ||
default: 6.0.x | ||
- name: dotnet_sdk_7 | ||
displayName: .NET 7 SDK Version | ||
type: string | ||
default: 7.0.x | ||
|
||
variables: | ||
LiveTestArtifactsName: LiveTestArtifacts | ||
LiveTestDataLocation: $(Pipeline.Workspace)/$(LiveTestArtifactsName) | ||
EnableTestCoverage: true | ||
TestCoverageLocation: $(LiveTestDataLocation) | ||
|
||
pr: none | ||
trigger: none | ||
|
||
jobs: | ||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'win_ps_5_1' | ||
vmImage: ${{ parameters.win_image }} | ||
psVersion: ${{ parameters.win_ps_5_1 }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_7_0_x_win' | ||
vmImage: ${{ parameters.win_image }} | ||
psVersion: ${{ parameters.ps_7_0_x }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_7_1_x_win' | ||
vmImage: ${{ parameters.win_image }} | ||
psVersion: ${{ parameters.ps_7_1_x }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_7_2_x_win' | ||
vmImage: ${{ parameters.win_image }} | ||
psVersion: ${{ parameters.ps_7_2_x }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_latest_win' | ||
vmImage: ${{ parameters.win_image }} | ||
psVersion: ${{ parameters.ps_latest }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_7 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_7_0_x_linux' | ||
vmImage: ${{ parameters.linux_image }} | ||
psVersion: ${{ parameters.ps_7_0_x }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_7_1_x_linux' | ||
vmImage: ${{ parameters.linux_image }} | ||
psVersion: ${{ parameters.ps_7_1_x }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_7_2_x_linux' | ||
vmImage: ${{ parameters.linux_image }} | ||
psVersion: ${{ parameters.ps_7_2_x }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_latest_linux' | ||
vmImage: ${{ parameters.linux_image }} | ||
psVersion: ${{ parameters.ps_latest }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_7 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_7_2_x_macOS' | ||
vmImage: ${{ parameters.macOS_image }} | ||
psVersion: ${{ parameters.ps_7_2_x }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_6 }} | ||
|
||
- template: util/live-test-steps.yml | ||
parameters: | ||
name: 'ps_latest_macOS' | ||
vmImage: ${{ parameters.macOS_image }} | ||
psVersion: ${{ parameters.ps_latest }} | ||
dotnetVersion: ${{ parameters.dotnet_sdk_7 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
parameters: | ||
- name: name | ||
- name: vmImage | ||
- name: psVersion | ||
- name: dotnetVersion | ||
|
||
jobs: | ||
- job: ${{ parameters.name }} | ||
timeoutInMinutes: 180 | ||
pool: | ||
vmImage: ${{ parameters.vmImage }} | ||
|
||
steps: | ||
- task: UseDotNet@2 | ||
condition: ne('${{ parameters.dotnetVersion }}', '') | ||
displayName: Install desired .NET version ${{ parameters.dotnetVersion }} | ||
inputs: | ||
packageType: sdk | ||
version: ${{ parameters.dotnetVersion }} | ||
|
||
- task: PowerShell@2 | ||
displayName: Install desired Powershell version ${{ parameters.psVersion }} | ||
inputs: | ||
pwsh: true | ||
targetType: filePath | ||
filePath: ./tools/TestFx/Live/InitializeLiveTestEnvironment.ps1 | ||
arguments: -DesiredVersion ${{ parameters.psVersion }} | ||
|
||
- task: PowerShell@2 | ||
displayName: Create live test data location directory | ||
inputs: | ||
pwsh: true | ||
targetType: inline | ||
script: | ||
New-Item -Name $(LiveTestArtifactsName) -Path $(Pipeline.Workspace) -ItemType Directory -Force | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
condition: and(succeeded(), eq(variables['GalleryName'], 'DailyBuild'), eq(variables['BuildPipelineBuildId'], '')) | ||
displayName: Download latest artifacts from daily build pipeline main branch | ||
inputs: | ||
buildType: specific | ||
project: $(ProjectToDownloadArtifacts) | ||
definition: $(BuildPipelineDefinitionId) | ||
buildVersionToDownload: latestFromBranch | ||
branchName: refs/heads/master | ||
artifactName: $(ArtifactName) | ||
targetPath: $(Pipeline.Workspace) | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
condition: and(succeeded(), eq(variables['GalleryName'], 'DailyBuild'), ne(variables['BuildPipelineBuildId'], '')) | ||
displayName: Download specific artifacts from daily build pipeline | ||
inputs: | ||
buildType: specific | ||
project: $(ProjectToDownloadArtifacts) | ||
definition: $(BuildPipelineDefinitionId) | ||
buildVersionToDownload: specific | ||
pipelineId: $(BuildPipelineBuildId) | ||
artifactName: $(ArtifactName) | ||
targetPath: $(Pipeline.Workspace) | ||
|
||
- task: PowerShell@2 | ||
condition: and(succeeded(), eq(variables['GalleryName'], 'DailyBuild')) | ||
displayName: Copy artifacts to local repository | ||
inputs: | ||
pwsh: true | ||
targetType: inline | ||
script: | | ||
$azPackagesDir = New-Item -Name AzPackages -Path $(LiveTestDataLocation) -ItemType Directory -Force | ||
$azPackagesFiles = Join-Path -Path $(Pipeline.Workspace) -ChildPath *.nupkg | ||
Move-Item -Path $azPackagesFiles -Destination $azPackagesDir | ||
Get-ChildItem -LiteralPath $azPackagesDir | ||
- task: PowerShell@2 | ||
displayName: Install desired Az module from $(GalleryName) | ||
inputs: | ||
pwsh: true | ||
targetType: filePath | ||
filePath: ./tools/TestFx/Live/InvokeLiveTestCITask.ps1 | ||
arguments: -UseWindowsPowerShell ('${{ parameters.psVersion }}' -eq '5.1') -ScriptFile './tools/TestFx/Live/InstallLiveTestAzModules.ps1 -Source $(GalleryName) -AzPackagesLocation (Convert-Path -LiteralPath $(LiveTestDataLocation) | Join-Path -ChildPath AzPackages)' | ||
|
||
- task: PowerShell@2 | ||
displayName: Connect Azure with live test service principal | ||
inputs: | ||
pwsh: true | ||
targetType: filePath | ||
filePath: ./tools/TestFx/Live/InvokeLiveTestCITask.ps1 | ||
arguments: -UseWindowsPowerShell ('${{ parameters.psVersion }}' -eq '5.1') -ScriptFile './tools/TestFx/Live/ConnectLiveTestServicePrincipal.ps1 $(LiveTestServicePrincipalSubscriptionId) $(LiveTestServicePrincipalTenantId) $(LiveTestServicePrincipalId) $(LiveTestServicePrincipalSecret)' | ||
|
||
- task: PowerShell@2 | ||
displayName: Run top E2E live scenarios | ||
inputs: | ||
pwsh: true | ||
targetType: filePath | ||
filePath: ./tools/TestFx/Live/InvokeLiveTestCITask.ps1 | ||
arguments: -UseWindowsPowerShell ('${{ parameters.psVersion }}' -eq '5.1') -ScriptFile './tools/TestFx/Live/InvokeLiveTestScenarios.ps1 $(Build.BuildId) ${{ parameters.vmImage }} ${{ parameters.psVersion }} $(Build.SourcesDirectory) $(LiveTestDataLocation)' | ||
failOnStderr: true | ||
|
||
- task: PowerShell@2 | ||
displayName: Save live test results to Kusto | ||
inputs: | ||
pwsh: true | ||
targetType: filePath | ||
filePath: ./tools/TestFx/Live/SaveLiveTestResult.ps1 | ||
arguments: $(KustoServicePrincipalTenantId) $(KustoServicePrincipalId) $(KustoServicePrincipalSecret) $(KustoClusterName) $(KustoClusterRegion) $(LiveTestDatabaseName) $(LiveTestTableName) $(TestCoverageTableName) $(LiveTestDataLocation) | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: Publish live test results to pipeline artifact | ||
inputs: | ||
artifact: livetest-os-${{ parameters.vmImage }}-powershell-${{ parameters.psVersion }} | ||
targetPath: $(LiveTestDataLocation) | ||
condition: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.