Skip to content

fix(hidi): place Pester test inside its physical test project - #896

Merged
Gavin Barron (gavinbarron) merged 1 commit into
mainfrom
gavinbarron-hidi-pester-ownership-correction
Oct 9, 2026
Merged

Gavin Barron (gavinbarron) merged 1 commit into
mainfrom
gavinbarron-hidi-pester-ownership-correction

Conversation

@gavinbarron

@gavinbarron Gavin Barron (gavinbarron) commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Move the unchanged NuGet helper Pester suite from test/scripts/check-nuget-package-published.Tests.ps1 to test/Microsoft.OpenApi.Hidi.Tests/check-nuget-package-published.Tests.ps1.
  • Remove the ineffective explicit None Include / virtual Link; SDK default None items now discover the physically contained test.
  • Update the Sonar workflow's Pester Run.Path and the documented invocation.

The virtual-link fix merged in #894 did not establish ownership: SonarScanner 11.3.0 requires physical containment when assigning additional files to their closest project. The old sibling path became root source code despite the Hidi project being classified as Test. Both locations have the same directory depth, so the test's existing ../../scripts helper reference is unchanged.

Validation

  • Pester file is a 100% rename with identical Git blob 48aa0325414e6a58ce15373e1538b2ec4115ae89; no body/assertion edits.
  • Actual unchanged workflow Pester coverage step: 24 passed; 38/38 helper lines covered; 0 uncovered. Generic coverage converter and import unchanged.
  • Actual Hidi MTP/OpenCover: 107 passed. Existing OData VSTest/OpenCover: 1,279 passed. Solution build succeeds.
  • Exact installed scanner 11.3.0 anonymous begin/build plus offline GenerateResult only: actual ProjectInfo.xml reports Hidi Test, FilesToAnalyze contains Pester, generated properties assign Pester only to 521CDCFF-1E62-4396-9266-7CAA99205969.sonar.tests (lines 510-511), not root sonar.sources. Helper remains only root sonar.sources (line 15); all 10 Hidi and 116 OData C# test files remain module tests.
  • No local scanner end, analysis-engine execution, or upload.

Actual PR-head Sonar evidence

PR-triggered Sonar run 37971809195 succeeded at head 20ca498d58cb10673ec34901b1d6cc19c612c6cb. Sonar's PR API reports that same commit and the relocated PowerShell Pester component as UTS, with no coverage measures; no matching Pester source component remains. Quality gate: OK. The real scanner log lists Pester under Hidi module Test paths and explicitly ignores its duplication because it is a test file. This is substantive ownership proof, not just a metadata-only green check.

That same remote run passed 24 Pester / 107 Hidi / 1,279 OData tests, measured 38/38 helper lines, and imported generic coverage for 1 file. PR changed-file analysis omits the unchanged helper from its component tree; exact PR helper component/measure requests return 404, as expected. Separately, prior full scan 37968835374 at 5ab3d0629ff60fcebacf069985869b98b79b5ab4 proves the helper FIL, 100% coverage, 38 eligible, 0 uncovered. Its helper blob fea22f1c2f89ac949f1fc62d95d04a751ecd5dc3 is identical at this PR head. Those prior-full-scan metrics are not presented as PR-head API metrics. Combined with actual PR UTS, exact-head test/coverage logs and actual offline root-source assignment, classification proof is complete; no additional full scan is needed. No workflow_dispatch or source changes were used to force unchanged-helper metrics into the PR view.

Review readiness and scope

All PR checks are green, including CodeQL, ADO, Sonar, CI, Hidi Docker and Windows executable checks. Normal review approval is still required; no auto-merge or admin merge.

No coverage fabrication, exclusions, threshold changes, manual source/test properties, scanner workflow diagnostics, runtime/helper/publisher changes, or release-please changes. Existing ESRP, Docker authentication, signing/version/public-only settings and disabled publishers are preserved. Normal PR targeting main.

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
@gavinbarron
Gavin Barron (gavinbarron) requested a review from a team as a code owner October 9, 2026 18:13
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

Comment thread .github/workflows/sonarcloud.yml
@gavinbarron
Gavin Barron (gavinbarron) merged commit cb766cb into main Oct 9, 2026
45 checks passed
@gavinbarron
Gavin Barron (gavinbarron) deleted the gavinbarron-hidi-pester-ownership-correction branch October 9, 2026 22:28
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