Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents 676852a + 894ad4f commit ee008312903cde88e83ba6c3f7bc559345552a82 @gep13 gep13 committed Apr 5, 2016
Showing with 24 additions and 2 deletions.
  1. +2 −2 nuget/psake-contrib.nuspec
  2. +10 −0 teamcity.psm1
  3. +12 −0 tests/teamcity.tests.ps1
@@ -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>
View
@@ -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
}
@@ -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" | `

0 comments on commit ee00831

Please sign in to comment.