<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>abhishea</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/abhishea/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/abhishea/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:37:25 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How we use Release Management for our test automation – Part 2</title>
      <link>https://docs.microsoft.com/archive/blogs/abhishea/how-we-use-release-management-for-our-test-automation-part-2</link>
      <pubDate>Sun, 03 Jan 2016 23:36:00 GMT</pubDate>
      <dc:creator><![CDATA[Abhishek Agarwal [MS]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/abhishea/2016/01/03/how-we-use-release-management-for-our-test-automation-part-2/</guid>
      <description><![CDATA[In the first part of this blog, I described our e2e experience for setting up our test automation...]]></description>
      <content:encoded><![CDATA[<p>In the <a href="https://blogs.msdn.com/b/abhishea/archive/2016/01/04/how-we-use-release-management-for-our-test-automation-part-1.aspx">first part of this blog</a>, I described our e2e experience for setting up our test automation using RM. This is the second (and final) installment of that blog, in which I will describe some of the design choices / challenges we faced while setting up the system, and how we addressed them.<h3>Single agent pool vs multiple agent pools</h3><p><strong>Problem Statement</strong>: How do we route a Release Definition (RD) to the correct agent machine i.e. the machine which has the pre-requisites for that RD installed on it?</p><p><strong>Solution</strong>: When we started authoring our RDs, it became clear to us that we needed to route each RD to the correct agent because the pre-requisites for each test suite were different. Our initial approach was to create a different agent pool per RD, but this was causing a management headache with a blow up in the number of agent pools that we had to manage. Finally, based on guidance from Chris Patterson (from the Build team), we settled on the design of having a single agent pool called RMAgentPool where each agent was differentiated from others by having a user capability. Each Release Definition (RD) and Build Definition (BD) now routes its run to the correct agent using the RmCdpCapability on the agent. E.g. the machine which has been prepared for RM.CDP.TfsOnPrem has the capability RmCdpCapability=TfsOnPrem:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/0003.image_1D951983.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/0003.image_5F00_1D951983.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8322.image_thumb_679E7B4D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8322.image_5F00_thumb_5F00_679E7B4D.png" alt="image" width="675" height="208" border="0"></a></p><p>And the RM.CDP.TfsOnPrem RD routes its runs to this agent using the demand RmCdpCapability=TfsOnPrem:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/7282.image_6B68C0C1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/7282.image_5F00_6B68C0C1.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1856.image_thumb_5AF04FC6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1856.image_5F00_thumb_5F00_5AF04FC6.png" alt="image" width="671" height="310" border="0"></a></p><h3>JIT debugging</h3><p><strong>Problem statement: </strong>How do we debug intermittent failures when the log files provide insufficient data? By the time the dev gets to the issue, the next test run has wiped out the &ldquo;bad state&rdquo; on the test machine.</p><p><strong>Solution</strong>: When a test suite shows &ldquo;flaky&rdquo; behavior, we enable the &ldquo;Pause Agent on test failure&rdquo; task in the RD:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5775.image_43C4D548.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5775.image_5F00_43C4D548.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/7701.image_thumb_0154C3C3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/7701.image_5F00_thumb_5F00_0154C3C3.png" alt="image" width="709" height="374" border="0"></a></p><p>This task is configured to pause the release when the flaky task fails. In that case, the dev can remote-desktop into the agent machine, and the state of the machine will be exactly what it was when the task failed. Note that this is possible only if the timeout for the environment is set to 0 i.e. no timeout.</p><p>The Pause task takes the following arguments (highlighted in the image above):</p><p>-AlternateCredentialsUserName $(release.alternateusername) -AlternateCredentialsPassword $(release.alternatepassword) -ReleaseId $(Release.ReleaseId) -TaskName <strong>$(TaskToDebugName)</strong> -NumberOfSeconds $(TaskToDebugTimeInSeconds)</p><p>The key here is $(TaskToDebugName): The value of this is set to &ldquo;<strong>Run RMCDPOnPrem tests</strong>&rdquo; for RM.CDP.TfsOnPrem i.e. the name of the task which is failing intermittently. All the RM.CDP.* RDs have this task with the same arguments, but the value of the $(TaskToDebugName) in each RD corresponds to the task that we want to debug for flakiness.</p><p>You can find the source code for this task <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/8284.PauseAgentOnTaskFailure.ps1" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15/8284.PauseAgentOnTaskFailure.ps1">here</a>. (You can replace &ldquo;YourAccount&rdquo; with your account name and start using it.)</p><h3>How do we run the tests in admin mode on the agent machine?</h3><p><strong>Problem statement</strong>: Even if the agent is run with admin credentials, it runs the task in non-admin mode. This makes it impossible to run a task that requires to run in admin mode e.g. installing a service on the agent box.</p><p><strong>Solution</strong>: We solved this problem by using the &ldquo;Powershell on Target Machines&rdquo; task, and remoting back to the current agent machine as admin. For example, we install the TFS service in RM.CDP.RmEqTfs using this technique:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/3312.image_0E4EA3D4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/3312.image_5F00_0E4EA3D4.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1057.image_thumb_303A0658.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1057.image_5F00_thumb_5F00_303A0658.png" alt="image" width="781" height="286" border="0"></a></p><h3>Tests that can&rsquo;t be re-authored to use the VsTest task</h3><p><strong>Problem statement</strong>: Some tests have been authored quite some time back (lets call them &ldquo;legacy tests&rdquo;), and they are not VsTest task compliant. How do we get all the reporting benefits of a VsTest task compliance test in such scenarios?</p><p><strong>Solution</strong>: We solved this problem by:</p><p>(1) Running the legacy tests through a batch script or powershell task &ndash; whatever was convenient &ndash; and noting the location of the output log file.</p><p>(2) We then added a VsTest task that parsed the output log file of the above step to see if it passed or failed.</p><p>Our RM.CDP.DevFabricUpgrade RD is one such RD: The main test is run through a powershell script RunAOConfigTest.ps1.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/0728.image_0012BB95.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/0728.image_5F00_0012BB95.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8863.image_thumb_3446E4DB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8863.image_5F00_thumb_5F00_3446E4DB.png" alt="image" width="768" height="354" border="0"></a></p><p>The next task is a VsTest task that parses the log file and checks if there is an error or not.</p><p>Side note: Till pretty recently, the VsTest-compliant test code for RM.CDP.DevFabricUpgrade used to just output the text &ldquo;Expected True, but found False&rdquo; in the log file, which made it a pain for devs to debug. Devs then had to open the log file output of RunAOConfigTest.ps1 (which itself took quite some time since it was pretty large), and had to grovel through it to find out what the real error was e.g. the below screenshot:</p><pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/6787.image_320CECD0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/6787.image_5F00_320CECD0.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/3108.image_thumb_43EC114E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/3108.image_5F00_thumb_5F00_43EC114E.png" alt="image" width="752" height="415" border="0"></a></pre><p><span style="font-family: 'Segoe UI';">We recently revved this code to also output the real reason for the error by parsing the RunAOConfigTest.ps1 output log file more thoroughly.&nbsp; The test now outputs more detail in case of failure:</span></p><pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8322.image_60888D21.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8322.image_5F00_60888D21.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8004.image_thumb_50101C26.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8004.image_5F00_thumb_5F00_50101C26.png" alt="image" width="756" height="440" border="0"></a>&nbsp;</pre><h3>How do we eliminate bottlenecks in the test runs?</h3><p><strong>Problem Statement</strong>: Some RDs take very long to run, and the queue for such RDs builds up quite a bit. This increases the turnaround time (for getting all the test results of a build) significantly. How can we do better?</p><p><strong>Solution</strong>: Since most of our tests are designed to deploy the service and run the tests on the agent machine itself, we can just throw more hardware (with the correct RmCdpCapability) at these &ldquo;bottleneck&rdquo; RDs.</p><h3>How can we run UI tests?</h3><p><strong>Problem Statement</strong>: How can we run UI tests on the agent machine?</p><p><strong>Solution</strong>: The quick and dirty way to do this is to run the agent in interactive mode (as opposed to in service mode). (Reason: When the agent runs in service mode, it is unable to interact with the desktop.) However, the downside of running in interactive mode is that the interactive agent doesn&rsquo;t support auto-upgrade functionality. So whenever the agent is upgraded, you will need to login to the agent machine and re-start the agent.</p><p>A more hands-free approach is to run the agent in service mode, and then use the &ldquo;Visual Studio Test Agent Deployment&rdquo; and &ldquo;Visual Studio Test using Test Agent&rdquo; tasks respectively. We use a technique similar to the &ldquo;Powershell on Target Machines&rdquo; technique described above where we remote back to the current agent machine as admin. These tasks run the Test Service on the agent, and this service is configured to interact with the desktop.</p><p>To use this, we first need to create a machine group with the appropriate machines in the Test hub:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1856.image_208B81FC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1856.image_5F00_208B81FC.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/7633.image_thumb_4929EE03.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/7633.image_5F00_thumb_5F00_4929EE03.png" alt="image" width="723" height="439" border="0"></a></p><p>We then need to use this machine group in the 2 VS Test Agent tasks mentioned above. The VsTest Agent Deployment task must have &ldquo;Interactive Process&rdquo; selected:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8422.image_46EFF5F8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8422.image_5F00_46EFF5F8.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/7268.image_thumb_211C6046.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/7268.image_5F00_thumb_5F00_211C6046.png" alt="image" width="723" height="504" border="0"></a></p><p>And finally, the &ldquo;Vs Test using Test Agent&rdquo; task uses the same machine group to run the tests. The test filters used are the same as those used with the standard VsTest task:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5481.image_04A48FC8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5481.image_5F00_04A48FC8.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/6472.image_thumb_1F734685.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/6472.image_5F00_thumb_5F00_1F734685.png" alt="image" width="723" height="577" border="0"></a></p><p>(This experience will become more in-line in the near future, where we won&rsquo;t necessarily need to create Machine Groups for the VS Test Agent tasks, and we can just specify $(Agent.MachineName) inline as the machine name.)</p><h3>What are the variables available at runtime?</h3><p><strong>Problem Statement</strong>: What are all the variables available at runtime?</p><p><strong>Solution</strong>: The variables available at runtime (and which you can use in your RD) can be found at the top of the logs:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1385.image_2F15E247.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1385.image_5F00_2F15E247.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/4428.image_thumb_24E447DA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/4428.image_5F00_thumb_5F00_24E447DA.png" alt="image" width="661" height="461" border="0"></a></p><h3>Will RM be able to scale to suit our team&rsquo;s needs?</h3><p><strong>Problem Statement</strong>: As we near the end of a sprint, the number of checkins increases exponentially in our team, and there were concerns about RMO being able to handle that load.&nbsp; 15 checkins / day is common during release time, and this maps to 15 * 9 = ~135 deployments / day (since each checkin triggers 9 RDs).</p><p><strong>Solution</strong>: Initially, RMO did have some jitter when there were high volumes, but we have hardened the service through a bunch of stress testing over the latter part of 2015.&nbsp; RMO can now easily withstand our team&rsquo;s load.&nbsp; The screenshot below shows ~20 releases of RM.CDP.DevFabircUpgrade in the past 24 hours, which corresponds to 20 * 9 = 180 releases for our team during the same time period.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1856.image_5E1652B0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1856.image_5F00_5E1652B0.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/4747.image_thumb_5B7027B0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/4747.image_5F00_thumb_5F00_5B7027B0.png" alt="image" width="737" height="515" border="0"></a></p><h3>Conclusion</h3><p>Hopefully this will help you get through most of your issues if you decide to use RM in your test automation. Happy New Year!</p><p>&nbsp;</p><p>Edit (3/23/2016): RMO has now added support for running environments in parallel with deployment conditions. &nbsp;We have taken advantage of this to move out test automation to a single RD with multiple environments. &nbsp;I have blogged about that&nbsp;<a href="https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/23/using-parallel-environments-and-release-promotion-in-test-automation/">here</a>.</p></p>
]]></content:encoded>
    </item>
    <item>
      <title>How we use Release Management for our test automation – Part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/abhishea/how-we-use-release-management-for-our-test-automation-part-1</link>
      <pubDate>Sun, 03 Jan 2016 23:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Abhishek Agarwal [MS]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/abhishea/2016/01/03/how-we-use-release-management-for-our-test-automation-part-1/</guid>
      <description><![CDATA[In November 2015, we made Release Management service available for Public Preview in Visual Studio...]]></description>
      <content:encoded><![CDATA[<p>In November 2015, we made Release Management service available for Public Preview in Visual Studio Team Services. You can see the blog <a href="https://blogs.msdn.com/b/visualstudioalm/archive/2015/11/18/announcing-the-new-release-management-service-in-visual-studio-team-services.aspx">here</a> to get going quickly on an end-to-end using RM. You can also use the MSDN documentation <a href="https://msdn.microsoft.com/Library/vs/alm/release/overview-rmpreview">here</a> for a more detailed understanding of RM scenarios and concepts.<p>RM can be used for 2 scenarios &ndash; for deploying bits to production through a series of environments, as well as for running tests during the development cycle of the product. In this blog post, I am going to talk about the latter &ndash; specifically how we (the RM team at Microsoft) use the RM service for our test automation scenarios. We have been using RM in this way for 7 months now &ndash; kudos to my colleague Lova for driving this effort.</p><p>I have split up this blog into 2 parts. This is the first part of the blog, where I will describe our high-level experience while setting up the end-to-end for our test automation. In the next part, I will describe some of the design choices / challenges we faced while setting up our test automation, and how we addressed them.</p><h3>Overview and high level description</h3><p>VSTS consists of a number of scale units (or SUs) that provide services like version control, build, release management, work item tracking, etc. SU0 is the &ldquo;dogfood&rdquo; scale unit i.e. all the teams that contribute towards the VSTS services use the services in SU0 for their own day-to-day work. Typically, teams deploy new bits first to SU0, and after dogfooding the bits for some time, they promote the bits to the other scale units.</p><p>Along these lines, the RM team also uses the services in SU0 for its day-to-day engineering work. We do our development work (features/bug fixes) in a TF Git based feature branch called features/rmmaster, use the Build service to build our code, and the RM service to test our code.</p><p>At a high level, the goal of our engineering system is to take every checkin and validate that through a bunch of configurations in parallel so that we catch regressions as early in the cycle as possible. To this end, there are 3 phases that a dev&rsquo;s code goes through:</p><p>(1) <strong>Pre-checkin phase, or Pull Request (PR)</strong>: In this phase, we mainly run unit tests, and a few end-to-end tests to ensure that basic functionality is never broken in the features/rmmaster branch.</p><ul>
<ul>
<li>Note that if your git branch enables push-based checkins, then this phase is not applicable.</li>
</ul>
</ul><p>(2) <strong>Continuous Integration phase (CI)</strong>: In this phase, our CI build is kicked off immediately after checkin. This build once again runs the unit tests (to ensure that parallel checkins have not broken them), and then publishes artifacts which are consumed by RM during test automation.</p><p>(3) <strong>Test automation phase</strong>: This is triggered by the build completion event, and entails a bunch of Release Definitions (RD) starting in parallel. Each RD tests a different scenario, and together these RDs provide exhaustive coverage of the product. This is the phase that I&rsquo;ll be focusing on the most in this blog.</p><h3>Setting up the &ldquo;Continuous Automation Pipeline&rdquo;</h3><p>Our <strong>CI build</strong> definition name is VSO.RM.CI, and it publishes a single artifact called &ldquo;drop&rdquo; which contains all the binaries produced by the build.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8585.image_6B2BF3C6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8585.image_5F00_6B2BF3C6.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/6064.image_thumb_563D0204.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/6064.image_5F00_thumb_5F00_563D0204.png" alt="image" width="794" height="449" border="0"></a></p><p><strong>We tie this build definition to a bunch of Release Definitions (RDs)</strong> using the Trigger property of the RD. In other words, each of the RDs highlighted below is triggered automatically when the VSO.RM.CI build completes.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/2526.image_79F8BA4F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/2526.image_5F00_79F8BA4F.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5102.image_thumb_5084790F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5102.image_5F00_thumb_5F00_5084790F.png" alt="image" width="610" height="406" border="0"></a></p><p>(Note that each RD currently has only a single environment. We were forced to use this design of 9 different RDs because RM doesn&rsquo;t support running environments in parallel. That feature is coming soon; after that we will fold these RDs into a single RD with 9 environments that start in parallel. This will provide us with better traceability for a build.)</p><p>At a high level, each RD downloads the binaries required for its test, sets up the required test environment by cleaning up old binaries and deploying new ones (both dependent services and test DLLs), runs the tests using the VsTest task (which also publishes the results for easy reporting and analysis later), and finally cleans up the environment again. I&rsquo;ll be drilling down into the RD design later in this blog.</p><p>Pictorially, the code flow and test publishing looks like this:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8015.clip_image002_1D02A385.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8015.clip_5F00_image002_5F00_1D02A385.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1856.clip_image002_thumb_37CEC991.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1856.clip_5F00_image002_5F00_thumb_5F00_37CEC991.jpg" alt="clip_image002" width="791" height="138" border="0"></a></p><h3>Setting up the agent pool</h3><p>Before we could run anything, however, we needed to <strong>set up the build/release agents </strong>for our CI build and RDs. Normally, one would run the tasks on a build/release agent pool to deploy the services (RM/SPS/TFS) remotely to another set of target servers, and then run tests against them. In our case, we decided to deploy the services on the agent machine itself so that we could have multiple instances of the test at the same time.</p><p>Different tests had different pre-requisites respectively (and this precluded usage of the Hosted agent pool). Accordingly, we created a single agent pool called RMAgentPool. We prepared a different machine for each RM.CDP.* RD, installed the build/release agent on each of these machines, and added these machines to the RMAgentPool.</p><p>(To do this, we downloaded the agent on each test machine from the &ldquo;Download agent&rdquo; link highlighted in the image below. After unzipping the agent zip file, we configured it by setting the &ldquo;URL for Team Foundation Server&rdquo; to our account e.g. <a href="https://OurAccount.visualstudio.com">https://OurAccount.visualstudio.com</a>.)</p><p>Each machine was given a new user capability called &ldquo;RmCdpCapability&rdquo;, and its value denoted its usage e.g. the machines prepared for the CI build had &ldquo;RmCdpCapability=CI&rdquo;.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/3644.image_400C0814.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/3644.image_5F00_400C0814.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5153.image_thumb_2B894947.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5153.image_5F00_thumb_5F00_2B894947.png" alt="image" width="792" height="368" border="0"></a></p><p>Another example: The agent used to run RM.CDP.TfsOnPrem had &ldquo;RmCdpCapability=TfsOnPrem&rdquo;.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/2451.image_02150807.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/2451.image_5F00_02150807.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/6685.image_thumb_24006A8B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/6685.image_5F00_thumb_5F00_24006A8B.png" alt="image" width="792" height="109" border="0"></a></p><p>The RmCdpCapability was then used as a demand by the RDs so that the tests run on the correct agents.</p><h3>Overview of the RM.CDP.* RDs</h3><p>A quick note on terminology: The web client based RM is also called &ldquo;RM TWA&rdquo; &ndash; TWA stands for Team Web Access</p><ul>
<li>RM TWA service in VSTS is called RM Online (or RMO)</li>
<li>RM TWA, when folded into TFS on-prem is called RM on-prem (this has not released as yet, but we are pushing hard to release this as early as possible)</li>
</ul><p>Note that VSTS is a collection of several micro-services all of which are developed using a common Sprint model (all teams use the same three-week cycle), but are deployed somewhat independently by each of the teams. While RM is one such micro-service, it depends on other micro-services such as SPS and TFS.</p><p>A brief description of the tests we run for RM TWA:</p><p>1. Tests for RMO:</p><ul>
<ul>
<li>RM.CDP.RmEqTfs: Runs end-to-end (e2e) API based tests for RMO for scenarios where RM is at the same sprint release version as dependent services (SPS, TFS) e.g. RM is at Sprint 92 (S92), and SPS/TFS are also at S92</li>
<li>RM.CDP.RmGtTfs: Runs e2e tests for RMO for scenarios where RM is ahead of dependent services (SPS, TFS) in a scale unit e.g. RM is at S92, and SPS/TFS are at S91</li>
<li>RM.CDP.RmLtTfs: Runs e2e tests for RMO for scenarios where RM is behind dependent services (SPS, TFS) in a scale unit e.g. RM is at S91, and SPS/TFS are at S92.</li>
</ul>
</ul><blockquote>
<p>The above test matrix enables us to deploy RMO to scale units independent of whether dependent services SPS/TFS have deployed or not (as long as we don&rsquo;t have a dependency on a new feature in these services, in which case the RmGtTfs test suite would [hopefully] fail).</p>
</blockquote><p>2. Tests for RM on-prem:</p><ul>
<ul>
<li>RM.CDP.TfsOnPrem: Runs both API based tests and UI based tests on RM on-prem.</li>
</ul>
</ul><p>3. Upgrade tests</p><ul>
<ul>
<li>RM.CDP.DevFabricUpgrade: Tests the upgrade scenario for RMO e.g. from S91 to S92.</li>
<li>RM.CDP.OnPremUpgrade: Tests the upgrade scenario for RM on-prem.</li>
</ul>
</ul><p>4) Test for x-plat RM i.e. RM agent running on Linux / iOS:</p><ul>
<ul>
<li>RM.CDP.XPlat</li>
</ul>
</ul><h3>Design of the RM.CDP.* RDs</h3><p>I&rsquo;ll drill down into the RM.CDP.TfsOnPrem RD, since it establishes the canonical pattern that is used by the other RDs.</p><p>1) The RD is configured to <strong>run on the correct agent</strong> as per the screenshot below: RM.CDP.TfsOnPrem &ndash;&gt; Edit &ndash;&gt; Environment &ndash;&gt; &hellip; &ndash;&gt; Agent Options &ndash;&gt; Options tab.</p><p>2) Further, it &ldquo;<strong>Skips Artifact Download</strong>&rdquo;:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8182.image_45EBCD0F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8182.image_5F00_45EBCD0F.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8130.image_thumb_1C778BCF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8130.image_5F00_thumb_5F00_1C778BCF.png" alt="image" width="778" height="372" border="0"></a></p><p>The reason for skipping artifact download is that our CI build publishes a single, large artifact (called &ldquo;drop&rdquo;) which is several GB in size, whereas each test requires a different subset of the files.</p><p>(Currently, RM doesn&rsquo;t support easily downloading a subset of artifacts published by the build. Once that supports gets in, we will do 2 things: (1) Start publishing smaller artifacts in our CI build i.e. instead of publishing a single, big artifact called &ldquo;drop&rdquo;, we will publish smaller artifacts named &ldquo;TfsDrop&rdquo;, &ldquo;RmDrop&rdquo;, &ldquo;SpsDrop&rdquo;, etc (2) We will then download the appropriate artifact(s) as required by each RM.CDP.* RD.)</p><p>3. Each of the RDs downloads some standard files (specifically vssbinfetch.exe, which knows how to download specific parts of a build drop) by running the downloadArtifacts.ps1 file (which is available on a \\ file share). Then it uses the &ldquo;vssbinfetch&rdquo; task (which is a custom task authored by us, and which invokes vssbinfetch.exe) to <strong>download the required binaries from the build drop</strong> for that specific RD&rsquo;s test scenario e.g. RM.CDP.RmEqTfs will download the binaries for SPS, TFS and RMO services, whereas RM.CDP.TfsOnPrem will download the binaries for TFS on-prem respectively. These 2 tasks are highlighted below. Along the way, the RD cleans up the machine and removes old binaries.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/0638.image_5E11C81B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/0638.image_5F00_5E11C81B.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/3125.image_thumb_26CB40E0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/3125.image_5F00_thumb_5F00_26CB40E0.png" alt="image" width="765" height="372" border="0"></a></p><p>4. Next, it <strong>deploys the required services and test dlls</strong> onto the machine e.g. &ldquo;tfat&rdquo; is an internal tool that installs TFS on-prem on the machine.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/4478.image_7D56FF9F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/4478.image_5F00_7D56FF9F.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/0458.image_thumb_3433E497.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/0458.image_5F00_thumb_5F00_3433E497.png" alt="image" width="765" height="384" border="0"></a></p><p>5. Finally, it sets up the test environment file and <strong>calls the Visual Studio Test task</strong> (or VsTest task, which is our favorite task <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/0385.wlEmoticon-smile_51F4ADAF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/0385.wlEmoticon_2D00_smile_5F00_51F4ADAF.png" alt="Smile">). This publishes the test results under the title &ldquo;TfsOnPrem&rdquo;.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8463.image_0816E7A6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8463.image_5F00_0816E7A6.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5270.image_thumb_57EF9CE2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5270.image_5F00_thumb_5F00_57EF9CE2.png" alt="image" width="766" height="366" border="0"></a></p><p>6. Typically, each RD completes after the &ldquo;Pause agent on test failure&rdquo; task, and some optional clean up at the end. The Pause task is usually disabled, and I&rsquo;ll talk more about this in my next blog post.</p><h3>Analyzing test results</h3><p>As devs make their checkins, it is fairly straightforward to track who has caused regressions e.g. in the screenshot below, some test began failing after build VSO.RM.CI_rmmaster_20151231.5. Double-clicking on the highlighted release takes us into the Release Summary page:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5040.image_59BFF2A9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5040.image_5F00_59BFF2A9.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5008.image_thumb_2BD530A2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5008.image_5F00_thumb_5F00_2BD530A2.png" alt="image" width="768" height="450" border="0"></a></p><p>We then navigate to the Test Results section of the Release Summary page, and notice that 2 UI tests have begun failing after this checkin. Clicking on the test link highlighted below takes us to the Test hub:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/2134.image_4FFD1BE2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/2134.image_5F00_4FFD1BE2.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/5857.image_thumb_3D48222B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/5857.image_5F00_thumb_5F00_3D48222B.png" alt="image" width="759" height="193" border="0"></a></p><p>Going to the &ldquo;Test Results&rdquo; sub-tab gives us a great starting point to drill deeper into the failures:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/3482.image_184A61B2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/3482.image_5F00_184A61B2.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/6215.image_thumb_4F2746A9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/6215.image_5F00_thumb_5F00_4F2746A9.png" alt="image" width="765" height="296" border="0"></a></p><p>The logs for the tests are available in the &ldquo;Run summary&rdquo; sub-tab.</p><p>We can also drill down further into the commits that went into that release (to correlate why they might have caused the regression) by going to the Commits tab in the Release Summary. For example, the screenshot below indicates that some UI changes went into this checkin, which might explain the 2 failing UI tests.</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/6177.image_7C3C3377.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/6177.image_5F00_7C3C3377.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1108.image_thumb_61066B27.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1108.image_5F00_thumb_5F00_61066B27.png" alt="image" width="770" height="237" border="0"></a></p><h3>Benefits of using RM for testing</h3><p>Using RM for test automation gives us the following benefits:</p><p>(1) We are able to run all the test suites in parallel to get a quick turnaround time for our build validation.</p><ul>
<ul>
<li>Further, we can target the longest running RDs, and add more agents for those test suites to get more parallelism e.g. we have 2 CI machines i.e. &ldquo;RmCdpCapability=CI&rdquo;, and plan to add another machine for RM.CDP.RmEqTfs (since that takes the longest time to run).</li>
</ul>
</ul><p>(2) This setup lends itself to easy testing of different branches: While we have CI set up for our feature branch (features/rmmaster), we can as easily queue a build off a release branch e.g. releases/M92 in the screenshot below. When the build completes, it will trigger the same RM.CDP.* RDs against the bits from this release branch.</p><ul>
<ul>
<li>This branch-wise flexibility can be further extended to the following scenario: Devs can get exhaustive testing on their code before checking in (typically done by devs when they have a big set of changes going in) e.g. /users/rahudha/rifi branch highlighted below. The key here is that devs can achieve this without the overhead of setting up any test infra on their dev boxes, by just re-using the team&rsquo;s resources.</li>
</ul>
</ul><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/1258.image_49DAF0A9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/1258.image_5F00_49DAF0A9.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/6011.image_thumb_12283679.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/6011.image_5F00_thumb_5F00_12283679.png" alt="image" width="770" height="550" border="0"></a></p><p>(3) We can run the same tests in production that we run in our test automation: Since we deploy to prod using RMO (yes, we deploy RMO using RMO <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/0385.wlEmoticon-smile_51F4ADAF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/0385.wlEmoticon_2D00_smile_5F00_51F4ADAF.png" alt="Smile">), we can pretty much use the same set of test tasks to test our production deployment also.</p><p>(4) Since the same set of bits get run through all the test suites, and it becomes easy to answer the question: &ldquo;Whats the quality of a build?&rdquo; We usually want this question answered before pushing a build into production. The screenshot below shows the simple query we run for this:</p><p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/0181.image_239B2802.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/0181.image_5F00_239B2802.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/70/15/metablogapi/8037.image_thumb_7373DD3E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-70-15-metablogapi/8037.image_5F00_thumb_5F00_7373DD3E.png" alt="image" width="766" height="499" border="0"></a></p><p>(This experience will become more integrated into the Release Summary page over the next few months.)</p><h3>Conclusion</h3><p>We started off using RMO to test our development processes purely as a dog-fooding exercise. Over time, however, we found this to be significantly better than the earlier testing infra we used. The devs in the team love the fact that they can test their big changes without going through the headache of setting up the test environment locally.</p><p>Now you have some insight into how the RM team uses RM for its test automation. Hopefully this gives you some ideas that will help you set up your own test automation.</p><p>In the <a href="https://blogs.msdn.com/b/abhishea/archive/2016/01/04/how-we-use-the-release-management-for-our-test-automation-part-2.aspx">next part of this blog</a>, I have talked a bit about some of the design choices / challenges we encountered while setting up our RDs, and how we addressed them.</p><p>Edit (3/23/2016): RMO has now added support for running environments in parallel with deployment conditions. &nbsp;We have taken advantage of this to move out test automation to a single RD with multiple environments. &nbsp;I have blogged about that <a href="https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/23/using-parallel-environments-and-release-promotion-in-test-automation/">here</a>.</p></p>
]]></content:encoded>
    </item>
  </channel>
</rss>