Skip to content

Commit 4c931a4

Browse files
committed
CI: make powershell test runner less fragile
Discover the repository root relative to the script itself which will make it possible to run the tests places other than concourse.
1 parent f0c3a39 commit 4c931a4

File tree

1 file changed

+3
-1
lines changed
  • ci/tasks/test-units-bosh-psmodules

1 file changed

+3
-1
lines changed

ci/tasks/test-units-bosh-psmodules/run.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ $startupType = Get-Service "wuauserv" | Select-Object -ExpandProperty StartType
1515

1616
$result = 0
1717

18-
$testModules = Get-ChildItem "./stemcell-builder/$env:MODULES_DIR" -recurse | where {$_.name -match ".*.Tests.ps1"} | foreach {$_.DirectoryName}
18+
$repoRoot = "$PSScriptRoot\..\..\..\"
19+
20+
$testModules = Get-ChildItem "$repoRoot\$env:MODULES_DIR" -recurse | where {$_.name -match ".*.Tests.ps1"} | foreach {$_.DirectoryName}
1921
foreach ($module in $testModules) {
2022
Write-Host "Testing: $module"
2123
Push-Location "$module"

0 commit comments

Comments
 (0)