{"id":3373,"date":"2006-09-23T00:11:09","date_gmt":"2006-09-23T00:11:09","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/buckh\/2006\/09\/23\/how-to-determine-whether-tests-passed-and-building-a-specific-version\/"},"modified":"2006-09-23T00:11:09","modified_gmt":"2006-09-23T00:11:09","slug":"how-to-determine-whether-tests-passed-and-building-a-specific-version","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/buckh\/how-to-determine-whether-tests-passed-and-building-a-specific-version\/","title":{"rendered":"How to determine whether tests passed and building a specific version"},"content":{"rendered":"<p><a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\">Aaron Hallberg<\/a> has written a couple of posts about Team Build that started with questions from users.&nbsp; The first deals with how to determine, from code, whether tests passed.<\/p>\n<blockquote>\n<p><a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\/archive\/2006\/09\/21\/764951.aspx\">Determining Whether Tests Passed in Team Build<\/a><\/p>\n<p>In a <a href=\"http:\/\/forums.microsoft.com\/MSDN\/ShowPost.aspx?PostID=647070&amp;SiteID=1\">forum post<\/a> a while back, I laid out a method for determining whether tests had passed during a build.&nbsp; More recently, I have linked to this forum post in advising others on similar problems.&nbsp; Unfortunately, as a sharp user pointed out in this same thread, my solution doesn&#8217;t actually work, since it relies on a property that is not accessible in Team Build v1! <\/p>\n<p>So &#8211; to remedy the situation I have written a custom task which can be used to determine whether tests have succeeded or not.&nbsp; This task takes advantage of the <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/microsoft.teamfoundation.build.proxy.buildstore.gettestresultsforbuild.aspx\">GetTestResultsForBuild<\/a>&nbsp;method of the <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/microsoft.teamfoundation.build.proxy.buildstore.aspx\">Microsoft.TeamFoundation.Build.Proxy.BuildStore<\/a>&nbsp;class.<\/p>\n<\/blockquote>\n<p>The second shows you how to build a specific version. <\/p>\n<blockquote>\n<p><a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\/archive\/2006\/09\/19\/762105.aspx\">Building a Specific Version with Team Build<\/a> <\/p>\n<p>Team Build by default gets the <em>latest<\/em> version of your sources (or <em>tip<\/em>) from source control.&nbsp; For the most part, this is probably the behavior you would want and expect.&nbsp; But not always &#8211; you might want to reproduce a particular build that got deleted, for example; or you might want to build your latest changeset without including changes other users might have checked in. <\/p>\n<p>Unfortunately, getting (and therefore <em>building<\/em>) a specific version from source control is not supported out of the box in Team Build version 1&#8230;<\/p>\n<\/blockquote>\n<p>tags: <a href=\"http:\/\/technorati.com\/tag\/tfs\" rel=\"tag\">tfs<\/a>, <a href=\"http:\/\/technorati.com\/tag\/team+foundation+server\" rel=\"tag\">team foundation server<\/a>, <a href=\"http:\/\/technorati.com\/tag\/tfs+api\" rel=\"tag\">tfs api<\/a>, <a href=\"http:\/\/technorati.com\/tag\/team+build\" rel=\"tag\">team build<\/a><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aaron Hallberg has written a couple of posts about Team Build that started with questions from users.&nbsp; The first deals with how to determine, from code, whether tests passed. Determining Whether Tests Passed in Team Build In a forum post a while back, I laid out a method for determining whether tests had passed during [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":10268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[7,8],"class_list":["post-3373","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-team-build","tag-team-foundation"],"acf":[],"blog_post_summary":"<p>Aaron Hallberg has written a couple of posts about Team Build that started with questions from users.&nbsp; The first deals with how to determine, from code, whether tests passed. Determining Whether Tests Passed in Team Build In a forum post a while back, I laid out a method for determining whether tests had passed during [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/3373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/comments?post=3373"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/3373\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media\/10268"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media?parent=3373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/categories?post=3373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/tags?post=3373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}