Skip to content

Commit c0b7b1a

Browse files
committed
github action workflow adjustment
1 parent afea526 commit c0b7b1a

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/pester-tests.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,42 @@ jobs:
3030
- name: Run Pester Tests
3131
shell: pwsh
3232
run: |
33-
# Import the module
34-
Import-Module ./src/PSBlogger.psd1 -Force
33+
# Debug: Show current directory and files
34+
Write-Host "Current directory: $(Get-Location)"
35+
Write-Host "Directory structure:"
36+
Get-ChildItem -Path . -Recurse | Select-Object FullName, PSIsContainer
37+
38+
# Change to src directory to match test expectations
39+
Set-Location "./src"
40+
Write-Host "Changed to src directory: $(Get-Location)"
3541
3642
# Configure Pester
3743
$PesterConfig = @{
3844
Run = @{
39-
Path = './src/tests'
45+
Path = './tests'
4046
}
4147
Output = @{
4248
Verbosity = 'Detailed'
4349
}
4450
TestResult = @{
4551
Enabled = $true
46-
OutputPath = 'TestResults.xml'
52+
OutputPath = '../TestResults.xml'
4753
OutputFormat = 'NUnitXml'
4854
}
4955
CodeCoverage = @{
5056
Enabled = $true
51-
Path = './src/*.ps*1'
52-
OutputPath = 'coverage.xml'
57+
Path = './*.ps*1'
58+
OutputPath = '../coverage.xml'
5359
OutputFormat = 'JaCoCo'
5460
}
5561
}
5662
5763
# Run tests
5864
$Results = Invoke-Pester -Configuration $PesterConfig
5965
66+
# Change back to root directory
67+
Set-Location ".."
68+
6069
# Exit with error code if tests failed
6170
if ($Results.FailedCount -gt 0) {
6271
Write-Error "Tests failed: $($Results.FailedCount) failed out of $($Results.TotalCount) total tests"

0 commit comments

Comments
 (0)