Skip to content

Commit cb766cb

Browse files
authored
fix(hidi): place Pester test inside its test project (#896)
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
1 parent 0b8e521 commit cb766cb

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎.github/workflows/sonarcloud.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
$outputRoot = Join-Path $PWD 'artifacts\hidi\powershell-coverage'
7171
New-Item -ItemType Directory -Force -Path $outputRoot | Out-Null
7272
$configuration = New-PesterConfiguration
73-
$configuration.Run.Path = 'test\scripts\check-nuget-package-published.Tests.ps1'
73+
$configuration.Run.Path = 'test\Microsoft.OpenApi.Hidi.Tests\check-nuget-package-published.Tests.ps1'
7474
$configuration.Run.PassThru = $true
7575
$configuration.CodeCoverage.Enabled = $true
7676
$configuration.CodeCoverage.Path = $helper

‎src/Microsoft.OpenApi.Hidi/readme.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ access, the ESRP connection and protected `nuget-org` environment authorization
8989
before cutover; local packaging does not prove production signing or publishing.
9090

9191
The private-feed helper has isolated Pester 5.7.1 tests (no live feed access).
92-
Run `Invoke-Pester .\test\scripts\check-nuget-package-published.Tests.ps1` to
93-
execute the cases. The Sonar workflow also measures helper line coverage and
92+
Run `Invoke-Pester .\test\Microsoft.OpenApi.Hidi.Tests\check-nuget-package-published.Tests.ps1` to
93+
execute the cases. The test resides physically inside the Hidi test project so
94+
SonarScanner for .NET classifies it as test code, rather than root source code.
95+
The Sonar workflow also measures helper line coverage and
9496
imports a generic coverage report alongside the existing C# OpenCover reports.
9597

9698
### Windows executable

‎test/Microsoft.OpenApi.Hidi.Tests/Microsoft.OpenApi.Hidi.Tests.csproj‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<None Include="..\scripts\check-nuget-package-published.Tests.ps1" Link="Scripts\check-nuget-package-published.Tests.ps1" />
3332
<None Update="testconfig.json">
3433
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3534
</None>

test/scripts/check-nuget-package-published.Tests.ps1 renamed to test/Microsoft.OpenApi.Hidi.Tests/check-nuget-package-published.Tests.ps1

File renamed without changes.

0 commit comments

Comments
 (0)