From 20ca498d58cb10673ec34901b1d6cc19c612c6cb Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Fri, 9 Oct 2026 11:13:20 -0700 Subject: [PATCH] fix(hidi): place Pester test inside its test project Relocate the unchanged NuGet helper Pester suite into the physical Hidi test project so SonarScanner assigns it to module test inputs. Remove the ineffective virtual link and update the workflow and documented invocation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d8b2d595-33d1-4ed7-a6fa-047f6ca57a36 --- .github/workflows/sonarcloud.yml | 2 +- src/Microsoft.OpenApi.Hidi/readme.md | 6 ++++-- .../Microsoft.OpenApi.Hidi.Tests.csproj | 1 - .../check-nuget-package-published.Tests.ps1 | 0 4 files changed, 5 insertions(+), 4 deletions(-) rename test/{scripts => Microsoft.OpenApi.Hidi.Tests}/check-nuget-package-published.Tests.ps1 (100%) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 32ce1a34..a7910c11 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -70,7 +70,7 @@ jobs: $outputRoot = Join-Path $PWD 'artifacts\hidi\powershell-coverage' New-Item -ItemType Directory -Force -Path $outputRoot | Out-Null $configuration = New-PesterConfiguration - $configuration.Run.Path = 'test\scripts\check-nuget-package-published.Tests.ps1' + $configuration.Run.Path = 'test\Microsoft.OpenApi.Hidi.Tests\check-nuget-package-published.Tests.ps1' $configuration.Run.PassThru = $true $configuration.CodeCoverage.Enabled = $true $configuration.CodeCoverage.Path = $helper diff --git a/src/Microsoft.OpenApi.Hidi/readme.md b/src/Microsoft.OpenApi.Hidi/readme.md index 249af7bb..0d9b83a9 100644 --- a/src/Microsoft.OpenApi.Hidi/readme.md +++ b/src/Microsoft.OpenApi.Hidi/readme.md @@ -89,8 +89,10 @@ access, the ESRP connection and protected `nuget-org` environment authorization before cutover; local packaging does not prove production signing or publishing. The private-feed helper has isolated Pester 5.7.1 tests (no live feed access). -Run `Invoke-Pester .\test\scripts\check-nuget-package-published.Tests.ps1` to -execute the cases. The Sonar workflow also measures helper line coverage and +Run `Invoke-Pester .\test\Microsoft.OpenApi.Hidi.Tests\check-nuget-package-published.Tests.ps1` to +execute the cases. The test resides physically inside the Hidi test project so +SonarScanner for .NET classifies it as test code, rather than root source code. +The Sonar workflow also measures helper line coverage and imports a generic coverage report alongside the existing C# OpenCover reports. ### Windows executable diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj index 8995d0c6..098f5f0b 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj +++ b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj @@ -29,7 +29,6 @@ - PreserveNewest diff --git a/test/scripts/check-nuget-package-published.Tests.ps1 b/test/Microsoft.OpenApi.Hidi.Tests/check-nuget-package-published.Tests.ps1 similarity index 100% rename from test/scripts/check-nuget-package-published.Tests.ps1 rename to test/Microsoft.OpenApi.Hidi.Tests/check-nuget-package-published.Tests.ps1