Use UTF-8 without a BOM for win coverage (#66510)
This commit is contained in:
parent
3bcb664497
commit
e459eac565
2 changed files with 5 additions and 1 deletions
2
changelogs/fragments/win-coverage-out-encoding.yaml
Normal file
2
changelogs/fragments/win-coverage-out-encoding.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- ansible-test windows coverage - Ensure coverage reports are UTF-8 encoded without a BOM
|
|
@ -176,7 +176,9 @@ try {
|
|||
$code_cov_json = ConvertTo-Json -InputObject $coverage_info -Compress
|
||||
|
||||
Write-AnsibleLog "INFO - Outputting coverage json to '$coverage_output_path'" "coverage_wrapper"
|
||||
Set-Content -LiteralPath $coverage_output_path -Value $code_cov_json -Encoding $file_encoding
|
||||
# Ansible controller expects these files to be UTF-8 without a BOM, use .NET for this.
|
||||
$utf8_no_bom = New-Object -TypeName System.Text.UTF8Encoding -ArgumentList $false
|
||||
[System.IO.File]::WriteAllbytes($coverage_output_path, $utf8_no_bom.GetBytes($code_cov_json))
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue