Skip to content
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

net - pullrequest #47957

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
daf76a2
* combined net - pullrequest changes to work with new eng/common script
scbedd Nov 27, 2024
0a8932a
re-add missing leg
scbedd Jan 23, 2025
e39640d
clean up some comments. add a missing /
scbedd Jan 24, 2025
7792390
first attempt at allowing AdditionalDependencyLeg while maintaining n…
scbedd Jan 24, 2025
95411a8
more cleanup
scbedd Jan 24, 2025
404d5c0
fix yaml formatting errors
scbedd Jan 24, 2025
49493b5
utilize the artifacts where possible, fall back on package info direc…
scbedd Jan 24, 2025
831c2be
not() instead of bare not
scbedd Jan 24, 2025
d71a11d
repair additional dependency leg
scbedd Jan 27, 2025
1dfbd7b
fix coverage for net - pullrequest
scbedd Jan 27, 2025
349c58c
add language-settings function to resolve Azure.Template as an additi…
scbedd Jan 27, 2025
0ec6660
resolve issue with checkout paths for the additional dependency leg o…
scbedd Jan 27, 2025
fa9d2f7
the condition about ensuring the checkout config is correct
scbedd Jan 27, 2025
9545bc1
handle the case were no packages are directly changed
scbedd Jan 28, 2025
dda34cb
fix update package propers with namespaces to handle when we didn't r…
scbedd Jan 28, 2025
35e5db0
fix issue with not getting the indirect packages propertly
scbedd Jan 28, 2025
4e9839d
revert change to storage
scbedd Jan 28, 2025
6630d1f
change this thing so that assembling of packages via service director…
scbedd Jan 28, 2025
7bd573b
adjust indentation
scbedd Jan 28, 2025
712bb49
remove erroneously added save-package-props
scbedd Jan 28, 2025
255dbf9
fix the indentation so the block map evaluates properly
scbedd Jan 28, 2025
e5ece1c
is the very presence of the props file breaking the scoping of our build
scbedd Jan 28, 2025
3bb5b6b
unset the variable, do we build successfully?
scbedd Jan 28, 2025
d7dc2dc
clear the packageprops override file
scbedd Jan 28, 2025
ff2274e
really force the clearing of that file
scbedd Jan 28, 2025
3e1ae5e
bump the common mgmtpathsexclude up to an itemgroup above
scbedd Jan 28, 2025
f29b5c8
ensure that we run save-package-properties twice on service-specific …
scbedd Jan 28, 2025
8f87def
handle defaulting of variables
scbedd Feb 4, 2025
afe99df
Merge branch 'main' into pipelinev3
scbedd Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 49 additions & 10 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
# Add a default so the job doesn't fail when the matrix is empty
container: $[ variables['Container'] ]

variables:
${{ if eq(parameters.ServiceDirectory, 'auto') }}:
ServiceDirectory: '*'
${{ else }}:
ServiceDirectory: ${{ parameters.ServiceDirectory }}

templateContext:
outputs:
- output: pipelineArtifact
Expand All @@ -72,7 +78,9 @@ jobs:
- ${{ if not(contains(variables['Build.DefinitionName'], '-pr - ')) }}:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
${{ if eq(parameters.ProjectListOverrideFilePropertyName, '') }}:
# we only need to checkout all sdk directories for All PR builds OR the
# deprecating AdditionalDependency leg of the core/resource builds. ProjectListOverrideFilePropertyName will be set in the latter case.
${{ if and(ne(parameters.ServiceDirectory, 'auto'), eq(parameters.ProjectListOverrideFilePropertyName, '')) }}:
Paths:
- "/*"
- "!SessionRecords"
Expand All @@ -82,59 +90,90 @@ jobs:
- "/*"
- "!SessionRecords"
- "/sdk/*/**/SessionRecords/*"

- ${{ if ne(parameters.ProjectListOverrideFilePropertyName, '') }}:
- task: DownloadPipelineArtifact@2
inputs:
artifact: DependencyTestProjectReferences
patterns: "**/$(${{ parameters.ProjectListOverrideFilePropertyName }})"
path: $(Build.SourcesDirectory)
- ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(parameters.ServiceDirectory, 'auto')) }}:
- task: DownloadPipelineArtifact@2
inputs:
artifact: TestPackagesArtifact
path: $(Build.SourcesDirectory)/PackageInfo

