Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Commit e914930

Browse files
committed
updated psake script to remove code coverage due to causing CI timeouts
1 parent 2fc978c commit e914930

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ phases:
4444
artifactName: BuildOutput
4545
downloadPath: '$(Build.SourcesDirectory)'
4646

47-
- powershell: |
48-
$env:Coveralls = '$(Coveralls)'
49-
. ./build.ps1 -Task PesterOnly
47+
- powershell: . ./build.ps1 -Task PesterOnly
5048
displayName: Test Module
5149

5250
- task: PublishTestResults@2

psake.ps1

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ task Init {
4141
" Installing the latest version of Pester"
4242
Install-Module -Name Pester -Repository PSGallery -Scope CurrentUser -AllowClobber -SkipPublisherCheck -Confirm:$false -ErrorAction Stop -Force -Verbose:$false
4343
Import-Module -Name Pester -Verbose:$false -Force
44-
" Installing the latest version of PSScriptAnalyzer"
45-
Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Scope CurrentUser -AllowClobber -SkipPublisherCheck -Confirm:$false -ErrorAction Stop -Force -Verbose:$false
46-
Import-Module -Name PSScriptAnalyzer -Verbose:$false -Force
47-
if ($env:BHBuildSystem -eq 'VSTS' -and $PSVersionTable.PSVersion.Major -lt 6) {
48-
" Installing the latest version of Coveralls"
49-
Install-Module Coveralls -Repository PSGallery -Scope CurrentUser -ErrorAction Stop -Force -Confirm:$false -Verbose:$false
50-
Import-Module Coveralls -Force -Verbose:$false
51-
}
5244
if ($env:BHProjectName -cne $moduleName) {
5345
$env:BHProjectName = $moduleName
5446
}
@@ -235,22 +227,6 @@ $pesterScriptBlock = {
235227
PassThru = $true
236228
Path = $tests
237229
}
238-
if ($ENV:BHBuildSystem -eq 'VSTS' -and $PSVersionTable.PSVersion.Major -lt 6 -and $null -ne $env:Coveralls) {
239-
' Building list of functions to include for Code Coverage...'
240-
$coveredFunctions = @()
241-
"$($env:BHPSModulePath)\Public\Condition Functions\*","$($env:BHPSModulePath)\Public\Intrinsic Functions\*","$($env:BHPSModulePath)\Public\Primary Functions\*","$($env:BHPSModulePath)\Public\Transform\*","$($env:BHPSModulePath)\Public\*-Vaporshell.ps1" | Foreach-Object {
242-
foreach ($item in (Get-Item $_)) {
243-
$coveredFunctions += @{
244-
Path = (Join-Path $outputModVerDir "$($env:BHProjectName).psm1")
245-
Function = $item.BaseName
246-
}
247-
}
248-
}
249-
' Including CodeCoverage report'
250-
# Commented out due to extra time this takes when running against the compiled module
251-
### $pesterParams['CodeCoverage'] = $coveredFunctions
252-
$pesterParams['CodeCoverage'] = (Join-Path $outputModVerDir "$($env:BHProjectName).psm1")
253-
}
254230
if ($global:ExcludeTag) {
255231
$pesterParams['ExcludeTag'] = $global:ExcludeTag
256232
" Invoking Pester and excluding tag(s) [$($global:ExcludeTag -join ', ')]..."
@@ -260,12 +236,6 @@ $pesterScriptBlock = {
260236
}
261237
$testResults = Invoke-Pester @pesterParams
262238
' Pester invocation complete!'
263-
if ($ENV:BHBuildSystem -eq 'VSTS' -and $PSVersionTable.PSVersion.Major -lt 6 -and $null -ne $env:Coveralls -and $pesterParams.Keys -contains 'CodeCoverage') {
264-
' Formatting test results into a Coveralls coverage report...'
265-
$coverage = Format-Coverage -PesterResults $TestResults -CoverallsApiToken $env:Coveralls -BranchName $env:BHBranchName -Verbose
266-
' Uploading coverage report to Coveralls...'
267-
Publish-Coverage -Coverage $coverage -Verbose
268-
}
269239
if ($testResults.FailedCount -gt 0) {
270240
$testResults | Format-List
271241
Write-Error -Message 'One or more Pester tests failed. Build cannot continue!'
@@ -298,7 +268,7 @@ task Analyze -Depends Pester {
298268
}
299269
} -description 'Run PSScriptAnalyzer'
300270

301-
Task Deploy -Depends Import {
271+
Task Deploy -Depends Init {
302272
function Publish-GitHubRelease {
303273
<#
304274
.SYNOPSIS

0 commit comments

Comments
 (0)