Skip to content

Commit ee00831

Browse files
committed
Merge branch 'develop'
2 parents 676852a + 894ad4f commit ee00831

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

nuget/psake-contrib.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>psake-contrib</id>
5-
<version>1.1.0</version>
6-
<authors>James Kovacs,James Crowley,Rafal Klys,Artur Dorochowicz,Scott Banwart,Ales Roubicek,C-J Berg,Pepa Stefan</authors>
5+
<version>1.2.0</version>
6+
<authors>James Kovacs,James Crowley,Rafal Klys,Artur Dorochowicz,Scott Banwart,Ales Roubicek,C-J Berg,Pepa Stefan,Gary Ewan Park</authors>
77
<projectUrl>https://github.com/psake/psake-contrib</projectUrl>
88
<requireLicenseAcceptance>false</requireLicenseAcceptance>
99
<description>psake-contrib is a repository for scripts, modules and functions that are useful for running a build with psake.</description>

teamcity.psm1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ function TeamCity-ReportBuildStatus([string]$status=$null, [string]$text='') {
146146
TeamCity-WriteServiceMessage 'buildStatus' $messageAttributes
147147
}
148148

149+
function TeamCity-ReportBuildProblem([string]$description, [string]$identity=$null) {
150+
$messageAttributes = @{ description=$description }
151+
152+
if (![string]::IsNullOrEmpty($identity)) {
153+
$messageAttributes.identity=$identity
154+
}
155+
156+
TeamCity-WriteServiceMessage 'buildProblem' $messageAttributes
157+
}
158+
149159
function TeamCity-SetBuildNumber([string]$buildNumber) {
150160
TeamCity-WriteServiceMessage 'buildNumber' $buildNumber
151161
}

tests/teamcity.tests.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,18 @@ Describe "TeamCity-ReportBuildStatus" {
218218
}
219219
}
220220

221+
Describe "TeamCity-ReportBuildProblem" {
222+
It "Writes ##teamcity[buildProblem description='A problem occured.' identity='SOME_IDENTITY']" {
223+
TeamCity-ReportBuildProblem "A problem occured." "SOME_IDENTITY" | `
224+
Should BeExactly "##teamcity[buildProblem description='A problem occured.' identity='SOME_IDENTITY']"
225+
}
226+
227+
It "Writes ##teamcity[buildStatus text='A problem occured.'] without optional identity attribute." {
228+
TeamCity-ReportBuildStatus -text "A problem occured." | `
229+
Should BeExactly "##teamcity[buildStatus text='A problem occured.']"
230+
}
231+
}
232+
221233
Describe "TeamCity-SetBuildNumber" {
222234
It "Writes ##teamcity[buildNumber '1.2.3_{build.number}-ent']" {
223235
TeamCity-SetBuildNumber "1.2.3_{build.number}-ent" | `

0 commit comments

Comments
 (0)