-
Notifications
You must be signed in to change notification settings - Fork 4k
Implemented live test and integrated into Azure pipeline #20505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.