Skip to content

Commit 56b108d

Browse files
committed
Add files. disable artifact / test results publications to avoid warnings on CI
- artifacts/log is often empty when binary logs are disabled - no tests create *.trx files - don't have Java test results either - only test jobs need test results published
1 parent a2c7274 commit 56b108d

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

.azure/pipelines/jobs/default-build.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
enableMicrobuild: true
8181
enablePublishBuildAssets: true
8282
enablePublishUsingPipelines: ${{ variables._PublishUsingPipelines }}
83-
enablePublishTestResults: true # publish test results to AzDO (populates AzDO Tests tab)
83+
enablePublishTestResults: ${{ eq(parameters.isTestingJob, 'true') }} # publish test results to AzDO (populates AzDO Tests tab)
8484
enableTelemetry: true
8585
helixRepo: dotnet/aspnetcore
8686
helixType: build.product/
@@ -247,18 +247,7 @@ jobs:
247247
artifactType: Container
248248
parallel: true
249249

250-
- ${{ if eq(parameters.isTestingJob, true) }}:
251-
- task: PublishTestResults@2
252-
displayName: Publish VSTest test results
253-
condition: always()
254-
continueOnError: true
255-
inputs:
256-
testRunTitle: $(AgentOsName)-$(BuildConfiguration)
257-
testRunner: vstest
258-
testResultsFiles: '**/artifacts/**/*.trx'
259-
mergeTestResults: true
260-
buildConfiguration: $(BuildConfiguration)
261-
buildPlatform: $(AgentOsName)
250+
- ${{ if and(eq(parameters.isTestingJob, true), ne(parameters.jobName, 'Windows_Templates_Test')) }}:
262251
- task: PublishTestResults@2
263252
displayName: Publish js test results
264253
condition: always()
@@ -267,12 +256,3 @@ jobs:
267256
testResultsFiles: '**/artifacts/log/**/*.junit.xml'
268257
buildConfiguration: $(BuildConfiguration)
269258
buildPlatform: $(AgentOsName)
270-
- task: PublishTestResults@2
271-
displayName: Publish Java test results
272-
condition: always()
273-
inputs:
274-
testRunner: junit
275-
testResultsFiles: '**/TEST-junit-jupiter.xml'
276-
buildConfiguration: $(BuildConfiguration)
277-
buildPlatform: $(AgentOsName)
278-
mergeTestResults: true

build.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ if ($BinaryLog) {
369369
if (-not $bl) {
370370
$MSBuildArguments += "/bl:" + (Join-Path $LogDir "Build.binlog")
371371
}
372+
} elseif ($CI) {
373+
# Ensure the artifacts/log directory isn't empty to avoid warnings.
374+
New-Item (Join-Path $LogDir "empty.log") -ItemType File -ErrorAction SilentlyContinue >$null
372375
}
373376

374377
# Capture MSBuild crash logs

build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@ if [[ "$binary_log" == true ]]; then
338338
if [[ "$found" == false ]]; then
339339
msbuild_args[${#msbuild_args[*]}]="/bl:$log_dir/Build.binlog"
340340
fi
341+
elif [[ "$ci" == true ]]; then
342+
# Ensure the artifacts/log directory isn't empty to avoid warnings.
343+
touch "$log_dir/empty.log"
341344
fi
342345

343346
# Capture MSBuild crash logs

0 commit comments

Comments
 (0)