Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Apr 5, 2016
2 parents 676852a + 894ad4f commit ee00831
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nuget/psake-contrib.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>psake-contrib</id>
<version>1.1.0</version>
<authors>James Kovacs,James Crowley,Rafal Klys,Artur Dorochowicz,Scott Banwart,Ales Roubicek,C-J Berg,Pepa Stefan</authors>
<version>1.2.0</version>
<authors>James Kovacs,James Crowley,Rafal Klys,Artur Dorochowicz,Scott Banwart,Ales Roubicek,C-J Berg,Pepa Stefan,Gary Ewan Park</authors>
<projectUrl>https://github.com/psake/psake-contrib</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>psake-contrib is a repository for scripts, modules and functions that are useful for running a build with psake.</description>
Expand Down
10 changes: 10 additions & 0 deletions teamcity.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ function TeamCity-ReportBuildStatus([string]$status=$null, [string]$text='') {
TeamCity-WriteServiceMessage 'buildStatus' $messageAttributes
}

function TeamCity-ReportBuildProblem([string]$description, [string]$identity=$null) {
$messageAttributes = @{ description=$description }

if (![string]::IsNullOrEmpty($identity)) {
$messageAttributes.identity=$identity
}

TeamCity-WriteServiceMessage 'buildProblem' $messageAttributes
}

function TeamCity-SetBuildNumber([string]$buildNumber) {
TeamCity-WriteServiceMessage 'buildNumber' $buildNumber
}
Expand Down
12 changes: 12 additions & 0 deletions tests/teamcity.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ Describe "TeamCity-ReportBuildStatus" {
}
}

Describe "TeamCity-ReportBuildProblem" {
It "Writes ##teamcity[buildProblem description='A problem occured.' identity='SOME_IDENTITY']" {
TeamCity-ReportBuildProblem "A problem occured." "SOME_IDENTITY" | `
Should BeExactly "##teamcity[buildProblem description='A problem occured.' identity='SOME_IDENTITY']"
}

It "Writes ##teamcity[buildStatus text='A problem occured.'] without optional identity attribute." {
TeamCity-ReportBuildStatus -text "A problem occured." | `
Should BeExactly "##teamcity[buildStatus text='A problem occured.']"
}
}

Describe "TeamCity-SetBuildNumber" {
It "Writes ##teamcity[buildNumber '1.2.3_{build.number}-ent']" {
TeamCity-SetBuildNumber "1.2.3_{build.number}-ent" | `
Expand Down

0 comments on commit ee00831

Please sign in to comment.