Skip to content

fix(hidi): classify linked Pester file as test code - #894

Merged
Vincent Biret (baywet) merged 1 commit into
mainfrom
gavinbarron-pester-test-classification
Oct 9, 2026
Merged

Vincent Biret (baywet) merged 1 commit into
mainfrom
gavinbarron-pester-test-classification

Conversation

@gavinbarron

Copy link
Copy Markdown
Contributor

Summary

Link the existing test/scripts/check-nuget-package-published.Tests.ps1 as a None item in the existing Hidi test project. This gives SonarScanner for .NET test-project ownership of the Pester suite rather than treating the standalone PowerShell test file as production code.

This is a one-file, one-line corrective follow-up to accepted #891. No runtime code, test bodies, package versions, ESRP publisher settings, workflows, coverage exclusions, quality gates, or coverage reports are changed. Both the real Pester suite and production helper remain in analysis.

Validation

  • MSBuild evaluates the linked None item to the existing test file with Link=Scripts\check-nuget-package-published.Tests.ps1. IsTestProject is blank; classification proof must come from the scanner, not this property.
  • Hidi build succeeded and all 107 Hidi tests passed.
  • Executing the unchanged Sonar workflow's Pester step passed all 24 cases and produced measured production-only helper coverage of 38/38 lines (100%).
  • git diff --check passed; exactly one project file changed.

Remote acceptance requires the Pester component to remain indexed as UTS, the production helper to remain FIL with 38 eligible lines and 100% coverage, and the existing quality gate to pass. Those checks are pending the PR-head analysis; no automatic merge is enabled.

Link the existing Pester suite from the Hidi test project so SonarScanner for .NET can assign its test-project classification without excluding either the tests or production helper.

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

Copilot-Session: 6f806d4e-2512-469d-b4ba-ccccda859f7f
@gavinbarron
Gavin Barron (gavinbarron) requested a review from a team as a code owner October 9, 2026 17:35
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@baywet
Vincent Biret (baywet) merged commit d0385b8 into main Oct 9, 2026
45 of 47 checks passed
@baywet
Vincent Biret (baywet) deleted the gavinbarron-pester-test-classification branch October 9, 2026 17:50
@gavinbarron

Copy link
Copy Markdown
Contributor Author

Follow-up validation found that the linked None item did not fix PowerShell test classification. Full Sonar analysis run https://github.com/microsoft/OpenAPI.NET.OData/actions/runs/37968835374 analyzed exact commit 5ab3d06 on the default Sonar branch: test/scripts/check-nuget-package-published.Tests.ps1 remains FIL with 76 lines to cover, all 76 uncovered. The production helper remains FIL with 100% coverage (38 lines, zero uncovered), and existing C# tests remain UTS. The PR quality gate had no new-coverage condition because this was a project-metadata-only change; its pass did not establish correct classification. The default-branch gate fails new coverage (38.9% versus 80%). No thresholds, exclusions, or publishing settings were changed. The v2 equivalent in #895 is being held while scanner ownership handling is diagnosed.

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