<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Nothing geeky...</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bhuvaneshwari/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:17:35 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>vstest.console.exe - CommandLine Test Runner</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/vstest-console-exe-commandline-test-runner</link>
      <pubDate>Fri, 15 Jun 2012 14:51:59 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2012/06/15/vstest-console-exe-commandline-test-runner/</guid>
      <description><![CDATA[As we know, the unit testing tools has been completely revamped in Visual Studio 2011. One such...]]></description>
      <content:encoded><![CDATA[<p>As we know, the <a href="http://Visual studio 11 Beta unit test framework">unit testing tools</a> has been completely revamped in Visual Studio 2011. One such component is the new command line runner – vstest.console.exe</p>  <p><strong>What is it ?</strong></p>  <p>new command line test runner “vstest,console.exe” which would run tests written against any test framework – MSTest framework, Nunit, Xunit and so on.</p>  <p><strong>Where can I find it ?</strong></p>  <p>vstest.console.exe could be invoked from directly from “Visual Studio Command Prompt”. The executable would be found under “Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow” folder. Vstest.console.exe /? would give more details on the various switches provided by the test runner.</p>  <p><strong>How is it different from Mstest.exe ?</strong></p>  <p>With Visual Studio 2011, the tests written using visual studio unit test framework could be run using either vstest,console.exe or using mstest.exe. The behavior would be same with subtle differences (which is briefed in the below table).</p>  <p>vstest.console.exe has some additional options /platform /framework which would let the user to run their tests in a specific platform/framework to increase test coverage.</p>  <p><strong>Mstest and Vstest:</strong></p>  <p>Below is a brief summary on the various switches provided by Mstest.exe and the equivalent switches in vstest.console.exe</p>  <p>&#160;</p> <font style="font-size: 12pt;"></font>  <div style="list-style-type: disc; direction: ltr;"><font style="font-size: 12pt;"></font>    <table style="border: 1pt solid rgb(163, 163, 163); border-collapse: collapse; direction: ltr;" border="1" cellspacing="0" cellpadding="0" width="280" valign="top"><font size="1" face="Times New Roman"></font><tbody><font size="1" face="Times New Roman"></font>        <tr><font size="1" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="1" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><strong>Mstest</strong></font></p>         </td>         <font size="2" face="Times New Roman"><strong></strong></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"><strong></strong></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><strong>Vstest.console</strong></font></p>         </td>         <font size="2" face="Times New Roman"><strong></strong></font><font size="2" face="Times New Roman"><strong></strong></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"><strong></strong></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><strong>Example</strong></font></p>         </td>       </tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/testcontainer</font></p>         </td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&#160;</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">There is no switch needed in front of the input test assembly in vstest.console.exe unlike mstest.exe.</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest /testcontainer :abc.dll /testcontainer:xyz.dll</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll xyz.dll</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/minpriority, </font></p>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/maxpriority,</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/category</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/testcasefilter</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Inv stest.console.exe /testcasefilter switch handles filtering based on all categories like priority , test category and so on.</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest /testcontainer:abc.dll /minpriority:1 </font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstestabc.dll /testcasefilter:&quot;Priority=1<span style="background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: yellow;"> | priority=2</span>&quot;</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/testmetadata</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/testlist</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">N/A</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">VSMDI file is deprecated in Visual Studio 2011 and there is no equivalent switch for this.</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/testsettings</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/runconfig</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/settings</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe accepts the run settings in two formats:</font></p>           <font size="2" face="Times New Roman"></font>            <ol style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; unicode-bidi: embed; direction: ltr;" type="1"><font size="2" face="Times New Roman"></font>              <li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;" value="value"><span><font size="2" face="Times New Roman">.runsettings file which is the new settings format. .runsettings file can be used as configuration file for all test frameworks like Nunit, Vs unit, xunit and so on.</font></span></li>             <font size="2" face="Times New Roman"></font></ol>           <font size="2" face="Times New Roman"></font>            <ol style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; unicode-bidi: embed; direction: ltr;" type="1"><font size="2" face="Times New Roman"></font>              <li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;" value="value"><span><font size="2" face="Times New Roman">.testsettings file which was present in Visual Studio 2010 and is specific to Visual studio unit test framework.</font></span></li>             <font size="2" face="Times New Roman"></font></ol>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest.exe /testcontainer:abc.dll /testsettings:nightly.testsettings</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll /settings:nightly.testsettings</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/resultsfile</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/settings</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">If the default location of results need to be overriden user need to pass this value using a runsettings file.</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest.exe /testcontainer:abc.dll /results:C:\Results.trx</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll /settings:output.runsettings where the context of the .runsettings file would be something like below :</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&lt;RunSettings&gt;</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&lt;RunConfiguration&gt;</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&lt;ResultsDirectory&gt;c:\&lt;/ResultsDirectory&gt;</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&lt;/RunConfiguration&gt;</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&lt;/RunSettings&gt;</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/test</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/tests</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest.exe /testcontainer:abc.dll /test:API</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll /tests:API</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/noisolation</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&#160;</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">In Visual Studio 2011, the command line runner runs tests in no isolation mode by default. Hence no switch is needed explictly.</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/inisolation switch could be specified explicitly to force isolation if required.</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Note : Though the default behavior is to run in process, if the input test assembly requires isolation (like needed a different .net platform or different architecture of the test runner, tests would be run in isolation)</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest.exe /testcontainer:abc.dll /noisolation</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll </font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/noresults</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&#160;</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe doesn’t create the TRX file by default.</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Results would be sent only to console. If TRX is needed, user has to enable it explicitly by specifying /logger:trx</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest.exe /testcontainer:abc.dll /noresults</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll </font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest.exe /testcontainer:abc.dll</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll /logger:trx</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/detail</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">&#160;</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe prints the stack trace and error message of each test to the console by default. </font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Hence there is no equivalent of /detail switch</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman"><em><u>Example:</u></em></font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Mstest.console.exe /testcontainer:abc.dll /detail:errormessage /detail:errorstacktrace</font></p>           <font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe abc.dll</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/pulish and the related options </font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">N/A</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">Vstest.console.exe doesn’t expose any functionality to publish results to TFS</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font></tr>       <font size="2" face="Times New Roman"></font>        <tr><font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="10"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">/unique</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="172"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">N/A</font></p>           <font size="2" face="Times New Roman"></font></td>         <font size="2" face="Times New Roman"></font>          <td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="96"><font size="2" face="Times New Roman"></font>            <p style="margin: 0in;"><font size="2" face="Times New Roman">There is no equivalent switch to unique. But the functionality could be achieved specifying the fully qualified name of the test.</font></p>         </td>       </tr>       <font size="1" face="Times New Roman"></font></tbody></table> </div> <font style="font-size: 12pt;"></font>]]></content:encoded>
    </item>
    <item>
      <title>Authoring a new Visual studio unit test adapter</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/authoring-a-new-visual-studio-unit-test-adapter</link>
      <pubDate>Tue, 13 Mar 2012 10:27:00 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2012/03/13/authoring-a-new-visual-studio-unit-test-adapter/</guid>
      <description><![CDATA[&nbsp;
&nbsp;
Visual studio&nbsp;11 Beta&nbsp;unit test framework provides a way to plug-in third...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/08/what-s-new-in-visual-studio-11-beta-unit-testing.aspx">Visual studio&nbsp;11 Beta&nbsp;unit test framework</a> provides a way to plug-in third party test runners and run their tests right inside VS IDE. <a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/02/visual-studio-11-beta-unit-testing-plugins-list.aspx">Here</a> are the list of test adapters that are already available for download.</p>
<p>In this post, let's quickly go through the steps involved in writing a new test adapter.</p>
<h3>Components of a test adapter:</h3>
<p>A test adapter plug-in needs to have two basic components :</p>
<ul>
<li>TestDiscoverer - A component that gives you the list of test cases from your test source. The test source could be a .dll file or a .xml or anything. Given a test source a discoverer knows how to load and get the test case out of it.</li>
<li>TestExecutor -A component that executes the tests. Given a list of tests, the executor executes them and gives back the results.</li>
</ul>
<p>To design these components the VS Unit testing extensibility model provides you with two interfaces :</p>
<blockquote>
<p>a. ITestDiscoverer</p>
<p>b. ITestExecutor</p>
</blockquote>
<p>.</p>
<p>To implement these interfaces all you need to do is to create a class library and add a reference to "Microsoft.VisualStudio.TestPlatform.ObjectModel "assembly which would be found under "%Program Files%\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow" folder.</p>
<h4>Xml Test Adapter:</h4>
<p>Let us walk through the implementation of a simple XML test adapter which would run tests in a given XML file. <span style="font-size: x-small;">[Sample code attached with the post]</span>.</p>
<h5>ITestDiscoverer:</h5>
<p>ITestDiscoverer defines just one method : "DiscoverTests". Given a list of test sources, this method would pull out the test cases from them.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/1157.clip_image001_4F646903.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/1157.clip_5F00_image001_5F00_4F646903.png"><img style="display: inline; background-image: none;" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/6428.clip_image001_thumb_5DFEEF1B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/6428.clip_5F00_image001_5F00_thumb_5F00_5DFEEF1B.png" width="668" height="141" /></a></p>
<p>If you take look at the parameters :</p>
<ol>
<li>Sources --&gt; Refers to the list of test sources that are passed to the test adapter from the client [VS or command line]. It would be a list of .xml files in our case.</li>
<li>Discoverycontext --&gt; Refers to the discovery context/runsettings for the current test run. Discoverer shall pull out the tests in a specific way based on the current context.</li>
<li>Logger --&gt; This is used to relay the warning and error messages to the registered loggers. Console Logger and TRXLogger are the built-in loggers that ships with Visual Studio 11. User shall register other custom loggers like FileStreamLogger or DBLogger as required.[ more details on writing custom loggers in future posts].</li>
<li>DiscoverySink --&gt; Discovery sink is used to send back the test cases to the framework as and when they are being discovered. Also it is responsible for the discovery related events.</li>
</ol>
<p><em><strong>Discoverer Attributes:</strong></em></p>
<p>The discoverer has two attributes associated with it:</p>
<p>FileExtension - Specifies one or more file extensions that the discoverer supports. It would be ".xml" in our case.</p>
<p>Executorurl - specifies the Url of the executor that is tied to the discoverer. The discover to executor mapping is 1:1.</p>
<p><strong><em>Xml discoverer:</em></strong></p>
<p>Lets quickly look at our sample XML discoverer. It scans the given XML source and identifies each "test case" based on XML Node attribute "Name".</p>
<p>It associates the executor (XMLExeuctor in our case) with each test case and sends the test back to the framework using discovery sink.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/7024.clip_image002_2DF49D9A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/7024.clip_5F00_image002_5F00_2DF49D9A.png"><img style="display: inline; background-image: none;" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/1651.clip_image002_thumb_05E1EE7B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/1651.clip_5F00_image002_5F00_thumb_5F00_05E1EE7B.png" width="644" height="156" /></a></p>
<p>&hellip;..</p>
<p>&hellip;...</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/1663.clip_image003_69F0B982.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/1663.clip_5F00_image003_5F00_69F0B982.png"><img style="display: inline; background-image: none;" title="clip_image003" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/7838.clip_image003_thumb_7D9DA316.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/7838.clip_5F00_image003_5F00_thumb_5F00_7D9DA316.png" width="644" height="129" /></a></p>
<h5>ITestExecutor :</h5>
<p>The ITestExecutor interface provides you with two simple overloaded methods to run tests :</p>
<blockquote>
<p>1. RunTests ( given the sources)</p>
</blockquote>
<blockquote>
<p>This could be something which maps to the "RunAll" functionality. All the sources are given to the executor in one go and executor defines how to run them.</p>
</blockquote>
<blockquote>
<p>2. RunTests ( given a test collection)</p>
</blockquote>
<blockquote>
<p>This maps to "RunSelected" test functionality, where a bunch of test cases are passed to the executor.</p>
</blockquote>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/7838.clip_image004_32E6B57C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/7838.clip_5F00_image004_5F00_32E6B57C.png"><img style="display: inline; background-image: none;" title="clip_image004" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/2664.clip_image004_thumb_377CC036.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/2664.clip_5F00_image004_5F00_thumb_5F00_377CC036.png" width="644" height="151" /></a></p>
<p>The runContext object and frameworkHandle object are passed are parameters to RunTests method, which provides all the settings related to the current run.</p>
<p><strong><em>XmlExecutor</em></strong></p>
<p>Our XML executor just iterates through the given tests and sets the test results based the user specified "Outcome" value in the XML.</p>
<p>In this case RunTest(sources) overload&nbsp; just calls the discoverer and calls RunTests(tests) overload. This could vary in other test adapters &ndash; say to have some optimizations for RunTests(sources).</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/3247.clip_image005_554B1E6A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/3247.clip_5F00_image005_5F00_554B1E6A.png"><img style="display: inline; background-image: none;" title="clip_image005" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/4130.clip_image005_thumb_304D5DF1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/4130.clip_5F00_image005_5F00_thumb_5F00_304D5DF1.png" width="644" height="329" /></a></p>
<h4>Install test adapter and run tests :</h4>
<p>Now that we are done with implementing the test adapter, we shall go ahead and register them. You shall register them using the steps mentioned <a href="http://blogs.msdn.com/b/aseemb/archive/2012/03/03/how-to-make-your-discoverer-executor-extension-visible-to-ute.aspx">here in Aseem's blog</a>. Method 2 disucssed over there via VSIX is the generally recommended way to install extensions.</p>
<p>To quickly check if the test adapter has been registered properly, you can try "vstest.console.exe /listdiscoverers" from a Visual Studio command prompt. [vstest.cosnsole.exe is the new framework agnostic test runner.More details here on <a href="http://msdn.microsoft.com/en-us/library/dd264975(v=vs.110).aspx">MSDN</a>].</p>
<p>If you have installed your adapter as a VSIX make sure that you specify /useVsixExtensions:True switch in your command. The below image shows the XMLDiscoverer being listed along with the other built-in test discoverers.</p>
<p>Similar to /listdiscoverers, we have a /listexecutors switch as well.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/8446.clip_image006_5974F62F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/8446.clip_5F00_image006_5F00_5974F62F.png"><img style="display: inline; background-image: none;" title="clip_image006" border="0" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/3568.clip_image006_thumb_6CB5ACCE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/3568.clip_5F00_image006_5F00_thumb_5F00_6CB5ACCE.png" width="474" height="313" /></a></p>
<p>Let&rsquo;s quickly try running our tests with a sample xml test file as below :</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/3162.clip_image007_4A7DA148.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/3162.clip_5F00_image007_5F00_4A7DA148.png"><img style="display: inline; background-image: none;" title="clip_image007" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/6708.clip_image007_thumb_49A53B5E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/6708.clip_5F00_image007_5F00_thumb_5F00_49A53B5E.png" width="244" height="57" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/3731.clip_image008_13C04644.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/3731.clip_5F00_image008_5F00_13C04644.png"><img style="display: inline; background-image: none;" title="clip_image008" border="0" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/0028.clip_image008_thumb_4BFEBD5C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/0028.clip_5F00_image008_5F00_thumb_5F00_4BFEBD5C.png" width="459" height="110" /></a></p>
<p>Now the new test adapter is registered and we are able to run tests from command line. We should be able to run these tests from "Unit test explorer" window as well, if these tests are based on ".dll" or ".exe" extension.</p>
<p>Since our tests are based on ".xml", we need to implement one additional interface to make &ldquo;Unit test explorer&rdquo; aware of it. This is because, visual studio by default scans only ".dll" and ".exe" project items and passes them on to the registered discoverers.</p>
<p>Lets take a look at it in our next post.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/28/20/98/MyXmlExtension.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-28-20-98/MyXmlExtension.zip">MyXmlExtension.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Running Windows 8 Metro style tests in TeamBuild</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/running-windows-8-metro-style-tests-in-teambuild</link>
      <pubDate>Wed, 07 Mar 2012 15:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2012/03/07/running-windows-8-metro-style-tests-in-teambuild/</guid>
      <description><![CDATA[Visual Studio 11 Beta was announced a week back along with Win 8 consumer preview.
Unit testing has...]]></description>
      <content:encoded><![CDATA[<p><a href="http://www.microsoft.com/download/en/details.aspx?id=27543">Visual Studio 11 Beta</a> was announced a week back along with <a href="http://windows.microsoft.com/en-US/windows-8/consumer-preview">Win 8 consumer preview</a>.</p>
<p><a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/08/what-s-new-in-visual-studio-11-beta-unit-testing.aspx">Unit testing</a> has been redefined in a more framework agnostic way in Visual Studio 11. Refer our <a href="http://msdn.microsoft.com/en-us/library/dd264975(v=vs.110).aspx">MSDN articles</a> and <a href="http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/08/what-s-new-in-visual-studio-11-beta-unit-testing.aspx">introductory post</a> to get started with it and expect more posts from us in the coming weeks.</p>
<p>Today, let&rsquo;s quickly go though the steps to get a simple metro style test running in your nightly build.</p>
<p><strong>Installing and configuring the build agent:</strong></p>
<ol>
<li>Install the <a href="http://www.microsoft.com/download/en/details.aspx?id=27542">Team foundation Build agent</a> on the Windows 8 box.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms181712.aspx">Configure the build agent to run as interactive process</a>. This is needed since metro style apps could not be launched from a background service.</li>
<ol>
<li>Enable auto-logon for the build agent service account [so that the build machine always has an active logged in session].</li>
<li>Make sure that the build agent service account has permissions to write to the build drop and it is a member of &ldquo;ProjectCollection Build service Account group&rdquo;</li>
</ol>
<li>Install <a href="http://msdn.microsoft.com/en-us/windows/apps/br229516">Visual Studio Win8 express</a> on the build agent machine. This is needed to bring in the Windows 8 specific dependencies.</li>
<li>Install <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465430.aspx">developer license</a> in the build agent box. This is needed to run metro style tests.</li>
</ol>
<blockquote>
<p><strong>Authoring the tests:</strong></p>
</blockquote>
<ol>
<li>Create a simple C# metro app and unit tests for it.</li>
<li>Launch VS. While choosing project template, select "Window metro style" and chose the appropriate project type.</li>
<li>Author the tests and build the project. More details can be found on <a href="http://msdn.microsoft.com/en-us/library/hh440545(v=VS.110).aspx">MSDN</a>.</li>
<li>On a successful build, "Unit test explorer" window would open on the left pane showing the test run progress.</li>
</ol>
<blockquote>
<p><strong>Creating build definition:</strong></p>
</blockquote>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Couple of things to take care of while specifying test parameters in the build definition:</p>
<ol><ol>
<li>Specify "Visual Studio Test Runner&rdquo; in the TestRunner dropdown. This would be the default value.This ensures that the tests are run via the new Visual Studio 11 based test runner instead of MSTEST.exe.</li>
<li>Specify *.appx for test assembly specification instead of .dll. For running metro style tests .appx file has to be given as input to the test runner instead of .dll.</li>
</ol></ol>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/3365.clip_image001_1AAEE9C7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/3365.clip_5F00_image001_5F00_1AAEE9C7.png"><img style="display: inline; background-image: none;" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/2783.clip_image001_thumb_612BD9CF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/2783.clip_5F00_image001_5F00_thumb_5F00_612BD9CF.png" width="232" height="274" /></a></p>
<p><strong>Installing the certificate:</strong></p>
<blockquote>
<p>Just one more step to go before triggering a build.The certificate of the test assembly need to be installed on the build agent machine. This is a one time operation and can be done by one of the following ways :</p>
</blockquote>
&nbsp;&nbsp;&nbsp;
<blockquote>
<p>From an admin cmd prompt on the build agent box, execute &ldquo;Certutil -importpfx *.pfx&rdquo;&nbsp; where the pfx file could be found in the project folder of your test project.<span style="text-decoration: underline;"> Note the password for the default pfx file is blank. Also, you can use the same pfx file for all your test projects (instead of having multiple files). This can be done by setting the &lt;PackageCertificateKeyFile**.pfx&lt;/PackageCertificateKeyFile&gt; node in the csproj file.</span></p>
<p>Else, install the certificate as part of post build event using the following steps :</p>
</blockquote>
<blockquote>
<p>&nbsp; a. Update the csproj file so that post build event gets executed <a href="http://blogs.microsoft.co.il/blogs/srlteam/archive/2009/02/03/how-to-disable-pre-post-build-events-when-using-team-build.aspx">only in the case of Teambuild and not local build</a>.</p>
<p>&nbsp; b. In post build event specify a script to execute &ldquo;Certutil -addstore root *.cer&rdquo; where the *.cer file could be found in a sub folder in the build drop. Create a wrapper script&nbsp; which would get the full path of the .cer file present in the build drop and pass it to the Certutil command.</p>
</blockquote>
<p><strong>Trigger a build and analyze the test results:</strong></p>
<blockquote>
<p>Now queue a build and analyze the results of your metro style tests.</p>
</blockquote>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/2476.clip_image002_20F5C055.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/2476.clip_5F00_image002_5F00_20F5C055.png"><img style="display: inline; background-image: none;" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/5123.clip_image002_thumb_27A8C9D8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/5123.clip_5F00_image002_5F00_thumb_5F00_27A8C9D8.png" width="366" height="256" /></a></p>
<p><strong>Frequent errors and resolutions:</strong></p>
<ol>
<li><em>Could not start tailored test run because Unit tests for Windows Metro style app cannot be run from a service or non interactive process. Please run unit tests from an interactive process.</em></li>
<ol>
<li>This error occurs if the build agent is running as service.</li>
</ol>
<li><em>Access is denied. (Exception from HRESULT: 0x80070005 </em></li>
<ol>
<li>This error occurs if the logged in user in the build agent machine is different from the build agent interactive process account . Make sure that the logged in account and the build agent account are same for Metro style apps to be run properly.</li>
</ol>
<li><em>Installation of package 'C:\Builds\1\proj1\CalcBuild\Binaries\CalculatorTest\AppPackages\CalculatorTest_1.0.0.0_AnyCPU_Debug_Test\CalculatorTest_1.0.0.0_AnyCPU_Debug.appx' failed with Error: (0x80073CF1) Package was not found. (Exception from HRESULT: 0x80073CF1).</em></li>
<ol>
<li>This error occurs if the certificates are not installed on the build agent box. Make sure that you install the certificate either manually (one time) or using post build scripts. Also make sure that the certificates of newly added test projects are also installed. [ or have all test projects point to same pfx file which is installed one time]</li>
</ol>
<li>Code coverage collection with metro style tests</li>
</ol>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Code coverage doesn&rsquo;t work with Metro style tests ( either in VS or in Team build or via the command line runner).</p>
<ol><ol></ol></ol>]]></content:encoded>
    </item>
    <item>
      <title>TestContext folders explained</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/testcontext-folders-explained</link>
      <pubDate>Fri, 24 Feb 2012 15:17:27 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2012/02/24/testcontext-folders-explained/</guid>
      <description><![CDATA[&#160;  One of the FAQ around MSTEST is on the folders exposed by TestContext. What each of them...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>One of the FAQ around MSTEST is on the folders exposed by <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext.aspx">TestContext</a>. What each of them means and which one to use when.</p>  <p>Below is a quick summary of the various folders and their usage.</p>  <p>&#160;</p>  <p><b><i><a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext.testrundirectory.aspx">TestRunDirectory (TestDir)</a></i></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/0726.clip_image001_504E010F.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/0726.clip_5F00_image001_5F00_504E010F.gif"><img style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/1307.clip_image001_thumb_5E20470A.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/1307.clip_5F00_image001_5F00_thumb_5F00_5E20470A.gif" width="15" height="15" /></a> Indicates the high level folder created for the current test run. This would have “In” and “Out” subfolders inside it.</p>  <p><b><i><a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext.testdeploymentdir.aspx">TestDeploymentDir</a></i></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/2867.clip_image0011_6BF28D05.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/2867.clip_5F00_image0011_5F00_6BF28D05.gif"><img style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001[1]" border="0" alt="clip_image001[1]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/7266.clip_image0011_thumb_36E5FDD5.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/7266.clip_5F00_image0011_5F00_thumb_5F00_36E5FDD5.gif" width="15" height="15" /></a> Indicates the “Out” sub folder under the “TestRunDirectory”. This is where the items needed for the current run would be <i><u>deployed prior</u></i> to the test run.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/8737.clip_image0012_16CAF118.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/8737.clip_5F00_image0012_5F00_16CAF118.gif"><img style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001[2]" border="0" alt="clip_image001[2]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/0317.clip_image0012_thumb_249D3713.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/0317.clip_5F00_image0012_5F00_thumb_5F00_249D3713.gif" width="15" height="15" /></a>&#160; If you need to refer to any of your deployed files, you should be using this variable.</p>  <p><b><i><a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext.testrunresultsdirectory.aspx">TestRunResultsDirectory (TestLogsDir)</a> </i></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/5826.clip_image0013_1D7DFA9B.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/5826.clip_5F00_image0013_5F00_1D7DFA9B.gif"><img style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001[3]" border="0" alt="clip_image001[3]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/7144.clip_image0013_thumb_7D62EDDD.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/7144.clip_5F00_image0013_5F00_thumb_5F00_7D62EDDD.gif" width="15" height="15" /></a> Indicates the “In” subfolder under “TestrunDirectory”. This is the folder where the <i><u>run level attachments</u></i> and data collector files would be <i><u>stored after</u></i> the test run.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/3343.clip_image0014_0B3533D9.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/3343.clip_5F00_image0014_5F00_0B3533D9.gif"><img style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001[4]" border="0" alt="clip_image001[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/1200.clip_image0014_thumb_5628A4A8.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/1200.clip_5F00_image0014_5F00_thumb_5F00_5628A4A8.gif" width="15" height="15" /></a> If you need to create temp files during the test run, you should be using this variable.</p>  <p><b><i><a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext.testresultsdirectory.aspx">TestResultsDirectory</a> </i></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/2870.clip_image0015_360D97EB.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/2870.clip_5F00_image0015_5F00_360D97EB.gif"><img style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001[5]" border="0" alt="clip_image001[5]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/0726.clip_image0015_thumb_43DFDDE6.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/0726.clip_5F00_image0015_5F00_thumb_5F00_43DFDDE6.gif" width="15" height="15" /></a> Indicates a sub folder inside “In” folder corresponding to the current test case. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/2845.clip_image0016_23C4D129.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/2845.clip_5F00_image0016_5F00_23C4D129.gif"><img style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001[6]" border="0" alt="clip_image001[6]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/8244.clip_image0016_thumb_6EB841F8.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/8244.clip_5F00_image0016_5F00_thumb_5F00_6EB841F8.gif" width="15" height="15" /></a> For each test case in the test run, a sub folder would be created which would have the <i><u>test case level data collector logs</u></i> like “EventLogs”. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/0724.clip_image0017_7C8A87F3.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/0724.clip_5F00_image0017_5F00_7C8A87F3.gif"><img style="border: 0px currentcolor; display: inline; background-image: none;" title="clip_image001[7]" border="0" alt="clip_image001[7]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/31/35/metablogapi/1385.clip_image0017_thumb_5C6F7B36.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-31-35-metablogapi/1385.clip_5F00_image0017_5F00_thumb_5F00_5C6F7B36.gif" width="15" height="15" /></a> If you add a file to the test result using TestContext.AddResult(), the file would go under the “TestResultsDirectory” corresponding to that test case.</p>  <p>&#160;</p>  <p>Hope you found it useful. if you have further questions, please post your queries.</p>]]></content:encoded>
    </item>
    <item>
      <title>Test agent, Test Controller and MSTEST FAQ</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/test-agent-test-controller-and-mstest-faq</link>
      <pubDate>Mon, 11 Oct 2010 09:54:25 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2010/10/11/test-agent-test-controller-and-mstest-faq/</guid>
      <description><![CDATA[MSTEST:   1. Do I need to install full VS to use MSTEST? Is there any light weight option?  You need...]]></description>
      <content:encoded><![CDATA[<p><font color="#008000" size="3"><em><strong><u>MSTEST:</u></strong></em></font> </p>  <p><b>1. </b><b><i>Do I need to install full VS to use MSTEST? Is there any light weight option?</i></b><b></b></p>  <p>You need not have full VS to bring in MSTEST. Test agent is a light weight option to bring in MSTEST. Refer to the below link for details:</p>  <p><a href="http://blogs.msdn.com/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx">http://blogs.msdn.com/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx</a></p>  <p><b>2. </b><b><i>Does MSTEST work for 64 bit binaries? Any known issues with it?</i></b><b></b></p>  <p><i></i></p>  <p>MSTest doesn’t work for 64bit binaries. However mstest can be used for 64bit testing. To do this, test assembly needs to be compiled for “AnyCPU” and test setting should specify 64bit host process for test execution.&#160; Also the test should be running on 64bit machine. This will load the test assembly in 64bit and testing will happen in 64bit mode.</p>  <p><b><i>3. </i></b><b><i>Does Side by side installations work?</i></b></p>  <p><b><i></i></b></p>  <p><i>For VS:</i></p>  <p>VS 2008 and VS 2010 on same machine, works fine.</p>  <p>For test agent and test controllers:</p>  <p>For agent and controllers, side by side install is not supported. </p>  <p><i></i></p>  <p><b>4. </b><b><i>What kind of logs do I need to debug issue with a test run?</i></b><b></b></p>  <p>For VS 2010, the <a href="http://social.msdn.microsoft.com/forums/en-US/vststest/thread/28b2e127-ca9c-4dcd-8723-edfa45f8989e/">devenv logs</a> and <a href="http://blogs.msdn.com/b/aseemb/archive/2010/03/07/how-to-enable-test-agent-logs.aspx">QTAgent.exe</a> logs are needed.</p>  <p>In VS 2008, you need to enable the logs for VSTESTHOST process:</p>  <p><a href="http://blogs.msdn.com/yutong/archive/2006/10/03/How-to-Enable-VSTS-Logging_3F00_.aspx">http://blogs.msdn.com/yutong/archive/2006/10/03/How-to-Enable-VSTS-Logging_3F00_.aspx</a></p>  <p>Also take out the logs from the event viewer under event source “VSTTAGENTProcess”</p>  <p><b><i>5. </i></b><b><i>Publish issues with MSTEST </i></b></p>  <p><b>VS 2008 and TFS 2008:</b></p>  <p><i><u>Error:</u></i><i> </i></p>  <p>Publishing results of test run geobuild@B88PSRACK017 2010-05-05 10:47:20_Any CPU_Release to <a href="http://tkbgitvstfat04:8080/">http://tkbgitvstfat04:8080/</a>............Publish completed successfully.</p>  <p>Done executing task &quot;TestToolsTask&quot;.</p>  <p><i><u>Resolution:</u></i><i> </i></p>  <p>In 2008, MSTest pushes results to the server, which then copies them out to the drop share.</p>  <p>Hence the TFS AT service account (not the TFS *<b>Build</b>* service account) needs permissions to the share. </p>  <p><b>VS 2010 and TFS 2008</b></p>  <p><i><u>Error:</u></i><i> </i></p>  <p>Unit tests are executed properly, but code coverage is not reported back to the TFS 2008 data warehouse as the build summary says &quot;No Code Coverage Results&quot;. I get an additional log file on the build server in ...\TestResults\CoverageLog5.log saying:: </p>  <p>The Code Coverage Analysis Service could not analyze the code coverage data for build DevLineDailyBuild&gt;20100630.3 (Any CPU/DevDeploy). This is frequently caused by publishing different versions of the same binary to a particular build.</p>  <p>Processing of code coverage data from run XXX@ServerName 2010-06-30 02:34:05_Any CPU_DevDeploy caused the following exception to be thrown:</p>  <p>Error when creating coverage info: Error loading symbol file. Symbol and binary files should be in the same folder as the coverage file or on the symbol path: C:\Documents and Settings\usdg-andromeda\Local Settings\Temp\Bode\DevLineDailyBuild\Binaries\DevDeploy\XYZ.dll.    <br />The data.coverage file is generated at “TestResults\In\ServerName\” folder. “TestResults\Out” folder is empty.</p>  <p><i><u>Resolution:</u></i></p>  <p><b></b></p>  <p>This a known issue where publishing code coverage from 2010 client to a 2008 server was broken. </p>  <p><b><i>6. </i></b><b><i>Is it possible to pass custom parameters to through MSTEST that will be passed to Setup and Cleanup scripts?</i></b></p>  <p><b><i>Or </i></b></p>  <p><b><i>My “buildrop” location keeps changing everyday. I need to deploy some binaries from my build drop for my test run. Does the VS unit testing framework supports any token for %builddrop% ? </i></b></p>  <p>It is not possible to pass custom parameters through MSTEST. Alternative could be to set the required parameters as environment variables and let you script take those values.</p>  <p><b></b></p>  <p><b></b></p>  <p><b><i></i></b></p>  <p><b></b></p> <font color="#008000" size="3"><strong><em><u>Test execution and VS:</u></em></strong></font>   <p></p>  <p><b></b></p>  <p><b><i>7. </i></b><b><i>What is the order in which initialize and cleanup methods get called?</i></b></p>  <p>All cleanups (assembly clean and class cleanup) will be called only during the end of the test run after all the tests in all the classes are executed. </p>  <p>Let’s consider an example: Two test projects: A.dll (class 1 - test 1a, test 1 b, class 2- test 2) and B.dll (class 3- test 3)</p>  <p>Below will be the rough flow of execution:</p>  <p>· Assembly init for A</p>  <p>· Class init for class1</p>  <p>· Test init for Test 1A</p>  <p>· Test 1A</p>  <p>· Test cleanup for test 1A</p>  <p>· Test init for Test 1b</p>  <p>· Test 1b</p>  <p>· Test cleanup for test 1b</p>  <p>· Class init for class 2</p>  <p>· Test init for Test 2</p>  <p>· Test 2</p>  <p>· Test cleanup for test 2</p>  <p>· Assembly init for B</p>  <p>· Class init for class 3</p>  <p>· Test init for Test 3</p>  <p>· Test 3</p>  <p>· Test cleanup for test 3</p>  <p>· Class cleanup for class 1</p>  <p>· Class cleanup for class 2</p>  <p>· Assembly cleanup for A</p>  <p>· Class cleanup for class 3</p>  <p>· Assembly cleanup for B</p>  <p>Below posts explains them in detail:</p>  <p><a href="http://blogs.msdn.com/nnaderi/archive/2007/02/17/explaining-execution-order.aspx">http://blogs.msdn.com/nnaderi/archive/2007/02/17/explaining-execution-order.aspx</a></p>  <p><a href="http://blogs.msdn.com/b/ploeh/archive/2007/01/06/classcleanupmayrunlaterthanyouthink.aspx">http://blogs.msdn.com/b/ploeh/archive/2007/01/06/classcleanupmayrunlaterthanyouthink.aspx</a></p>  <p><b><i>8. </i></b><b><i>How will I make sure that all the test cases in one class get executed before the tests in another class?</i></b></p>  <p><b><i></i></b></p>  <p>There is no way to guarantee that all tests in one class get called before the tests in another class. One work around to achieve this is to put the tests in the class inside an ordered test. But even with this approach, the class cleanup of this class will not be called right after the execution of the ordered test. If you have to dispose objects before starting execution of tests in another class, you need to add the cleanup logic in test cleanup of the last test method in the ordered class.</p>  <p><b><i>9. </i></b><b><i>How can I create my custom test type? Do we have samples for Custom host adapter sample?</i></b></p>  <p>VS SDK 2008 downloads: <a href="http://www.microsoft.com/downloads/details.aspx?familyid=30402623-93ca-479a-867c-04dc45164f5b&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?familyid=30402623-93ca-479a-867c-04dc45164f5b&amp;displaylang=en</a></p>  <p>VS SDK 2010 Beta 2 downloads: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cb82d35c-1632-4370-acfb-83c01c2ece24&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=cb82d35c-1632-4370-acfb-83c01c2ece24&amp;displaylang=en</a></p>  <p><b></b></p>  <p>10. <b><i>I</i></b> <b><i>get the below error while trying to run my custom test type. “File extension specified '.aii' is not a valid test extension.”</i></b></p>  <p>a. <u>Remote execution :</u></p>  <p>1) Make sure that the host adapter is chosen properly in test settings ( to chose the host adapter in test settings it need to be registered on the machine where you create test settings. If you are running test from Microsoft Test Manager this has to be present in MTM machine as well)</p>  <p>2) Register the test type and host adapters in the test controller machine and the agent machines. And you restart the services after doing the registration.</p>  <p><b>b. </b><u>Local execution:</u><b></b></p>  <p><b></b>Make sure that the test type is registered properly. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\EnterpriseTools\QualityTools\TestTypes for VS . </p>  <p><b><i></i></b></p>  <p><b><i>11. </i></b><b><i>&quot;One or more of the tests (directly or indirectly) included in this run could not be found&quot; – </i></b></p>  <p><b><i></i></b></p>  <p>This error happens when no test case can be found with the given ID. In the case ordered test, the contained test method name would have changed. For custom test types, make sure that you are not generated a random GUI for test ID during each build. Instead you can return the hash of Test method name, class name and namespace name as the test ID (similar to how out of box test types work).</p>  <p><i></i></p>  <p><b><i>12. </i></b><b><i>Any way to out a hyper link or custom sections in the results file?</i></b></p>  <p><b><i></i></b></p>  <p>No. </p>  <p><b><i>13. </i></b><b><i>Is there a way to run unit tests in parallel?</i></b></p>  <p><b><i></i></b></p>  <p>Check out <a href="http://blogs.msdn.com/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx">http://blogs.msdn.com/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx</a> for enabling parallel execution of unit test. Note that it is up to you to make sure that each individual test in the run can be run side by side with some other test without any conflicts (like cleanup issues, one negative test running in parallel with a positive test…).</p>  <p><font color="#008000" size="3"><strong><em><u>Deployment</u></em></strong></font></p>  <p><b></b></p>  <p><b><i>14. </i></b><b><i>How does deployment work?</i></b></p>  <p>Test execution deploys the below items :</p>  <p>· DeploymentItem()] items placed on [TestMethod] function</p>  <p>· Those in the /runconfig file in the Deployment files section</p>  <p>· Those that have reference (strong) from within the binary.&#160; This usually requires a reference in code to make sure the meta data is in the assembly</p>  <p>“CopyLocal=true” has no effect on whether MSTest commandline deploys the item</p>  <p>Mstest goes only one level deep to deploy the reference assemblies . If A refers B and B refers C, it wont deploy C. </p>  <p><strong>15. Deployment is very slow</strong></p>  <p>If the _NT_SYMBOL_PATH environment variable points to a non existent path, then deployment might be slow.</p>  <p>Details in <a href="http://blogs.msdn.com/mahuja/archive/2008/07/08/resolving-very-slow-symbol-loading-with-vs-2008-during-debugging.aspx">this</a> blog post.</p>  <p><b><i>16. </i></b><b><i>How does deployment of .config files work?</i></b></p>  <p>By default only the config file of the test binary will be deployed and not other config files . More details <a href="http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/383c1829-1566-4b51-aeb6-2134e97ff41b">here</a>. For other .config file, you need to add them as deployment items explicitly.</p>  <p><b><i>18. </i></b><b><i>What is the best way to deal with deploying dependent assemblies while running tests?</i></b></p>  <p>It is a normal for the test code to take dependency on product binaries. In such cases, the whole product binaries need not be copied to the location of the test binaries.</p>  <p>You can simply set the &quot;Root folder&quot; in the test settings to the location of your product binaries. This path will then act as probing path during assembly resolution.Refer to the this blog post for details on the same :</p>  <p><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/01/09/assembly-resolution-for-unit-%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tests.aspx">http://blogs.msdn.com/vstsqualitytools/archive/2010/01/09/assembly-resolution-for-unit- tests.aspx</a></p>  <p>Note that, whatever binaries that are present in the probing path will be resolved properly, irrespective of whether they are deployed along with the test binaries or not.</p>  <p>19. <b><i>How to customize the default deployment directory?</i></b></p>  <p>You can change the default deployment folder by editing the test settings file in the XML editor: </p>  <p>&lt;Deployment userDeploymentRoot=&quot;C:\TestResults&quot; useDefaultDeploymentRoot =&quot;false&quot; /&gt;&#160;&#160; </p>  <p>Note that ,if the test settings is modified by XML edit (instead of using the default editor) VS need to be closed and reopened ( since the editing is done in XML , the changes will not be updated in the loaded settings.)</p>  <p><b></b></p>  <p><font color="#008000" size="3"><strong><u><em>Test Rig:</em></u></strong></font></p>  <p>20. <b><i>Is there a way to programmatically control the rig operations?</i></b></p>  <p>The controller SDK is not a public one. However you can achieve various rig options programmatically as below:</p>  <p>a) Register agent with controller - TestAgentConfig.exe /Configure ( this command line will be present in %ProgramFiles%Common7/IDE in the agent machine )</p>  <p>b) Start/Stop service - sc <a href="file:///\\machinename">\\machinename</a> stop vsttagent ; sc <a href="file:///\\machinename">\\machinename</a> start vsttcontroller. If the agent and controller are in different domain, you can use IP instead of machine name.</p>  <p>c) Remove an agent from the controller - TestAgentConfig.exe /delete</p>  <p>Alternatively, you can edit the QTController.config.xml file (present in %programFiles%Visual Studio 2010/Common7/IDE folder in Controller machine) as well to add agents ( and add properties to agent ). The edit of XML can be done programmatically as well. Make sure to restart the controller service after editing the XML.</p>  <p><b><i></i></b></p>  <p>21. <b><i>Will Test Agents allow you to impersonate another user? Or does the Test Agent always kick of tests as the user its configured start up as?</i></b></p>  <p>There is no built in support for impersonation, so by default tests run under the identity of the test agent.&#160; If this is something you really need, you could write a unit test extension that does the impersonation for you. </p>  <p><b><i>22. </i></b><b><i>Agent doesn’t go to ready state or any issue with controller-agent configuration</i></b></p>  <p>Refer to <a href="http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/df043823-ffcf-46a4-9e47-1c4b8854ca13">Test agent-controller trouble shooting guide</a></p>  <p>The <a href="http://blogs.msdn.com/b/aseemb/archive/2009/11/28/how-to-enable-test-controller-logs.aspx">test controller</a>, <a href="http://blogs.msdn.com/b/aseemb/archive/2010/03/07/how-to-enable-test-agent-logs.aspx">test agent logs</a> and the event viewer error messages in the agent/controller machine will also give an idea.</p>  <p><b><i>23. </i></b><b><i>How can I distribute my tests across agents?</i></b></p>  <p>You can achieve this by setting the bucket size in the test settings file. Refer to this blog for details on it:</p>  <p><a href="http://blogs.msdn.com/b/vstsloadtestblog/archive/2006/02/08/527597.aspx">http://blogs.msdn.com/b/vstsloadtestblog/archive/2006/02/08/527597.aspx</a></p>  <p>If you are running tests from VS, then the test settings file can be edited using an XML editor. But for the test settings created using Microsoft Test Manager, there is no easy way to modify the bucket size. This is something we are planning to fix in next release.</p>  <p>24. <b><i>What happens if I queue multiple test runs on a test rig at the same time?</i></b></p>  <p>It depends on the number of available agents in the controller. Consider there are three agents which matches the criteria. The first run that gets queued will reserve ExecutionAgent1. And the second run shall use EA2 and the third will pick up EA3. The fourth run will fail with error mentioning “No agent found …”. But if the count of test cases in the first run is &gt; the <a href="http://blogs.msdn.com/vstsloadtestblog/articles/527597.aspx">bucket size</a> ( which is 100 by default), then appropriate number of execution agents are reserved. For example: If the first run has around 250 test cases, then all three agents will be reserved by the first run. 100 tests will send to ExecutionAgent1 and ExecutionAgent2 and 50 tests will be sent to ExecutionAgent3. And the second run will fail with “no agent …” error. </p>  <p>25.&#160; <strong><em>I have successfully deployed test agents and a test controller.&#160; The agents show up healthy when I ‘manage test controllers’ from VS.&#160; However when I try and use the agents to run a test case VS just shows the test results as Pending and it never completes.</em></strong></p>  <p>It might be because of blocking firewall in the VS client machine.</p>  <p>VS client doesn’t listen on one specific port for the incoming calls from controller. The port will be chosen in random (default range 1000-5000 or so).&#160; Hence you need to add the QTAgent.exe process (instead of port) in firewall exception list in the client machine.</p>]]></content:encoded>
    </item>
    <item>
      <title>Lab Build agents – How it works</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/lab-build-agents-how-it-works</link>
      <pubDate>Sun, 25 Apr 2010 11:41:00 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2010/04/25/lab-build-agents-how-it-works/</guid>
      <description><![CDATA[The Lab management end-to-end workflow works leverages the Team Foundation Build Agent/Build...]]></description>
      <content:encoded><![CDATA[<UL>
<P>The Lab management <A title="end-to-end workflow" href="http://cid-6408f2e16f3793da.skydrive.live.com/self.aspx/Visual%20Studio%20Lab%20Management%202010%20RC%20Videos/Video%204%20-%20Automate%20the%20build-deploy-test%20cycle.wmv" target=_blank mce_href="http://cid-6408f2e16f3793da.skydrive.live.com/self.aspx/Visual%20Studio%20Lab%20Management%202010%20RC%20Videos/Video%204%20-%20Automate%20the%20build-deploy-test%20cycle.wmv">end-to-end workflow</A> works leverages the Team Foundation Build Agent/Build Controllers to do the deployment.</P>
<P>Given that build agent is primarily targeted for compiling sources, a getting-started user will get a bunch of questions :</P>
<BLOCKQUOTE>
<P>a) How does the build agent inside a lab environment work ?</P>
<P>b) Can I use the build agent inside the lab environment for both compiling sources and deploying my&nbsp;application&nbsp;? </P>
<P>c)&nbsp;How are the build agents&nbsp;selected for compiling sources ?</P>
<P>Let me try to answer the above questions. And before that, take a look at our <A title="Getting started with Lab management series" href="http://blogs.msdn.com/lab_management/archive/2010/02/16/getting-started-with-lab-management-vs2010-rc-part-1.aspx" target=_blank mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/16/getting-started-with-lab-management-vs2010-rc-part-1.aspx">Getting started with Lab Management series</A> and <A title="Lab management videos" href="http://blogs.msdn.com/lab_management/archive/2010/02/11/visual-studio-lab-management-videos.aspx" target=_blank mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/11/visual-studio-lab-management-videos.aspx">Lab management videos</A></P></BLOCKQUOTE>
<P><STRONG><EM><U><FONT color=#006600>How&nbsp; does the build agent inside a lab environment work ?</FONT></U></EM></STRONG></P>
<P>The build agent inside a lab environment also does the regular functionality of executing the tasks given by build controller. In the case of an&nbsp;end-to-end (E2E)&nbsp;workflow ( which is nothing but a build definition), the task done by the agent will be deployment ( any script that user specifies : WIX, MSI, batch file, ps …) instead of compiling sources.</P>
<P>If you have <A title="lab service account" href="http://blogs.msdn.com/lab_management/archive/2010/02/22/what-is-lab-service-account.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/22/what-is-lab-service-account.aspx">lab service account</A> set for your project collection, then the build agent will use that identity while talking to TFS.</P>
<P><U>Example:</U> If you have your build agent running as domain\user account in your VM and set your lab service account as domain\svcaccount, then any out going call made by the build agent to the TFS will go with this identity. As the name implies, lab service account will be a service account with less privileges and hence this account will not be granted permissions on source control by default.</P>
<P><STRONG><EM><U><FONT color=#006600>Can I use the build agent inside the lab environment for both compiling sources and deploying ?</FONT></U></EM></STRONG></P>
<P><STRONG>The recommended way is to have a separate build agent machine for compiling sources</STRONG>.</P>
<P>The reasons being :</P>
<LI>Lab build agents (== build agents inside a lab environment) communicate with TFS using the lab service account identity which doesn’t have permissions on source control ( which is required for building sources). So this will not work out of box. Few manual steps has to be done in order to achieve this.</LI>
<LI>Lab machines that has to be in a clean state for deployment and might not have all the targets needed for compiling sources. </LI></UL>
<BLOCKQUOTE>
<P><U>Example:</U> To build a share point app and build a wsp package, the sharepoint target binaries are required on the build machine and it is not possible to have that in the lab environment ( since the VMs need to be clean before deployment).</P>
<P><STRONG><EM><U><FONT color=#006600>How is the build agent selected for compiling sources ?</FONT></U></EM></STRONG></P></BLOCKQUOTE>
<UL>
<LI>For running the E2E workflow, you will be creating a build definition for compiling sources. The default "Agent selection criteria" for this build definition will be "Agent which has any name and which doesn’t have tags ". The default " Tags is empty" criteria is to ensure that lab build agents are not picked up for compiling sources ( lab build agent always carries few custom tags that are pushed by lab and will not satisfy this criteria). 
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image001_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image001_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image001_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image001 border=0 alt=clip_image001 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image001_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image001_thumb.png" width=572 height=104 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image001_thumb.png"></A></P>
<P>If you have added tags to your non-lab build agents and just go with the default "Agent settings" options while creating the build definition,&nbsp;the tagged&nbsp;build agents will not&nbsp;be picked up for compilation and you might get an error which says "The build controller xxx does not contain an enabled build agent with name * and no tags".</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image002_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image002_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image002_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image002 border=0 alt=clip_image002 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image002_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image002_thumb.png" width=504 height=94 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image002_thumb.png"></A></P>
<P>To workaround the issue, chose the tags explicitly while chose the agent for compiling sources (like below)&nbsp;or have separate build controllers - one for managing compilation agents and another for managing lab build agents.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image003_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image003_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image003_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image003 border=0 alt=clip_image003 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image003_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image003_thumb.png" width=636 height=104 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image003_thumb.png"></A></P>
<P>If you chose any of the lab build agents explicitly for compiling sources, then you will get an error&nbsp;saying "No matching items found in S/ in your workspace, or you do not have permissions to access them".&nbsp;This happens because the&nbsp;lab build agents will not have source control permission by default.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image004_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image004_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image004_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image004 border=0 alt=clip_image004 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image004_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image004_thumb.png" width=659 height=64 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/LabBuildagentsHowitworks_287/clip_image004_thumb.png"></A></P>
<P>You might get the above error,<STRONG> when "MatchAtleast" is chosen instead of "MatchExactly" in which case the lab build agents might also get picked up</STRONG>.</P></LI></UL>
<P mce_keep="true">&nbsp;&nbsp;&nbsp; <FONT color=#006600><STRONG><U>How can I compile the sources using build agents inside the lab environment:</U></STRONG></FONT></P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Though the general recommendation is to not use the build agents inside the lab environment for compiling sources, you might have a scenario to do so. In that case you need to do the below steps to acheive this :</P>
<UL>
<LI>
<DIV mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Grant the lab service account "Read" permissions on the source control. By default when the a lab service account is set, it is denied source control permissions (to be "secure by default"). But, if you want your lab machines to compile sources&nbsp;then, the lab service account need to get the sources and hence it needs read permissions. <A title="This post" href="http://blogs.msdn.com/lab_management/archive/2010/02/22/what-is-lab-service-account.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/22/what-is-lab-service-account.aspx">This post</A> explains how to&nbsp;give read permissions using "tf permisisons" command.</DIV></LI>
<LI>
<DIV mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; While creating the compilation build definition, make sure that you either explictly chose the specific lab build agent or chose a tag or set some name filter so that the lab machines get chosen ( the reason being, by default lab machines will be excluded from the selection as mention above).</DIV></LI></UL>
<P mce_keep="true">Hope this helps!</P>]]></content:encoded>
    </item>
    <item>
      <title>Creating a bug when test fails in E2E</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/creating-a-bug-when-test-fails-in-e2e</link>
      <pubDate>Sun, 25 Apr 2010 10:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2010/04/25/creating-a-bug-when-test-fails-in-e2e/</guid>
      <description><![CDATA[In one of the earlier post, we saw how to customize the E2E workflow to automatically create a bug...]]></description>
      <content:encoded><![CDATA[<P>In one of the <A title="earlier post" href="http://blogs.msdn.com/lab_management/archive/2010/02/25/creating-a-bug-on-test-failure.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/25/creating-a-bug-on-test-failure.aspx">earlier post</A>, we saw how to customize the E2E workflow to automatically create a bug on hitting a test failure. This post enhances the scenario further by taking a snapshot of the environment after the test run and attaching a link to the snapshot to the newly created bug.</P>
<P>Attached is the customized xaml that you can download and use directly, after checking-in&nbsp;the XAML to your source control and creating a new build definition based on that.</P>
<P>Let me go through the additional things I have done on top of what is explained in the <A title="previous post" href="http://blogs.msdn.com/lab_management/archive/2010/02/25/creating-a-bug-on-test-failure.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/25/creating-a-bug-on-test-failure.aspx">previous post</A> :</P>
<P>1. Drag and drop the activity "SnapshotLabEnvironment" from "TeamFouundation Lab Management activities" section in addition to the "OpenWorkItem" activity.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image001_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image001_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image001_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image001 border=0 alt=clip_image001 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image001_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image001_thumb.png" width=404 height=292 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image001_thumb.png"></A></P>
<P>2. Define two new string variables in the scope of the "Sequence" and name them "LocalForwardLinkID" and "LocalsnapshotID".</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image002_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image002_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image002_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image002 border=0 alt=clip_image002 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image002_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image002_thumb.png" width=700 height=124 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image002_thumb.png"></A></P>
<P>3. Let's take a look at the "SnapshotLabEnrionment" activity .</P>
<BLOCKQUOTE>
<P>This activity takes the "LabEnvironmentUri" and "SnapshotName" as input parameters and snapshots the given environment and returns the ID of the newly taken snapshot. In addition it has an output parameter called SnapshotChainID.</P>
<P>For "LabEnvironmentUri" input parameter, specify the variable LabEnvironmentUri ( the value for which would have been already set in the workflow).</P>
<P>Specify some value for "SnapshotName" input parameter. The snapshot I have given is "TestRunFailureSnapshot" + DateTime.Now.Ticks.ToString. The date time is appeneded to ensure uniqueness of snapshot name.</P>
<P>Assign the return value and the out parameter value of the snapshotLabEnvironment activity to LocalSnapshotID and LocalForwardLinkID respectively.</P></BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image003_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image003_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image003_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image003 border=0 alt=clip_image003 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image003_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image003_thumb.png" width=244 height=174 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image003_thumb.png"></A></P>
<P>4. Next step is to pass on the snapshot detail to the newly created bug. As described in <A title="this post" href="http://blogs.msdn.com/lab_management/archive/2010/03/22/link-to-virtual-environment.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2010/03/22/link-to-virtual-environment.aspx">this post</A>, it is possible to create Environment /Snapshots links if we know their IDs. </P>
<BLOCKQUOTE>
<P>So let's compose a url for the newly taken snapshot and write that url in the bug description and we are done :)</P>
<P>Specify the below value for the "Comment" parameter of the "OpenWorkItem" activity.</P>
<P>String.Format("Snapshot of the environment when the test run happened is : &lt;a href=""lvr://ConnectToFwdLink/?CollectionUri={0}&amp;ForwardLink={1}""&gt;here&lt;/a&gt;", LabWorkflowParameters.EnvironmentDetails.TfsUrl, LocalForwardLinkID)</P>
<P>The above string is essentially the url for the newly taken snapshot composed using its ID . It is surrounded by a HREF tag to make it appear as a hyperlink in the bug.</P></BLOCKQUOTE>
<P>5. Run the build and the new bug will be created when the test run fails. The new bug will look something like below.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image004_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image004_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image004_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image004 border=0 alt=clip_image004 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image004_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image004_thumb.png" width=504 height=320 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image004_thumb.png"></A></P>
<P>6. Clicking on the "here" hyperlink from the history section in the bug will pop up the below dialog where can you chose to revert to the snapshot and debug your failure.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image005_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image005_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image005_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image005 border=0 alt=clip_image005 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image005_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image005_thumb.png" width=244 height=138 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/CreatingabugwhentestfailsinE2E_13CAC/clip_image005_thumb.png"></A></P>
<P>Cheers !</P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/00/22/14/CustomizedLabDefault.xaml" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-00-22-14/CustomizedLabDefault.xaml">CustomizedLabDefault.xaml</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Creating a bug on test failure ….</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/creating-a-bug-on-test-failure</link>
      <pubDate>Sun, 14 Feb 2010 11:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2010/02/14/creating-a-bug-on-test-failure/</guid>
      <description><![CDATA[One of the common requirement while running E2E build is to log a bug automatically when the test...]]></description>
      <content:encoded><![CDATA[<OL>
<P>One of the common requirement while running <A title="E2E build" href="http://blogs.msdn.com/lab_management/archive/2009/11/23/getting-started-with-lab-management-part-4.aspx" target=_blank mce_href="http://blogs.msdn.com/lab_management/archive/2009/11/23/getting-started-with-lab-management-part-4.aspx">E2E build</A> is to log a bug automatically when the test run fails. It is very simple to achieve this functionality by customizing the workflow.</P>
<P>Lets go through the steps for the same :</P>
<P>1.Make a copy of "labdefaulttemplate.xaml " and check-in the new xaml.</P></OL>
<BLOCKQUOTE>
<P align=left>This <A title=post href="http://blogs.msdn.com/lab_management/archive/2010/01/15/customization-of-end-to-end-e2e-workflow-of-visual-studio-lab-management-2010-beta2.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2010/01/15/customization-of-end-to-end-e2e-workflow-of-visual-studio-lab-management-2010-beta2.aspx">post</A> talks about getting started with E2E customization. Follow this post to make a copy of labdefaulttemplate.xaml and check-in the new XAML to source control. Let's call it "CustomizedE2E".</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P align=left>2.Now open the xaml in the workflow editor. Locate the "If all tests have not passed" block in the workflow.</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>3.Add a sequence activity inside the if block and put the "Set build status" activity inside the sequence. Drag and drop the "OpenWorkItem" activity from "Team Foundation Build activities" section in the toolbox into this sequence.</P></BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image001_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image001_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image001_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image001 border=0 alt=clip_image001 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image001_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image001_thumb.png" width=404 height=306 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image001_thumb.png"></A></P>
<BLOCKQUOTE>
<P>4.Specify values to the parameters of the "OpenWorkItem" activity.</P></BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image002_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image002_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image002_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image002 border=0 alt=clip_image002 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image002_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image002_thumb.png" width=354 height=196 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image002_thumb.png"></A></P>
<BLOCKQUOTE>
<P>Below are the values that I have specified for each parameter :</P></BLOCKQUOTE>
<DIV align=center>
<TABLE border=1 cellSpacing=0 cellPadding=2 width=546 align=center>
<TBODY>
<TR>
<TD vAlign=top width=79>
<P align=left><FONT size=1>Parameter</FONT></P></TD>
<TD vAlign=top width=241>
<P align=left><FONT size=1>Value specified</FONT></P></TD>
<TD vAlign=top width=224>
<P align=left><FONT size=1>Description</FONT></P></TD></TR>
<TR>
<TD vAlign=top width=83>
<P align=left><FONT size=1>AssignedTo</FONT></P></TD>
<TD vAlign=top width=239>
<P align=left><FONT size=1>BuildDetail.RequestedFor</FONT></P></TD>
<TD vAlign=top width=222>
<P align=left><FONT size=1>The value of this parameter will be set to the "AssignedTo" field in the bug. </FONT></P>
<P align=left><FONT size=1>"BuildDetail.Requested" will refer to person who has queued the build.</FONT></P></TD></TR>
<TR>
<TD vAlign=top width=86>
<P align=left><FONT size=1>Comment </FONT></P></TD>
<TD vAlign=top width=238>
<P align=left><FONT size=1>"Bug"</FONT></P></TD>
<TD vAlign=top width=221>
<P align=left><FONT size=1>The string specified here will go in to the description part of the bug.</FONT></P></TD></TR>
<TR>
<TD vAlign=top width=89>
<P align=left><FONT size=1>CustomFields</FONT></P></TD>
<TD vAlign=top width=238>
<P align=left><FONT size=1>New Dictionary(Of String, String) From {{"System.Reason", "Build Failure"}, {"Microsoft.VSTS.TCM.ReproSteps", "Run tests under BVT suite"}, {"Priority", "1"}, {"Severity", "1 - Critical"}}</FONT></P></TD>
<TD vAlign=top width=220>
<P align=left><FONT size=1>This is a dictionary which holds the values of various fields in the bug like priority, severity,repro steps....</FONT></P></TD></TR>
<TR>
<TD vAlign=top width=91>
<P align=left><FONT size=1>Title</FONT></P></TD>
<TD vAlign=top width=237>
<P align=left><FONT size=1>String.Format("Test run {0} queued as part of build {1} has failed ",TestResults.TestRunId.ToString(), BuildDetail.BuildNumber)</FONT></P></TD>
<TD vAlign=top width=219>
<P align=left><FONT size=1>This is the title of the bug. <BR>I have added the test run ID and the build number in the title.</FONT></P></TD></TR>
<TR>
<TD vAlign=top width=92>
<P align=left><FONT size=1>Type</FONT></P></TD>
<TD vAlign=top width=237>
<P align=left><FONT size=1>"Bug"</FONT></P></TD>
<TD vAlign=top width=219>
<P align=left><FONT size=1>This is the workItem type</FONT></P></TD></TR></TBODY></TABLE></DIV>
<BLOCKQUOTE>
<P>5.Save the xaml and check it in to the source control. Create a new E2E build definition based on this template.</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>6.Now run the E2E build and you can notice a bug being logged on test failure.</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><EM>E2E build summary pointing to the newly logged bug</EM> ..</P></BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image003_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image003_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image003_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image003 border=0 alt=clip_image003 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image003_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image003_thumb.png" width=604 height=374 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image003_thumb.png"></A></P>
<BLOCKQUOTE>
<P><EM>The bug that was logged automatically by the E2E workflow..</EM></P></BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image004_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image004_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image004_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image004 border=0 alt=clip_image004 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image004_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image004_thumb.png" width=504 height=363 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/Creatingabugontestfailure_C64/clip_image004_thumb.png"></A></P>
<P>Hope that helps ! Cheers :)</P>]]></content:encoded>
    </item>
    <item>
      <title>What’s new in E2E in RC</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/whats-new-in-e2e-in-rc</link>
      <pubDate>Thu, 11 Feb 2010 10:46:00 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2010/02/11/whats-new-in-e2e-in-rc/</guid>
      <description><![CDATA[Visual Studio 2010 Release Candidate (RC)&nbsp;was made available for public download yesterday (Feb...]]></description>
      <content:encoded><![CDATA[<P>Visual Studio 2010 Release Candidate (RC)&nbsp;was made available for public download yesterday (Feb 10th) and here is our team's blog on "<A title="What's new in Visual Studio Lab Management for RC" href="http://blogs.msdn.com/lab_management/archive/2010/02/08/what-is-new-for-visual-studio-lab-management-2010-rc.aspx" target=_blank mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/08/what-is-new-for-visual-studio-lab-management-2010-rc.aspx">What's new in Visual Studio Lab management for RC</A>". In RC we have made tremendous changes with respect to agent user accounts and getting your first lab environment up and running.</P>
<P>And this time we have <A title="Getting stated videos" href="http://blogs.msdn.com/lab_management/archive/2010/02/11/visual-studio-lab-management-videos.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/11/visual-studio-lab-management-videos.aspx">"Getting started videos"</A> to help you out. I am sure you would love it :) </P>
<P>Well, that's pretty much about "what's new in RC for over all for Lab management". Let's have a closer look at the <A title="E2E workflow functionality" href="http://blogs.msdn.com/lab_management/archive/2009/11/23/getting-started-with-lab-management-part-4.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2009/11/23/getting-started-with-lab-management-part-4.aspx">E2E workflow functionality</A> and briefly skim through the RC&nbsp; enhancements made in RC.</P>
<P>1. <U><STRONG>Link to test results in the build summary page :</STRONG></U></P>
<P>Now while looking at the E2E build summary from visual studio, to analyze your test run you can click on the "View Test Results" link which will launch Microsoft Test Manager and connect to the appropriate test run.</P>
<P>2. <STRONG><U>Link for post deployment snapshots :</U></STRONG></P>
<P>In Beta2, the post deployment snapshot file ( *.lvr) will be stored in a location that is specified in the E2E build definition. It is no more needed in RC. No need to specify any location and maintain the lvr files. Just specify the snapshot name. The build summary will have a hyperlink to the snapshot, clicking on which will open "Microsoft environment viewer".</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image001_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image001_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image001_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image001 border=0 alt=clip_image001 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image001_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image001_thumb.png" width=404 height=297 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image001_thumb.png"></A></P>
<P>3. <STRONG><U>Build configuration :</U></STRONG></P>
<P>From the E2E build definition while selecting the compilation build definition(or a specific build), you can chose a specific build configuration of interest.</P>
<P>The selected configuration will be picked up for deployment and running tests.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image002_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image002_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image002_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image002 border=0 alt=clip_image002 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image002_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image002_thumb.png" width=304 height=236 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/WhatsnewinE2EinRC_3E8/clip_image002_thumb.png"></A></P>
<P>4. <STRONG><U>Improved reliability and diagnosibility:</U></STRONG></P>
<P>We have made bunch of fixes that will enhance the robustness of the E2E workflow. </P>
<P><U>For example :</U> Few of the workflow activities used in E2E&nbsp;now takes an additional parameter called "RetryCount". This will help in making the workflow more robust by avoiding failures due to intermittent network issues.</P>
<P>Also bunch of error messages were revamped to enable the user to recover himself on hitting any issue.</P>
<P>5. <STRONG><U>No option&nbsp;to create&nbsp;environment but just restore&nbsp;:</U></STRONG></P>
<P>In Beta2, user can either restore an existing environment&nbsp;to a clean state or create a new environment for doing&nbsp;E2E. We have removed the latter option in RC, since restoring to clean snapshot is more prevalent. But if you need to create new environment for your nightly, you can do so by <A title=customizing href="http://blogs.msdn.com/lab_management/archive/2010/01/15/customization-of-end-to-end-e2e-workflow-of-visual-studio-lab-management-2010-beta2.aspx" target=_blank mce_href="http://blogs.msdn.com/lab_management/archive/2010/01/15/customization-of-end-to-end-e2e-workflow-of-visual-studio-lab-management-2010-beta2.aspx">customizing</A> your template.</P>
<P><U>Note:</U> If you have existing Beta2 build definition which creates new environment, you need to update your build definition to pick up an existing active LE. Our <A title="upgrade guide" href="http://blogs.msdn.com/lab_management/archive/2010/02/08/lab-management-2010-beta2-to-rc-upgrade-guide.aspx" target=_blank mce_href="http://blogs.msdn.com/lab_management/archive/2010/02/08/lab-management-2010-beta2-to-rc-upgrade-guide.aspx">upgrade&nbsp;guide</A> has details on the same.</P>
<P>Catch you shortly with more interesting posts on E2E …..</P>]]></content:encoded>
    </item>
    <item>
      <title>Deployment scripts and Machine names</title>
      <link>https://docs.microsoft.com/archive/blogs/bhuvaneshwari/deployment-scripts-and-machine-names</link>
      <pubDate>Fri, 08 Jan 2010 00:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Bhuvaneshwari K [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bhuvaneshwari/2010/01/08/deployment-scripts-and-machine-names/</guid>
      <description><![CDATA[In a typical nightly build scenario involving a multi tier app, the deployment and test scripts...]]></description>
      <content:encoded><![CDATA[<UL>
<P>In a typical <A title="nightly build scenario" href="http://blogs.msdn.com/lab_management/archive/2009/11/23/getting-started-with-lab-management-part-4.aspx" mce_href="http://blogs.msdn.com/lab_management/archive/2009/11/23/getting-started-with-lab-management-part-4.aspx">nightly build scenario</A> involving a multi tier app, the deployment and test scripts running on one tier might need the machine name of the other tier.</P>
<P><U>Example:</U></P>
<LI>To provision IIS account on SQL, the computer name of the web tier need to be passed to the scripts that will be run on the data tier. </LI>
<LI>Similarly to set the data base connection string in web config file, the data tier machine name is needed by the web tier machine. 
<P>If the computer names are hard coded in the scripts it will not scale in the cases where we have a set of similar environments (development environment, testing environment and production environment) and we want the same scripts to run in different environments (with different machine names). It would be good to generalize the deployment and testing scripts in such a way that it works properly irrespective of the change in the virtual machine's computer name.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In this post, I will explain one way of achieving the same for deployment. Before that, take a look at <A title="this post" href="http://blogs.msdn.com/lab_management/archive/2009/12/31/deploying-a-multi-tier-application-using-lab-management-with-ms-deploy-vsdbcmd.aspx" target=_blank mce_href="http://blogs.msdn.com/lab_management/archive/2009/12/31/deploying-a-multi-tier-application-using-lab-management-with-ms-deploy-vsdbcmd.aspx">this post</A> which talks about using <A title="MSDeploy web deployment tool" href="http://blogs.iis.net/msdeploy/archive/2008/01/22/welcome-to-the-web-deployment-team-blog.aspx" target=_blank mce_href="http://blogs.iis.net/msdeploy/archive/2008/01/22/welcome-to-the-web-deployment-team-blog.aspx">MSDeploy web&nbsp;deployment&nbsp;tool</A>&nbsp;to deploy web apps. MS Deploy takes care of passing the data tier name to the webconfig file and hence we don’t have to worry about running it on different environments. Here is an other alternate to solve the issue if you are not using MSDeploy:</P></LI>
<LI>
<P>Consider the deployment of a web app. Typically the web config file will be pointing to the data tier machine for SQL connection string. Since the machine name is hard coded in web config file, the same web config file cannot be deployed across environments. Hence, the Db connection string need to be set properly in the web config file as part of deployment. This can be achieved by the below steps:</P></LI></UL>
<UL>
<LI>
<P>Let's say we have an environment by name "Nightly". It has two virtual machines by name "Webserver" and "DbServer".</P></LI></UL>
<UL>
<LI>Have a simple program which will open a given file(arg0) and do a string.Replace of String 1( arg1) with String2( arg2). Lets call it ReplaceText.exe.</LI></UL>
<BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image001_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image001_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image001_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image001 border=0 alt=clip_image001 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image001_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image001_thumb.png" width=404 height=109 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image001_thumb.png"></A></P></BLOCKQUOTE>
<UL>
<LI>In the checked in version of Web.config file edit the DB connection string to some constant value, say "DBSERVERNAME".</LI></UL>
<BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image002_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image002_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image002_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002 border=0 alt=clip_image002 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image002_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image002_thumb.png" width=404 height=85 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image002_thumb.png"></A></P></BLOCKQUOTE>
<UL>
<LI>Now in your deployment script copy the web.config file to "WebServer" VM along with other binaries. </LI>
<LI>Invoke ReplaceText.exe on Web.config file and pass the computer name of the "DBServer" virtual machine as an argument by using <A title="$(InternalComputerName_DBServer) macro" href="http://blogs.msdn.com/bhuvaneshwari/archive/2010/01/06/macros-for-e2e-deployment.aspx" mce_href="http://blogs.msdn.com/bhuvaneshwari/archive/2010/01/06/macros-for-e2e-deployment.aspx">$(InternalComputerName_DBServer) macro</A>.</LI></UL>
<BLOCKQUOTE>
<P>In the below example, first all the binaries and config files are copied from build drop location to C:\IBuySpy folder. Then ReplaceText.exe is invoked with following parameters : target file ( Web.Config ), string to be replaced (DBSERVERNAME ) and replacement string ($(InternalComputerName_DBSERVERName) macro which will be expanded to the machine name of DBServer VM). Following that other scripts are invoked.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image003_2.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image003_2.png" mce_href="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image003_2.png"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image003 border=0 alt=clip_image003 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image003_thumb.png" original-url="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image003_thumb.png" width=504 height=175 mce_src="http://blogs.msdn.com/blogfiles/bhuvaneshwari/WindowsLiveWriter/DeploymentscriptsandMachinenames_C368/clip_image003_thumb.png"></A></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><U>Few things to note :</U></P></BLOCKQUOTE>
<UL>
<LI>Make sure the build agent service account has read permissions on the share in which ReplaceText.exe tool is present. </LI>
<LI>In the case of <A title="network isolated environments with a private domain controller" href="http://msdn.microsoft.com/en-us/library/ee518924(VS.100).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ee518924(VS.100).aspx">network isolated environments with a private domain controller</A>, the VM s will be joined to the private domain. If the corp domain has IPSEC policies set, then the VMs from the private domain cant access the corp resources. Hence for the build agent service account to access the network share, the machine need to have IPSEC disabled. In the above case "ddrelqa" machine need to have IPSEC disabled.</LI></UL>]]></content:encoded>
    </item>
  </channel>
</rss>