Skip to content

Commit 3ffd998

Browse files
adityapatwardhanTravisEz13
authored andcommitted
Create codecoverage and test packages for non-windows (#9373)
Refactor the `ci.psm1` to publish the code coverage and test packages. Allow `CodeCoverage` configuration on non-windows. ## PR Context We plan to run code coverage on Windows, Linux and macOS. These changes are needed to unblock those runs.
1 parent cee1e54 commit 3ffd998

5 files changed

Lines changed: 19 additions & 18 deletions

File tree

.vsts-ci/linux.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,11 @@ jobs:
8484
parameters:
8585
pool: Hosted Ubuntu 1604
8686
dependsOn: linux_build
87+
88+
- job: CodeCovTestPackage
89+
displayName: CodeCoverage and Test Packages
90+
steps:
91+
- powershell: |
92+
Import-Module .\tools\ci.psm1
93+
New-CodeCoverageAndTestPackage
94+
displayName: CodeCoverage and Test Package

.vsts-ci/mac.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,11 @@ jobs:
7878
parameters:
7979
pool: 'Hosted macOS'
8080
dependsOn: mac_build
81+
82+
- job: CodeCovTestPackage
83+
displayName: CodeCoverage and Test Packages
84+
steps:
85+
- powershell: |
86+
Import-Module .\tools\ci.psm1
87+
New-CodeCoverageAndTestPackage
88+
displayName: CodeCoverage and Test Package

.vsts-ci/templates/windows-packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
3030
- powershell: |
3131
Import-Module .\tools\ci.psm1
32-
Invoke-CIAfterTest
32+
New-CodeCoverageAndTestPackage
3333
Invoke-CIFinish -NuGetKey $(NUGET_KEY)
3434
displayName: Build and Test Package

build.psm1

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -651,19 +651,10 @@ function New-PSOptions {
651651
# Add .NET CLI tools to PATH
652652
Find-Dotnet
653653

654-
$ConfigWarningMsg = "The passed-in Configuration value '{0}' is not supported on '{1}'. Use '{2}' instead."
655654
if (-not $Configuration) {
656655
$Configuration = 'Debug'
657-
} else {
658-
switch ($Configuration) {
659-
"CodeCoverage" {
660-
if(-not $Environment.IsWindows) {
661-
$Configuration = "Debug"
662-
Write-Warning ($ConfigWarningMsg -f $switch.Current, $Environment.LinuxInfo.PRETTY_NAME, $Configuration)
663-
}
664-
}
665-
}
666656
}
657+
667658
Write-Verbose "Using configuration '$Configuration'"
668659

669660
if (-not $Runtime) {

tools/ci.psm1

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ function Invoke-CITest
332332
Set-BuildVariable -Name TestPassed -Value True
333333
}
334334

335-
# Implement CI 'after_test' phase
336-
function Invoke-CIAfterTest
335+
function New-CodeCoverageAndTestPackage
337336
{
338337
[CmdletBinding()]
339338
param()
@@ -742,9 +741,4 @@ function New-LinuxPackage
742741
$armPackage = Start-PSPackage @packageParams -Type tar-arm -SkipReleaseChecks
743742
Copy-Item $armPackage -Destination "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" -Force
744743
}
745-
746-
if ($isFullBuild)
747-
{
748-
New-TestPackage -Destination "${env:SYSTEM_ARTIFACTSDIRECTORY}"
749-
}
750744
}

0 commit comments

Comments
 (0)