- pwsh: |
$(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1
displayName: 'Language Specific Certificate Trust'

- pwsh: |
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx"
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
displayName: 'Configure Kestrel Environment Variables'

- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
parameters:
AgentImage: ${{ parameters.OSName }}

- ${{ each step in parameters.TestSetupSteps }}:
- ${{ each pair in step }}:
${{ pair.key }}: ${{ pair.value }}

# this section is only included when invoking with a dynamic set of packages (EG net - pullrequest)
- ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(parameters.ServiceDirectory, 'auto')) }}:
- template: /eng/pipelines/templates/steps/set-artifact-packages.yml
parameters:
PackageInfo: '$(Build.SourcesDirectory)/PackageInfo'

- pwsh: |
if ("$(ProjectNames)" -like "*storage*") {
&"$(Build.SourcesDirectory)/eng/scripts/install_azurite.ps1" -AzuriteLocation "$(AzuriteLocation)" -AzuriteVersion "$(AzuriteVersion)"
}
displayName: Install Azurite If Necessary
condition: ne(variables['ProjectNames'], '')

- template: /eng/pipelines/templates/steps/install-dotnet.yml
parameters:
NuGetCacheKey: Test

# ProjectListOverrideFile is set by the customization within dependency.tests.yml
# OR it is set by the PR built to target a set of packages outside of a single target service directory.
# if it is unset, then we are in a traditional service directory build.
- pwsh: |
if ("${{ parameters.ProjectListOverrideFilePropertyName }}" -ne '') {
Write-Host "##vso[task.setvariable variable=ProjectListOverrideFileName]$(${{ parameters.ProjectListOverrideFilePropertyName }})"
Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)\sdk\**\coverage.cobertura.xml"
if ($env:PROJECTLISTOVERRIDEFILE) {
Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)/sdk/**/coverage.cobertura.xml"
}
else
{
Write-Host "##vso[task.setvariable variable=ProjectListOverrideFileName]"
Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}\**\coverage.cobertura.xml"
# we aren't running in net - pullrequest, so we need to ensure the value is set to empty string
Write-Host "##vso[task.setvariable variable=ProjectListOverrideFile]"
Write-Host "##vso[task.setvariable variable=CodeCoverageFilePattern]$(Build.SourcesDirectory)/sdk/$(ServiceDirectory)/**/coverage.cobertura.xml"
}
displayName: Set variable for the project list file and coverage directory

- template: /eng/pipelines/templates/steps/dotnet-diagnostics.yml
parameters:
LogFilePath: $(Build.ArtifactStagingDirectory)/test.binlog

- script: >-
dotnet test eng/service.proj
--filter "(TestCategory!=Manually) & (TestCategory!=Live) & ($(AdditionalTestFilters))"
--framework $(TestTargetFramework)
--logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal"
--blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout ${{parameters.TestTimeoutInMinutes}}minutes
/p:SDKType=${{ parameters.SDKType }}
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
/p:ServiceDirectory=$(ServiceDirectory)
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false
/p:RunApiCompat=false /p:InheritDocEnabled=false
/p:Configuration=$(BuildConfiguration)
/p:CollectCoverage=$(CollectCoverage)
/p:EnableSourceLink=false
/p:ProjectListOverrideFile=$(ProjectListOverrideFileName)
/p:ProjectListOverrideFile=$(ProjectListOverrideFile)
$(AdditionalTestArguments)
$(DiagnosticArguments)
displayName: "Build & Test ($(TestTargetFramework))"

- task: PublishTestResults@2
condition: always()
displayName: "Publish Results ($(TestTargetFramework))"
Expand All @@ -149,9 +188,9 @@ jobs:
displayName: Generate Code Coverage Reports
inputs:
reports: $(CodeCoverageFilePattern)
targetdir: $(Build.ArtifactStagingDirectory)\coverage
targetdir: $(Build.ArtifactStagingDirectory)/coverage
reporttypes: Cobertura
filefilters: +$(Build.SourcesDirectory)\sdk\${{parameters.ServiceDirectory}}\**
filefilters: +$(Build.SourcesDirectory)/sdk/$(ServiceDirectory)/**
verbosity: Verbose
- task: PublishCodeCoverageResults@2
condition: and(succeededOrFailed(), eq(variables['CollectCoverage'], 'true'), eq(variables['coverage.collected'], 'true'))
Expand Down
Loading
Loading