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.
This commit is contained in:
Aditya Patwardhan
2019-05-13 14:51:32 -07:00
committed by Travis Plunk
parent cf9d6b5dd5
commit 7929074e2e
5 changed files with 19 additions and 18 deletions
+8
View File
@@ -79,3 +79,11 @@ jobs:
parameters:
pool: Hosted Ubuntu 1604
dependsOn: linux_build
- job: CodeCovTestPackage
displayName: CodeCoverage and Test Packages
steps:
- powershell: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
displayName: CodeCoverage and Test Package
+8
View File
@@ -73,3 +73,11 @@ jobs:
parameters:
pool: 'Hosted macOS'
dependsOn: mac_build
- job: CodeCovTestPackage
displayName: CodeCoverage and Test Packages
steps:
- powershell: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
displayName: CodeCoverage and Test Package
+1 -1
View File
@@ -27,6 +27,6 @@ jobs:
- powershell: |
Import-Module .\tools\ci.psm1
Invoke-CIAfterTest
New-CodeCoverageAndTestPackage
Invoke-CIFinish -NuGetKey $(NUGET_KEY)
displayName: Build and Test Package
+1 -10
View File
@@ -638,19 +638,10 @@ function New-PSOptions {
# Add .NET CLI tools to PATH
Find-Dotnet
$ConfigWarningMsg = "The passed-in Configuration value '{0}' is not supported on '{1}'. Use '{2}' instead."
if (-not $Configuration) {
$Configuration = 'Debug'
} else {
switch ($Configuration) {
"CodeCoverage" {
if(-not $Environment.IsWindows) {
$Configuration = "Debug"
Write-Warning ($ConfigWarningMsg -f $switch.Current, $Environment.LinuxInfo.PRETTY_NAME, $Configuration)
}
}
}
}
Write-Verbose "Using configuration '$Configuration'"
$PowerShellDir = if (!$Environment.IsWindows) {
+1 -7
View File
@@ -332,8 +332,7 @@ function Invoke-CITest
Set-BuildVariable -Name TestPassed -Value True
}
# Implement CI 'after_test' phase
function Invoke-CIAfterTest
function New-CodeCoverageAndTestPackage
{
[CmdletBinding()]
param()
@@ -745,9 +744,4 @@ function New-LinuxPackage
$armPackage = Start-PSPackage @packageParams -Type tar-arm -SkipReleaseChecks
Copy-Item $armPackage -Destination "${env:BUILD_ARTIFACTSTAGINGDIRECTORY}" -Force
}
if ($isFullBuild)
{
New-TestPackage -Destination "${env:SYSTEM_ARTIFACTSDIRECTORY}"
}
}