Skip to content

Commit 25eb1ee

Browse files
Max CharlambCopilot
andcommitted
Experiment: copy test results to staging dir before publish
Copy xUnit XML test results to Build.StagingDirectory/TestResults using CopyFiles@2 before PublishTestResults, mirroring the pattern used in dotnet/diagnostics. This isolates the test results from the source tree and avoids potential path or file-system differences that may be causing PublishTestResults v2.270.0 to batch results differently than in the diagnostics-public-ci pipeline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7b14f37 commit 25eb1ee

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

eng/pipelines/runtime-diagnostics.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,20 @@ extends:
9595
unpackFolder: $(Build.SourcesDirectory)/artifacts/runtime
9696
displayName: 'Runtime Build Artifacts'
9797
postBuildSteps:
98+
# Copy test results to staging directory (preserves encoding, isolates from source tree).
99+
- task: CopyFiles@2
100+
displayName: 'Gather Test Results'
101+
inputs:
102+
sourceFolder: '$(Build.SourcesDirectory)/artifacts/TestResults'
103+
contents: '**/*.xml'
104+
targetFolder: '$(Build.StagingDirectory)/TestResults'
105+
continueOnError: true
106+
condition: always()
98107
- task: PublishTestResults@2
99108
inputs:
100109
testResultsFormat: xUnit
101110
testResultsFiles: '**/*.xml'
102-
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults'
111+
searchFolder: '$(Build.StagingDirectory)/TestResults'
103112
testRunTitle: 'Tests $(_PhaseName)'
104113
failTaskOnFailedTests: true
105114
publishRunAttachments: true
@@ -143,11 +152,20 @@ extends:
143152
unpackFolder: $(Build.SourcesDirectory)/artifacts/runtime
144153
displayName: 'Runtime Build Artifacts'
145154
postBuildSteps:
155+
# Copy test results to staging directory (preserves encoding, isolates from source tree).
156+
- task: CopyFiles@2
157+
displayName: 'Gather Test Results'
158+
inputs:
159+
sourceFolder: '$(Build.SourcesDirectory)/artifacts/TestResults'
160+
contents: '**/*.xml'
161+
targetFolder: '$(Build.StagingDirectory)/TestResults'
162+
continueOnError: true
163+
condition: always()
146164
- task: PublishTestResults@2
147165
inputs:
148166
testResultsFormat: xUnit
149167
testResultsFiles: '**/*.xml'
150-
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults'
168+
searchFolder: '$(Build.StagingDirectory)/TestResults'
151169
testRunTitle: 'Tests $(_PhaseName)'
152170
failTaskOnFailedTests: true
153171
publishRunAttachments: true

0 commit comments

Comments
 (0)