Skip to content

Commit b6a4819

Browse files
fix: BOM in Invoke-BashHook and remove broken Utils integration from scoop-tests CI
- Fix Invoke-BashHook in commit-msg.Tests.ps1 to write temp file without BOM (was using [System.Text.Encoding]::UTF8 which emits 0xEF 0xBB 0xBF preamble; bash reads BOM as part of first line, causing .Trim() | Should -Be 'Fix bug' to fail on macOS/Linux - this was 2 of the 60+2 failures in the cross-platform job) - Remove bucket/Utils.Tests.ps1 from scoop-tests CI path: those tests mock choco.exe/scoop.ps1 but Utils.ps1 defines wrapper functions that call through to real executables; real Chocolatey on windows-latest runners bypasses the mock, causing all Utils integration tests to fail with real choco output Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 372179a commit b6a4819

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/test-git-hooks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
shell: pwsh
9292
run: |
9393
$config = New-PesterConfiguration
94-
$config.Run.Path = @('bucket/Utils.Tests.ps1', 'bucket/McAfeeUninstall.Tests.ps1')
94+
$config.Run.Path = @('bucket/McAfeeUninstall.Tests.ps1')
9595
$config.Output.Verbosity = 'Detailed'
9696
$config.TestResult.Enabled = $true
9797
$config.TestResult.OutputPath = 'test-results-scoop.xml'

git-hooks/tests/commit-msg.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ Describe 'commit-msg bash hook (end-to-end)' -Skip:($IsWindows -or -not (Get-Com
367367
param([string]$Content)
368368
$tmp = [System.IO.Path]::GetTempFileName()
369369
try {
370-
[System.IO.File]::WriteAllText($tmp, $Content, [System.Text.Encoding]::UTF8)
370+
[System.IO.File]::WriteAllText($tmp, $Content, (New-Object System.Text.UTF8Encoding $false))
371371
& bash $bashHook $tmp 2>&1 | Out-Null
372372
return [System.IO.File]::ReadAllText($tmp)
373373
}

0 commit comments

Comments
 (0)