Skip to content

fix(tests): place v2 Pester tests inside the Hidi test project - #895

Merged
Gavin Barron (gavinbarron) merged 2 commits into
support/v2from
gavinbarron-v2-pester-test-classification
Oct 9, 2026
Merged

Gavin Barron (gavinbarron) merged 2 commits into
support/v2from
gavinbarron-v2-pester-test-classification

Conversation

@gavinbarron

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

Copy link
Copy Markdown
Contributor

Summary

Move test/scripts/check-nuget-package-published.Tests.ps1 unchanged into test/Microsoft.OpenApi.Hidi.Tests/check-nuget-package-published.Tests.ps1, and update the SonarCloud execution path and README invocation/ownership explanation. Remove the earlier ineffective sibling link; the test project now owns the script through default None items. Net PR diff: three files, including a 100% identical-content rename.

SonarScanner 11.3.0 selects physical project ownership, not MSBuild Link metadata. The previous linked-sibling candidate was disproven by full remote evidence (FIL, 76 uncovered lines). This physical relocation replaces it without manual source/test scopes, exclusions, fabricated coverage, or threshold changes.

Accepted #893 ESRPRelease@14 behavior, helper/test bodies, Docker restore, net10.0, package versions, publishing flags, gates, and canonical ancestry remain unchanged.

Head: 4795eb0044ddebddeb1e2b100430666c31dbe43c; target: support/v2.

Verified current-head remote evidence

  • SonarCloud automatic PR run 37971664686 succeeded at the exact head above.
  • Both Sonar component APIs explicitly identify test/Microsoft.OpenApi.Hidi.Tests/check-nuget-package-published.Tests.ps1 as UTS, language powershell. It is present as a test component, not merely missing from production metrics.
  • PR quality gate: OK. The test contributes zero new coverable/uncovered lines. A green gate alone was not used as classification proof.
  • Same-run logs: Pester 24/24; Hidi 91/91; genuine production-helper generic coverage 38/38 lines, 100%, zero uncovered; generic coverage imported for one file.
  • CI/CD run 37971664770 succeeded, including CI, Windows executable, and Docker; deployment skipped.
  • CodeQL run 37971664669 succeeded.

Local ownership and unchanged-file evidence

  • Moved Pester Git blob 0862f728101ec52e6597783ae81675628f2ebfcb exactly matches accepted v2 content; ../../scripts still resolves the same production helper.
  • Actual MSBuild: IsTestProject=true, TargetFramework=net10.0, default physical None ownership without Link.
  • Actual scanner 11.3.0 ProjectInfo identifies Hidi as Test, with Pester in FilesToAnalyze/test module. Generated properties assign Pester only to FD80F7C1-F1E6-45AE-AE6B-08B066757AD5.sonar.tests; helper only to root sonar.sources. Existing C# Services/OpenApiServiceTests.cs retains the same test module.
  • Diagnostic used begin/build/property generation only, with no scanner end, engine, or upload. Scoped scanner data was archived outside the worktree.
  • Local Hidi 91/91, measured production OpenCover coverage 88.21%; Pester 24/24 and genuine helper 38/38 coverage.
  • Scope distinction: unchanged helper/C# files are omitted from the PR-scoped component API. Separately, the existing support/v2 branch analysis reports helper FIL, total coverage 100%, 38 lines to cover, zero uncovered, and C# OpenApiServiceTests.cs as UTS. These branch totals are baseline evidence, not misrepresented as current PR-head metrics; current-head measured helper coverage is established by this PR's scanner-run logs above.

Review and release boundaries

Ready for normal review; all current-head checks passed and the draft hold was removed after the explicit test-classification proof. Required codeowner approval remains outstanding. No merge or auto-merge requested. No additional analysis dispatch, production publishing, authorization changes, or local analysis upload occurred. Existing official release authorization remains an external gate; no signed-artifact or production-readiness claim is made.

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
@gavinbarron
Gavin Barron (gavinbarron) requested a review from a team as a code owner October 9, 2026 17:49
@gavinbarron
Gavin Barron (gavinbarron) marked this pull request as draft October 9, 2026 18:02
@gavinbarron Gavin Barron (gavinbarron) changed the title fix(tests): classify v2 NuGet helper Pester tests fix(tests): link v2 NuGet helper Pester test metadata Oct 9, 2026
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
@gavinbarron Gavin Barron (gavinbarron) changed the title fix(tests): link v2 NuGet helper Pester test metadata fix(tests): place v2 Pester tests inside the Hidi test project Oct 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@gavinbarron
Gavin Barron (gavinbarron) marked this pull request as ready for review October 9, 2026 18:33
@gavinbarron
Gavin Barron (gavinbarron) merged commit 3aae8d6 into support/v2 Oct 9, 2026
44 checks passed
@gavinbarron
Gavin Barron (gavinbarron) deleted the gavinbarron-v2-pester-test-classification branch October 9, 2026 22:26
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