Skip to content

Resolve code coverage ReportRoot and RepoRoot during configuration validation - #2940

Merged
nohwnd merged 1 commit into
mainfrom
fix-2923-resolve-coverage-paths
Jul 31, 2026
Merged

Resolve code coverage ReportRoot and RepoRoot during configuration validation#2940
nohwnd merged 1 commit into
mainfrom
fix-2923-resolve-coverage-paths

Conversation

@nohwnd

@nohwnd nohwnd commented Jul 31, 2026

Copy link
Copy Markdown
Member

Fix #2923

CodeCoverage.ReportRoot and Run.RepoRoot were resolved to absolute paths too late, so a working-directory change during the run resolved them against the wrong location. Now they are resolved and validated during configuration validation, before any test code runs, following #2921 and #2892.

🤖

…guration validation

CodeCoverage.ReportRoot and Run.RepoRoot were resolved to absolute paths
only in Get-ReportRoot, which runs when the report is written at the very
end of the run. A test can change the current location (Set-Location), so
a relative ReportRoot/RepoRoot resolved then would use whatever directory
the last test left behind (#2921 comment).

Resolve both to absolute in Resolve-CodeCoverageConfiguration, which runs
during plugin setup while the current location still points at the
directory Invoke-Pester was called from, next to the OutputPath resolution
added in #2892. Paths already absolute are unaffected.

🤖
@nohwnd nohwnd added this to the 6.1.0 milestone Jul 31, 2026
@nohwnd
nohwnd enabled auto-merge (squash) July 31, 2026 19:21
@nohwnd
nohwnd merged commit 34cbe4e into main Jul 31, 2026
12 of 13 checks passed
@nohwnd
nohwnd deleted the fix-2923-resolve-coverage-paths branch July 31, 2026 19:58
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.

Finish resolving code coverage

1 participant