Resolve knowledge-index root to absolute path (cross-platform fix)

Get-ChildItem.FullName is always absolute, so deriving the relative article
path via Substring(\.Length) requires an absolute root. A relative root
such as '.' (used by the CI guard's 'Test-KnowledgeIndex.ps1 -Root .') left the
full path almost intact on Linux, producing bogus 'home/runner/.../knowledge'
paths and failing the coverage check. Normalise both the generator's
-BCQualityRoot and the test's -Root with Resolve-Path before use.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jesper Schulz-Wedde 2026-06-04 15:00:12 +02:00
parent eb462ee1f9
commit 95e84418ed
2 changed files with 8 additions and 0 deletions

View file

@ -27,6 +27,10 @@ param(
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# Normalise to an absolute path so Substring-based relative-path derivation
# below matches the absolute FullName the generator emits (CI passes -Root .).
$Root = (Resolve-Path -LiteralPath $Root).Path
$generator = Join-Path $Root 'tools/Build-KnowledgeIndex.ps1'
if (-not (Test-Path $generator)) { throw "Generator not found: $generator" }