ShP
ShP

Reputation: 1143

TFS post build console app self execution with build id as parameter

I have two projects, one is simple console app project and another is test project. And inside of mine console app I'm having functionality to check if tests from test project (based on build id) passes or fails.

I want to execute that console app each time when build is done so I can get status of these tests and do additional stuff with results.

Is that something which can be done with some kind of post-build script on TFS?

Upvotes: 0

Views: 115

Answers (2)

Tingting0929
Tingting0929

Reputation: 4202

It seems that you're using XAML build. If you use XMAL build, there's no environment parameters for BuildId. All the environment variables for XAmL build are listed here: https://msdn.microsoft.com/library/hh850448%28v=vs.120%29.aspx.

As a workaround, you could use TF_BUILD_BUILDURI variable. As you can see, at the end of the buildUrl is the buildId. You could extract the buildID through the buildURL.

Upvotes: 1

Sunil Singhal
Sunil Singhal

Reputation: 603

Configure the TFS Template to specify post build script. Refer to this Microsoft Article

Upvotes: 0

Related Questions