Viser innlegg med etiketten Team Build. Vis alle innlegg
Viser innlegg med etiketten Team Build. Vis alle innlegg

mandag 7. desember 2009

Changing TFS emails to link to Team System Web Access – Part 2 - Visual Studio Team System (VSTS) Blog - by Neno Loje

Neno Loje stated in Changing TFS emails to link to Team System Web Access – Part 2 - Visual Studio Team System (VSTS) Blog - by Neno Loje that:

"There are four areas to look at:
Work Item notification mails (has already been discussed here)
Build notification mails
Check-in notification mails
Mails sent by Team Explorer (feature of TFS 2008 SP1)
Area 1 is part of a separate blog post, for Area 2 there are currently no equivalent steps (as stated in KB956761)."

I just couldn't live with it so I made it work, like this in BuildCompletionEvent2.xsl:

   1:        <div class="Title">


   2:          <xsl:call-template name="link">


   3:            <xsl:with-param name="format" select="'html'"/>


   4:            <xsl:with-param name="embolden" select="'true'"/>


   5:            <xsl:with-param name="fontSize" select="'larger'"/>


   6:            <xsl:with-param name="link" select="concat(substring-before(Url,':8080/Build/Build.aspx?artifactMonike'),':8090/UI/Pages/Build/Details.aspx?builduri=vstfs%3A%2F%2F%2FBuild%2FBuild%2F',substring-after(Url,'artifactMoniker='))"/>


   7:            <xsl:with-param name="displayText" select="Title"/>


   8:          </xsl:call-template>


   9:        </div>




Where the point of the matter is line 11. The change was inspired by the original post by Neno and a simple fix.



To add even more we even changed it a bit more to include a link to a report over the failing tests for the last 72 hours. I am not showing the report part, but the take-away is the inclusion of the link:



 



   1:  <xsl:if test="StatusCode != 'Succeeded'">


   2:     <tr>


   3:       <td class="PropName">Build Log Location: </td>


   4:       <td class="PropValue">


   5:         <xsl:call-template name="link">


   6:           <xsl:with-param name="format" select="'html'"/>


   7:           <xsl:with-param name="embolden" select="'false'"/>


   8:           <xsl:with-param name="link" select="LogLocation"/>


   9:           <xsl:with-param name="displayText" select="LogLocation"/>


  10:         </xsl:call-template>


  11:       </td>


  12:     </tr>


  13:     <tr>


  14:       <xsl:call-template name="link">


  15:         <xsl:with-param name="format" select="'html'"/>


  16:         <xsl:with-param name="embolden" select="'true'"/>


  17:         <xsl:with-param name="fontSize" select="'larger'"/>


  18:         <xsl:with-param name="link" select="concat(substring-before(Url,':8080/Build/Build.aspx?artifactMonike'),'/ReportServer/Pages/ReportViewer.aspx?/Confirmit/Failed+Tests&rs%3aCommand=Render&BuildParam=',substring-after(Url,'artifactMoniker='))"/>


  19:         <xsl:with-param name="displayText" select="'Report on failing tests in this build'"/>


  20:       </xsl:call-template>


  21:     </tr>


  22:   </xsl:if>




The added code is the lines 13 – 21.



Happy coding

mandag 19. januar 2009

Challenges with TypeMock and Team Build

According to the TypeMock documentation it's a breeze to set up mocking during Team Build. Well I have just spent a week trying to get it to work and I think I finally cracked it. It all comes down to reading the f*** manual and believing it to be taken literally.

 

TypeMock location


The TypeMock manual say the following:
<!-- Use Typemock Isolator MsBuild Extensions -->
<Import Project="C:\Program Files\TypeMock\Typemock Isolator\TypeMock.MSBuild.tasks" />

<!-- Override this target to plugin custom tasks before running tests -->
<Target Name="BeforeTest">
<!-- Start TypeMock -->
<TypeMockStart/>
</Target>

<!-- Override this target to plugin custom tasks after running tests -->
<Target Name="AfterTest">
<!-- Quit TypeMock -->
<TypeMockStop/>
</Target>


Well first of all this isn't quite true. As of 5.1 (I think) TypeMock installs into another directory (C:\Program Files\Typemock\Isolator\5.2 in my case as we just upgraded to 5.2.1).  So you have to perform some trickery in your MSBuild files to detect whether your doing a build server or desktop build. Luckily there are ways to do this.

Anyway, this is not my main point. The main point is that you can get tricked by the way MSBuild is implemented and used during an EndToEndIteration build.

Where does the TypeMockRunner instance live?



What I saw was that my tests were running fine during DesktopBuild but failing miserably during E2EI (yes I ran a desktop build (msbuild TFSBuild.proj /t:test) on the build server and the tests ran fine). So that’s what I've been spending the last week trying to unravel. And here are the results from the Norwegian jury:

You must follow the instructions (above) from the TypeMock doc to the extent that you call TypeMockStart/TypeMockStop from TFSBuild.proj itself.


We have an existing build system (CruiseControl) so I was reusing my Test.proj calling the necessary targets from inside that. THIS WILL NOT WORK IN A TEAM BUILD CONTEXT! You have to call TypeMockStart from the same instance of MSBuild as the one you're running tests from (i.e. calling MSTest/TestToolsTask)!


Consequence: The multiple agents switch (/m) of MSTest is incompatible with TypeMock.


I had to disable building in parallel because of this. It has to be said that the guys at TypeMock are waiting for me to have some available time so we can look into this since this is obviously no more good for them than it is for me. Ay ve! So much to deal with and so little time.

tirsdag 6. januar 2009

Bug in how VS/VSTestHost loads symbols?

I have started running source server on our TFS build box. (blog about that later) and I just noticed a peculiarity in how the symbol files where loaded during a "Debug Checked Deploed Tests".

The two different findings arise when downloading the testresults from a team build.

It seems that when I started with an empty Visual Studio and from there opened the downloaded testrun the "Debug Checked Deployed Tests" handled the source server brialliantly and the debugger broke inside a copy of the versioned item, as expected.

However, when i HAD MY SOLUTION OPEN IN VISUAL STUDIO and the debugger breaks, it claims that there is no source available and the only choice it gave me was to open the dissambly. Now I',m curious so I open the Modules window, and there I see that the loaded pdb files are the correct ones (or so it seems). I open them in Notepad and they look correct.

Now the really strange thing happens when I hit F5. I get breaked at the next failing test and there everthing is ok, I get the downloaded versioned item opened and the debugger breaks at the correct location(?!?). Gotta investigate more on this. For now I will just list it as another mystery.