8000 Fix travis-ci script so that PRs can fail due to pester tests (#4807) · PowerShell/PowerShell@fb60c47 · GitHub
[go: up one dir, main page]

Skip to content

Commit fb60c47

Browse files
authored
Fix travis-ci script so that PRs can fail due to pester tests (#4807)
1 parent ad0b4cc commit fb60c47

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

tools/travis.ps1

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ else
175175

176176
$pesterPassThruObject = Start-PSPester @pesterParam
177177

178+
# Determine whether the build passed
179+
try {
180+
# this throws if there was an error
181+
Test-PSPesterResults -ResultObject $pesterPassThruObject
182+
$result = "PASS"
183+
}
184+
catch {
185+
$resultError = $_
186+
$result = "FAIL"
187+
}
188+
178189
if (-not $isPr) {
179190
# Run 'CrossGen' for push commit, so that we can generate package.
180191
# It won't rebuild powershell, but only CrossGen the already built assemblies.
@@ -203,16 +214,6 @@ else
203214
}
204215
}
205216

206-
# Determine whether the build passed
207-
try {
208-
# this throws if there was an error
209-
Test-PSPesterResults -ResultObject $pesterPassThruObject
210-
$result = "PASS"
211-
}
212-
catch {
213-
$resultError = $_
214-
$result = "FAIL"
215-
}
216217
# update the badge if you've done a cron build, these are not fatal issues
217218
if ( $cronBuild ) {
218219
try {
@@ -229,10 +230,11 @@ else
229230
Write-Warning "Could not update status badge: $_"
230231
}
231232
}
232-
# if the tests did not pass, throw the reason why
233-
if ( $result -eq "FAIL" ) {
234-
Throw $resultError
235-
}
233+
}
234+
235+
# if the tests did not pass, throw the reason why
236+
if ( $result -eq "FAIL" ) {
237+
Throw $resultError
236238
}
237239

238240
Start-PSxUnit

0 commit comments

Comments
 (0)
0