From 7934d982002915cfb6c8c1bdb2e10d1aadff7625 Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Fri, 9 Oct 2026 10:49:26 -0700 Subject: [PATCH 1/2] fix(tests): classify v2 NuGet helper Pester tests Link the existing Pester script into the Hidi test project so analysis treats it as test code without excluding files or changing release behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f8d164a5-72a6-482a-8749-ae5c6e47a0e5 --- .../Microsoft.OpenApi.Hidi.Tests.csproj | 1 + 1 file changed, 1 insertion(+) 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 ab4d5420..7bf640cd 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj +++ b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj @@ -28,6 +28,7 @@ + Always From 4795eb0044ddebddeb1e2b100430666c31dbe43c Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Fri, 9 Oct 2026 11:12:21 -0700 Subject: [PATCH 2/2] fix(tests): place v2 Pester tests inside the Hidi test project Move the existing script unchanged into the physical test project directory so the scanner assigns it to test sources. Remove the ineffective sibling link and update the workflow and local test documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f8d164a5-72a6-482a-8749-ae5c6e47a0e5 --- .github/workflows/sonarcloud.yml | 2 +- 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 ca6bd5d3..d717f338 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/README.md b/README.md index a1e490db..8dce0ca6 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,10 @@ This pipeline implementation does not enable publishing or authorize resources. The SonarCloud workflow runs the private-feed helper tests with Pester 5.7.1 and converts measured JaCoCo line hits to Sonar generic coverage, alongside the -existing C# OpenCover reports. Run the helper tests locally with -`Import-Module Pester -RequiredVersion 5.7.1; Invoke-Pester .\test\scripts\check-nuget-package-published.Tests.ps1`. +existing C# OpenCover reports. The Pester script resides inside the Hidi test +project directory so Sonar assigns it to test sources; a linked sibling file +does not establish that ownership. Run the helper tests locally with +`Import-Module Pester -RequiredVersion 5.7.1; Invoke-Pester .\test\Microsoft.OpenApi.Hidi.Tests\check-nuget-package-published.Tests.ps1`. --- 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 7bf640cd..ab4d5420 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj +++ b/test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj @@ -28,7 +28,6 @@ - Always 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