Skip to content

[ci] Use PublishTestResults@2 instead of DotNetCoreCLI@2 built-in publishing#1404

Merged
jonathanpeppers merged 4 commits intomainfrom
jonathanpeppers/dev-peppers-fix-test-result-upload-timeo
Apr 15, 2026
Merged

[ci] Use PublishTestResults@2 instead of DotNetCoreCLI@2 built-in publishing#1404
jonathanpeppers merged 4 commits intomainfrom
jonathanpeppers/dev-peppers-fix-test-result-upload-timeo

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

Summary

The DotNetCoreCLI@2 task's built-in test result publishing uploads TRX files through the Azure Storage Data Movement library, which has been hitting SSL errors (RemoteCertificateNameMismatch) and timing out for ~11 minutes per test step — adding over an hour to builds.

Example: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1380182

Changes

  • Set publishTestResults: false on each DotNetCoreCLI@2 test step
  • Added explicit --logger trx --results-directory $(Agent.TempDirectory) to test arguments
  • Added a single PublishTestResults@2 step at the end to upload all .trx files in one batch

This uses the PublishTestResults@2 task's upload path instead of the old blob storage mechanism, which avoids the SSL issues entirely.

…lishing

The DotNetCoreCLI@2 task's built-in test result publishing uploads TRX
files through Azure Storage Data Movement library, which has been hitting
SSL errors (RemoteCertificateNameMismatch) and timing out for ~11 minutes
per test step.

Switch to:
- publishTestResults: false on each DotNetCoreCLI@2 test step
- Explicit --logger trx --results-directory in arguments
- A single PublishTestResults@2 step at the end to upload all TRX files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 15, 2026 16:38
Each test step now writes a named TRX file (e.g. generator.trx,
Java.Base-jnimarshalmethod.trx) so PublishTestResults@2 creates
separate test runs per assembly, preserving the per-test granularity
that was previously provided by DotNetCoreCLI@2's testRunTitle.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the CI test execution template to stop using DotNetCoreCLI@2’s built-in TRX publishing (which is encountering SSL/timeouts) and instead emit TRX files explicitly and publish them once via PublishTestResults@2.

Changes:

  • Disabled built-in test result publishing on all DotNetCoreCLI@2 test steps (publishTestResults: false).
  • Added explicit TRX logging/output to dotnet test arguments (--logger trx --results-directory $(Agent.TempDirectory)).
  • Added a final PublishTestResults@2 step to publish all .trx files in one pass.

Comment thread build-tools/automation/templates/core-tests.yaml Outdated
Comment thread build-tools/automation/templates/core-tests.yaml Outdated
The single bulk PublishTestResults@2 at the end produced generic
names like "VSTest_TestResults_<buildId>_N". Switch to individual
PublishTestResults@2 steps after each test, each with the original
testRunTitle so the Azure DevOps test results tab shows meaningful
per-assembly names.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers jonathanpeppers force-pushed the jonathanpeppers/dev-peppers-fix-test-result-upload-timeo branch 5 times, most recently from e4c0db8 to 59c5424 Compare April 15, 2026 18:02
The repeated DotNetCoreCLI@2 + PublishTestResults@2 pair is now a
reusable template. All original displayName and testRunTitle values
are preserved exactly as they were on main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers jonathanpeppers force-pushed the jonathanpeppers/dev-peppers-fix-test-result-upload-timeo branch from 59c5424 to ea62f62 Compare April 15, 2026 18:03
@jonathanpeppers jonathanpeppers merged commit f671a1f into main Apr 15, 2026
2 checks passed
@jonathanpeppers jonathanpeppers deleted the jonathanpeppers/dev-peppers-fix-test-result-upload-timeo branch April 15, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants