Skip to content

Commit b953ab1

Browse files
adityapatwardhandaxian-dbw
authored andcommitted
Opencover and Code coverage improvements (#4550)
1 parent 7b8c6e7 commit b953ab1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ $jsonFile = "$outputBaseFolder\CC.json"
143143

144144
try
145145
{
146+
## This is required so we do not keep on merging coverage reports.
147+
if(Test-Path $outputLog)
148+
{
149+
Remove-Item $outputLog -Force -ErrorAction SilentlyContinue
150+
}
151+
146152
$oldErrorActionPreference = $ErrorActionPreference
147153
$ErrorActionPreference = 'Stop'
148154
Write-LogPassThru -Message "Starting downloads."
@@ -264,9 +270,5 @@ finally
264270

265271
## Disable the cleanup till we stabilize.
266272
#Remove-Item -recurse -force -path $outputBaseFolder
267-
268-
## This is required so we do not keep on merging coverage reports.
269-
Remove-Item $outputLog -Force -ErrorAction SilentlyContinue
270-
271273
$ErrorActionPreference = $oldErrorActionPreference
272274
}

test/tools/OpenCover/OpenCover.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ function CreateOpenCoverCmdline($target, $outputLog, $targetArgs)
555555
"-hideskipped:all",
556556
"-mergeoutput",
557557
"-filter:`"+[*]* -[Microsoft.PowerShell.PSReadLine]*`"",
558-
"-targetargs:`"-EncodedCommand $base64targetArgs`""
558+
"-targetargs:`"-NoProfile -EncodedCommand $base64targetArgs`""
559559

560560
$cmdlineAsString = $cmdline -join " "
561561

0 commit comments

Comments
 (0)