Skip to content

Commit 537aa47

Browse files
committed
Added job for TestTemplatesCG to run only on official builds. Cleaned up invocation of populateInternalRuntimeVariables. Fixed Arcade template folder name paths. Minor formatting changes.
1 parent 7e865a2 commit 537aa47

File tree

4 files changed

+41
-23
lines changed

4 files changed

+41
-23
lines changed

.vsts-ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ extends:
102102
oneESCompat:
103103
templateFolderName: templates-official
104104
publishTaskPrefix: 1ES.
105+
populateInternalRuntimeVariables: true
105106
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
106107
locBranch: release/10.0.1xx
107108
# WORKAROUND: BinSkim requires the folder exist prior to scanning.
@@ -141,6 +142,14 @@ extends:
141142
_SignType: real
142143
dependsOn: Official_windows_x64
143144
downloadManifestMsiPackages: true
145+
### TestTemplatesCG ###
146+
# Note: This job is only used to allow the test templates to be built locally on the agent as opposed to Helix.
147+
# The tests acquire the templates' PackageReferences from NuGet, which allows them to be scanned by CG (component governance).
148+
# CG is only ran internally, so this job makes sense to only run alongside of the official jobs.
149+
- categoryName: TestTemplatesCG
150+
testProjects: $(Build.SourcesDirectory)/test/dotnet-new.IntegrationTests/dotnet-new.IntegrationTests.csproj
151+
testRunnerAdditionalArguments: -class Microsoft.DotNet.Cli.New.IntegrationTests.DotnetNewTestTemplatesTests
152+
publishXunitResults: true
144153

145154
############### LINUX ###############
146155
- template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml@self
@@ -153,6 +162,7 @@ extends:
153162
oneESCompat:
154163
templateFolderName: templates-official
155164
publishTaskPrefix: 1ES.
165+
populateInternalRuntimeVariables: true
156166
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
157167
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
158168
timeoutInMinutes: 90
@@ -235,6 +245,7 @@ extends:
235245
oneESCompat:
236246
templateFolderName: templates-official
237247
publishTaskPrefix: 1ES.
248+
populateInternalRuntimeVariables: true
238249
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
239250
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
240251
timeoutInMinutes: 90
@@ -260,6 +271,8 @@ extends:
260271
vmImage: macOS-latest
261272
os: macOS
262273
helixTargetQueue: osx.13.arm64
274+
populateInternalRuntimeVariables: true
275+
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
263276
macOSJobParameterSets:
264277
- categoryName: TestBuild
265278
targetArchitecture: arm64
@@ -270,7 +283,9 @@ extends:
270283
- template: /eng/dotnet-format/dotnet-format-integration.yml@self
271284
parameters:
272285
oneESCompat:
286+
templateFolderName: templates-official
273287
publishTaskPrefix: 1ES.
288+
populateInternalRuntimeVariables: true
274289
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
275290

276291
############### PUBLISH STAGE ###############

eng/dotnet-format/dotnet-format-integration.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ parameters:
22
- name: oneESCompat
33
type: object
44
default:
5+
templateFolderName: templates
56
publishTaskPrefix: ''
67

78
- name: TestArguments
@@ -63,6 +64,9 @@ parameters:
6364
- name: runtimeSourceProperties
6465
type: string
6566
default: ''
67+
- name: populateInternalRuntimeVariables
68+
type: boolean
69+
default: false
6670

6771
jobs:
6872
- job: Formatting_Check
@@ -77,8 +81,11 @@ jobs:
7781
os: windows
7882
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
7983
steps:
80-
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
81-
- template: /eng/common/templates/steps/enable-internal-sources.yml
84+
- ${{ if eq(parameters.populateInternalRuntimeVariables, true) }}:
85+
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/steps/enable-internal-sources.yml
86+
parameters:
87+
legacyCredential: $(dn-bot-dnceng-artifact-feeds-rw)
88+
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/steps/enable-internal-runtimes.yml
8289
- script: .\restore.cmd ${{ parameters.runtimeSourceProperties }}
8390
displayName: 🟣 Restore dependencies
8491
- script: |
@@ -106,8 +113,11 @@ jobs:
106113
os: windows
107114
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
108115
steps:
109-
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
110-
- template: /eng/common/templates/steps/enable-internal-sources.yml
116+
- ${{ if eq(parameters.populateInternalRuntimeVariables, true) }}:
117+
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/steps/enable-internal-sources.yml
118+
parameters:
119+
legacyCredential: $(dn-bot-dnceng-artifact-feeds-rw)
120+
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/steps/enable-internal-runtimes.yml
111121
- script: eng\dotnet-format\integration-test.cmd -repo '${{ testArgs._repo }}' -branchName '${{ testArgs._branchName }}' -sha '${{ testArgs._sha }}' -targetSolution '${{ testArgs._targetSolution }}' -useParentSdk ${{ testArgs._useParentSdk }} -testPath '$(Agent.TempDirectory)\temp' -stage 'prepare' -runtimeSourceProperties '${{ parameters.runtimeSourceProperties }}'
112122
displayName: 🟣 Prepare ${{ testArgs._repoName }} for formatting
113123

eng/pipelines/templates/jobs/sdk-build.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ parameters:
1212
testProjects: $(Build.SourcesDirectory)/test/UnitTests.proj
1313
publishRetryConfig: false
1414
publishXunitResults: false
15+
testRunnerAdditionalArguments: ''
1516
enableSbom: true
17+
populateInternalRuntimeVariables: false
1618
timeoutInMinutes: 150
1719
### ENV VARS ###
1820
testFullMSBuild: false
@@ -71,11 +73,11 @@ jobs:
7173
targetPath: $(Build.SourcesDirectory)/eng/BuildConfiguration
7274
artifactName: BuildConfiguration
7375

74-
# Populate internal runtime variables.
75-
- template: /eng/common/templates/steps/enable-internal-sources.yml
76-
parameters:
77-
legacyCredential: $(dn-bot-dnceng-artifact-feeds-rw)
78-
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
76+
- ${{ if eq(parameters.populateInternalRuntimeVariables, true) }}:
77+
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/steps/enable-internal-sources.yml
78+
parameters:
79+
legacyCredential: $(dn-bot-dnceng-artifact-feeds-rw)
80+
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/steps/enable-internal-runtimes.yml
7981

8082
- ${{ if eq(parameters.downloadManifestMsiPackages, true) }}:
8183
- task: DownloadBuildArtifacts@1
@@ -84,7 +86,7 @@ jobs:
8486
downloadPath: $(Build.SourcesDirectory)/artifacts/downloaded-manifest-msi-packages
8587
itemPattern: '**/*Manifest-*.Msi.*.nupkg'
8688
checkDownloadedFiles: true
87-
displayName: Download Manifest msi packages
89+
displayName: 🟣 Download Manifest MSI Packages
8890

8991
############### BUILDING ###############
9092
- ${{ if eq(parameters.pool.os, 'windows') }}:
@@ -131,30 +133,20 @@ jobs:
131133
OPENSSL_ENABLE_SHA1_SIGNATURES: 1
132134
133135
############### TESTING ###############
134-
- ${{ if eq(parameters.pool.os, 'windows') }}:
135-
- ${{ if eq(parameters.targetArchitecture, 'x64') }}:
136-
- powershell: eng/common/build.ps1
137-
-restore -test -ci -prepareMachine -nativeToolsOnMachine
138-
-configuration $(buildConfiguration)
139-
/p:Projects="$(Build.SourcesDirectory)/test/dotnet-new.IntegrationTests/dotnet-new.IntegrationTests.csproj"
140-
/p:TestRunnerAdditionalArguments="-class Microsoft.DotNet.Cli.New.IntegrationTests.DotnetNewTestTemplatesTests"
141-
${{ parameters.runtimeSourceProperties }}
142-
/bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfiguration)/TestTemplateTests.binlog
143-
displayName: 🟣 Run Test Templates Tests
144-
condition: succeeded()
145-
146136
- ${{ if eq(parameters.runTests, true) }}:
147137
- ${{ if eq(parameters.runAoTTests, true) }}:
148138
# For the reason this is here, see: https://github.com/dotnet/sdk/issues/22655
149139
- script: $(Build.SourcesDirectory)/artifacts/bin/redist/$(buildConfiguration)/dotnet/dotnet workload install wasm-tools --skip-manifest-update
150140
workingDirectory: $(Build.SourcesDirectory)/artifacts/bin
151141
displayName: 🟣 Install wasm-tools Workload
142+
152143
# For the /p:Projects syntax for PowerShell, see: https://github.com/dotnet/msbuild/issues/471#issuecomment-1146466335
153144
- ${{ if eq(parameters.pool.os, 'windows') }}:
154145
- powershell: eng/common/build.ps1
155146
-restore -test -ci -prepareMachine -nativeToolsOnMachine
156147
-configuration $(buildConfiguration)
157148
/p:Projects=\`"${{ replace(parameters.testProjects, ';', '`;') }}\`"
149+
/p:TestRunnerAdditionalArguments="${{ parameters.testRunnerAdditionalArguments }}"
158150
/p:TargetArchitecture=${{ parameters.targetArchitecture }}
159151
${{ parameters.runtimeSourceProperties }}
160152
/p:CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
@@ -167,6 +159,7 @@ jobs:
167159
HelixAccessToken: $(HelixApiAccessToken)
168160
RunAoTTests: ${{ parameters.runAoTTests }}
169161
TestFullMSBuild: ${{ parameters.testFullMSBuild }}
162+
170163
- ${{ else }}:
171164
# For the /p:Projects syntax for Bash, see: https://github.com/dotnet/msbuild/issues/471#issuecomment-1690189034
172165
# The /p:CustomHelixTargetQueue syntax is: <queue-name>@<container-url>
@@ -175,6 +168,7 @@ jobs:
175168
-restore -test -ci -prepareMachine
176169
-configuration $(buildConfiguration)
177170
'/p:Projects="${{ parameters.testProjects }}"'
171+
/p:TestRunnerAdditionalArguments="${{ parameters.testRunnerAdditionalArguments }}"
178172
/p:TargetArchitecture=${{ parameters.targetArchitecture }}
179173
/p:TargetRid=${{ parameters.runtimeIdentifier }}
180174
${{ parameters.osProperties }}

eng/pipelines/templates/jobs/sdk-job-matrix.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ parameters:
3131
container: azureLinux30Amd64
3232
helixTargetContainer: $(helixTargetContainerPrefix)ubuntu-24.04-helix-amd64
3333
osProperties: /p:OSName=linux /p:BuildSdkDeb=true
34-
runTests: true
3534
# Helix is hanging on this job using the container. See: https://github.com/dotnet/dnceng/issues/6000
3635
disableJob: true
3736
- categoryName: TemplateEngine

0 commit comments

Comments
 (0)