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

Fix up test names for reporting #43510

Merged
merged 4 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions eng/pipelines/templates/steps/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,23 @@ steps:
- template: /eng/pipelines/templates/steps/retain-test-logs.yml
- template: /eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml

# The name of a test case in the results file isn't helpful in the web view.
# Update it to include the breadcrumb namespace and the type.
- pwsh: |
echo "Current directory: $(get-location)"
Get-ChildItem "TEST-*.xml" -Recurse | ForEach-Object {
echo "Updating $($_.Name)"
[xml]$xml = Get-Content $_.FullName
$xml.SelectNodes("//testcase") | ForEach-Object {
$parts = $_.classname -split '\.'
$shortClassname = (($parts[0..($parts.Length -2)] | ForEach-Object { $_[0] }) -join ".") + ".$($parts[-1])"
$_.name = "$shortClassname.$($_.name)"
}
$xml.Save($_.FullName)
}
displayName: 'Update test case names for reporting'
workingDirectory: $(System.DefaultWorkingDirectory)/sdk

- task: PublishTestResults@2
condition: always()
inputs:
Expand Down
Loading