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

Commit c3c3e09

Browse files
Test failure logging
Use exception instead of Write-Error to not hide source. Split test and publish steps out into separate scripts.
1 parent 5c5903f commit c3c3e09

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ install:
2626
- "echo \"GitVersion says: ${GitVersion_Version} \""
2727

2828
script:
29-
- pwsh -c "Invoke-Psake -buildFile Build.ps1 -taskList build,test"
29+
- pwsh -f "./Invoke-Tests.ps1"
3030

3131
deploy:
3232
skip_cleanup: true
3333
provider: script
34-
script: pwsh -c "Invoke-Psake -buildFile Build.ps1 -taskList build,test,publish"
34+
script: pwsh -f "./Invoke-Publish.ps1"
3535
on:
3636
tags: true
3737
branch: master

Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Task Test -depends Build {
7171

7272
if ($TestResult.FailedCount -gt 0) {
7373
$TestResult | Format-List
74-
Write-Error -Message 'One or more tests for the module failed. Failing the build.'
74+
throw 'One or more tests for the module failed. Failing the build.'
7575
}
7676
}
7777

Invoke-Publish.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Invoke-Psake -buildFile Build.ps1 -taskList build,test,publish
2+
exit ( [int]( -not $psake.build_success ) )

Invoke-Tests.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Invoke-Psake -buildFile Build.ps1 -taskList build,test
2+
exit ( [int]( -not $psake.build_success ) )

Tests/Get-CrumbHeader.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Describe 'Get-CrumbHeader method' {
1616

1717
$crumbHeader = Get-CrumbHeader -UserName $user -Password $pass
1818
Assert-MockCalled -CommandName Invoke-RestMethod -Exactly 1
19-
$crumbHeader | Should -BeExactly "requestfield=headerdata"
19+
$crumbHeader | Should -BeExactly "requestfield=headerdata"
2020
}
2121
}
2222

0 commit comments

Comments
 (0)