forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Azure#2 from Azure/main
pr
- Loading branch information
Showing
164 changed files
with
6,401 additions
and
4,729 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.0.0-dev.20220805.3 | ||
1.0.0-dev.20220810.2 |
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
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,56 @@ | ||
parameters: | ||
- name: ProjectFilesOutputFolder | ||
type: string | ||
default: "$(Build.ArtifactStagingDirectory)" | ||
- name: NumOfTestProjectsPerJob | ||
type: number | ||
default: 20 | ||
- name: OutputProjectFilePath | ||
type: string | ||
default: "$(System.DefaultWorkingDirectory)/projects.txt" | ||
- name: TestDependsOnDependency | ||
type: string | ||
default: "not-specific" | ||
- name: ProjectListOverrideFilePropertyName | ||
type: string | ||
default: '' | ||
- name: MatrixConfigsFile | ||
type: string | ||
default: './eng/pipelines/templates/stages/platform-matrix.json' | ||
- name: ExcludeTargetTestProjects | ||
type: boolean | ||
default: false | ||
- name: ServiceDirectory | ||
type: string | ||
default: 'not-specific' | ||
steps: | ||
- template: /eng/pipelines/templates/steps/install-dotnet.yml | ||
- pwsh: | | ||
dotnet build /t:ProjectDependsOn ./eng/service.proj ` | ||
/p:TestDependsOnDependency="${{parameters.TestDependsOnDependency}}" ` | ||
/p:IncludeSrc=false /p:IncludeStress=false /p:IncludeSamples=false ` | ||
/p:IncludePerf=false /p:RunApiCompat=false ` | ||
/p:InheritDocEnabled=false /p:BuildProjectReferences=false ` | ||
/p:OutputProjectFilePath="${{parameters.OutputProjectFilePath}}" | ||
displayName: Find all test dependencies | ||
- task: PowerShell@2 | ||
inputs: | ||
targetType: filePath | ||
filePath: eng/scripts/splittestdependencies/Generate-Dependency-Test-References.ps1 | ||
arguments: >- | ||
-ProjectListFilePath ${{ parameters.OutputProjectFilePath }} | ||
-ProjectFilesOutputFolder ${{ parameters.ProjectFilesOutputFolder }} | ||
-NumOfTestProjectsPerJob ${{ parameters.NumOfTestProjectsPerJob }} | ||
-MatrixConfigsFile ${{parameters.MatrixConfigsFile}} | ||
-ProjectFileConfigName ${{parameters.ProjectListOverrideFilePropertyName}} | ||
-ExcludeTargetTestProjects: $${{parameters.ExcludeTargetTestProjects}} | ||
-ServiceDirectoryToExclude ${{parameters.ServiceDirectory}} | ||
ignoreLASTEXITCODE: true | ||
pwsh: true | ||
displayName: Split testing packages into different files | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathToPublish: $(Build.ArtifactStagingDirectory) | ||
artifactName: DependencyTestProjectReferences |
73 changes: 73 additions & 0 deletions
73
eng/scripts/splittestdependencies/Generate-Dependency-Test-References.ps1
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,73 @@ | ||
<# | ||
.SYNOPSIS | ||
Split the test dependencies into different project files. | ||
.DESCRIPTION | ||
.NET pipelines will run centain number of test dependencies in each entry of job matrix. | ||
The Script is to split all test dependencies into difference sets for later use. | ||
The script is able to test locally using Pester. Please run tests as following every time you made changes to the script: | ||
``` | ||
Invoke-Pester -Output Detailed $PSScriptRoot\tests\Generate-Dependency-Test-References-Tests.ps1 | ||
``` | ||
.PARAMETER ProjectListFilePath | ||
The file path contains all test dependencies. E.g. The file generated by 'eng/service.proj' in dependecny.tests.yml `Find all test dependencies` step | ||
.PARAMETER ProjectFilesOutputFolder | ||
The folder for all test dependency split files e.g. `Project_1.props` which are ready to publish. E.g. $(Build.ArtifactStagingDirectory) | ||
.PARAMETER NumOfTestProjectsPerJob | ||
The number of test run on each job. | ||
.PARAMETER MatrixConfigsFile | ||
The file path of the matrix job configuration. E.g. "/eng/pipelines/templates/stages/platform-matrix.json" | ||
.PARAMETER ProjectFileConfigName | ||
The config name of the project file name. Hardcoded in "\eng\pipelines\templates\jobs\ci.yml" `PreGenerationSteps` for matix generation. E.g. 'ProjectListOverrideFile' | ||
.PARAMETER ExcludeTargetTestProjects | ||
The flag to indicate whether exclude target test package or not. | ||
.PARAMETER ServiceDirectoryToExclude | ||
The service directory which needs to exclude. E.g. "core" | ||
.EXAMPLE | ||
Run script with default parameters. | ||
Generate-Dependency-Test-References.ps1 -ProjectFilesOutputFolder "$(Build.ArtifactStagingDirectory)/projects" -ProjectListFilePath "eng/projects.txt" ` | ||
-MatrixConfigsFile "eng/pipelines/templates/stages/platform-matrix.json" -ProjectFileConfigName "ProjectListOverrideFile" -ExcludeTargetTestProjects $true ` | ||
-ServiceDirectoryToExclude "core" | ||
#> | ||
Param ( | ||
[ValidateNotNullOrEmpty()] | ||
[string] $ProjectListFilePath, | ||
[string] $ProjectFilesOutputFolder="./", | ||
[int] $NumOfTestProjectsPerJob = 20, | ||
[ValidateNotNullOrEmpty()] | ||
[string] $MatrixConfigsFile, | ||
[ValidateNotNullOrEmpty()] | ||
[string] $ProjectFileConfigName, | ||
[boolean] $ExcludeTargetTestProjects=$false, | ||
[string] $ServiceDirectoryToExclude | ||
) | ||
|
||
. (Join-Path $PSScriptRoot generate-dependency-functions.ps1) | ||
Set-StrictMode -Version 3 | ||
|
||
$projGroups = Split-Project-File-To-Groups ` | ||
-ProjectFile $ProjectListFilePath ` | ||
-NumberOfTestsPerJob $NumOfTestProjectsPerJob ` | ||
-ExcludeService $ExcludeTargetTestProjects ` | ||
-ServiceDirToExclude $ServiceDirectoryToExclude | ||
|
||
$projFiles = Write-Test-Dependency-Group-To-Files ` | ||
-ProjectGroups $projGroups ` | ||
-MatrixOutputFolder $ProjectFilesOutputFolder | ||
|
||
Write-Project-Files-To-Matrix ` | ||
-ProjectFiles $projFiles ` | ||
-MatrixJsonPath $MatrixConfigsFile ` | ||
-MatrixOutputFolder $ProjectFilesOutputFolder ` | ||
-ProjectFileConfigName $ProjectFileConfigName |
Oops, something went wrong.