Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
DEKA-1255: Log errors before failing a pipeline (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
romankarnaukh authored Sep 9, 2021
1 parent 11eb53d commit 15e014d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Source/Public/Invoke-DockerTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ function Invoke-DockerTests {
)

$commandResult = Invoke-DockerCommand $structureCommand
if ($TreatTestFailuresAsExceptions) {
Assert-ExitCodeOk $commandResult
}

$testReportPath = Join-Path $absoluteTestReportDir $TestReportName
$testReportExists = Test-Path -Path $testReportPath -PathType Leaf
if ($testReportExists) {
Expand All @@ -79,6 +75,10 @@ function Invoke-DockerTests {
}
if (!$Quiet) {
Write-CommandOuput $($result.TestResult)
Write-CommandOuput $($result.TestResult.Results | where { !$_.Pass } | select Name, @{Label = "Error"; Expression = { $_.Errors -join "`r`n" } })
}
if ($TreatTestFailuresAsExceptions) {
Assert-ExitCodeOk $commandResult
}
return $result
}
2 changes: 1 addition & 1 deletion Test-Source/Invoke-DockerTests.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Describe 'Run docker tests using Google Structure' {

Invoke-DockerTests -ImageName $imageToTest -ConfigPath $configs -Quiet:$false 6> $tempFile

$result = Get-Content $tempFile
$result = Get-Content $tempFile -Raw
Write-Debug "Result: $result"
$result | Should -BeLike "*Pass=0; Fail=1; Total=1*"
}
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stages:
jobs:
- job: Publish
pool:
vmImage: ubuntu-latest
vmImage: ubuntu-18.04

steps:
# Install the prereqs
Expand Down

0 comments on commit 15e014d

Please sign in to comment.