{"id":14093,"date":"2016-03-23T00:26:00","date_gmt":"2016-03-23T00:26:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/?p=14093"},"modified":"2019-02-14T17:36:14","modified_gmt":"2019-02-15T01:36:14","slug":"using-parallel-environments-and-release-promotion-in-test-automation","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/using-parallel-environments-and-release-promotion-in-test-automation\/","title":{"rendered":"Using parallel environments and release promotion in test automation"},"content":{"rendered":"<p>I had earlier <a href=\"http:\/\/blogs.msdn.com\/b\/abhishea\/archive\/2016\/01\/04\/how-we-use-release-management-for-our-test-automation-part-1.aspx\">blogged<\/a> about how we use Release Management to run our test automation in the RM team. Since then, the RM service or Release Management Online (RMO) has added support for parallel environments (with the Sprint 94 payload (also called M94)), and we have tweaked our automation pipeline to leverage this feature. <\/p>\n<p>We now have all our test environments in a single Release Definition (RD), and the deployment condition for all of them is \u201cAfter release creation\u201d.&nbsp; Note that you can bring up the deployment conditions by clicking \u201c\u2026\u201d on the Environment \u2013&gt; Deployment conditions.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/clip_image00214.jpg\"><img decoding=\"async\" title=\"clip_image002\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/clip_image002_thumb10.jpg\" width=\"797\" height=\"417\"><\/a><\/p>\n<p>This gives us much nicer view for monitoring how stable the builds have been over time.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/image508.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/image_thumb378.png\" width=\"773\" height=\"501\"><\/a><\/p>\n<p>In addition, we also use release promotion to test our AtDtMismatch scenario.&nbsp; Specifically, the AtDtMismatch environment tests the scenario of the Application Tier (AT) being at a different version from the Data Tier (DT) e.g. AT could be at Sprint 97 (M97) and DT could be at M96.&nbsp; <\/p>\n<p>In the AtDtMismatch environment, we install SPS, TFS and RMO from the previous sprint e.g. M96, run the RmEqTfs test suite, then upgrade the RMO AT only to M97, run the RmGtTfs test suite, and finally upgrade the RMO DT to M97, and again run the RmGtTfs test suite.&nbsp; It therefore makes sense to promote a release to the AtDtMismatch environment only if the basic RmEqTfs, RmGtTfs and dev-fabric upgrade environments are green.&nbsp; This can now be achieved by clicking \u201c\u2026\u201d on the AtDtMismatch Environment \u2013&gt; Deployment conditions \u2013&gt; After successful deployment on another environment..<\/p>\n<p>Background notes: <\/p>\n<p>(1) RMO has a dependency on the SPS and TFS platform services.&nbsp; <\/p>\n<p>(2) RmEqTfs test suite tests the scenario where the RMO version is EQual to the TFS and SPS version e.g. all of them are at M96.&nbsp; <\/p>\n<p>(3) RmGtTfs test suite tests the scenario where the RMO version is GreaTer than the TFS and SPS version e.g. RMO could be at M97 and TFS and SPS could be at M96 <\/p>\n<p>(4) Dev-fabric upgrade test suite tests the scenario of RMO upgrade.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/image505.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/image_thumb375.png\" width=\"762\" height=\"547\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>At runtime, the AtDtMismatch environment gets deployed only when RmEqTfs, RmGtTfs and DevFabricUpgrade are green<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/image627.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/image_thumb489.png\" width=\"779\" height=\"433\"><\/a><\/p>\n<p>You can get a nice overview of the quality of your build in the Test tab of the Release: Open the Release \u2013&gt; Test \u2013&gt; select \u201cAll\u201d in the environment dropdown \u2013&gt; select \u201cAll\u201d in the Outcome dropdown \u2013&gt; click \u2018-\u2018 (Collapse All).<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/image506.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/image_thumb376.png\" width=\"770\" height=\"438\"><\/a><\/p>\n<p>You can then drill down into the failed tests to see when they began failing etc.<\/p>\n<h3>Converting multiple RDs into a single RD with multiple environments<\/h3>\n<p>I had earlier blogged about the various release definitions RM.CDP.* we use for our test automation <a href=\"http:\/\/blogs.msdn.com\/b\/abhishea\/archive\/2016\/01\/04\/how-we-use-release-management-for-our-test-automation-part-1.aspx\">here<\/a>, and I thought I should write a bit about the process we used to convert these release definitions into a single release definition (named RM.CDP) with multiple environments.&nbsp; Lets take the example of the erstwhile RM.CDP.TfsOnPrem release definition being converted into an environment in the new RM.CDP release definition.&nbsp;&nbsp; Note that after the conversion, we added 2 more environments \u2013 MmsLoadTest and AtDtMismatch \u2013 into which we promote the release as required. <\/p>\n<p>1) In RM.CDP.TfsOnPrem, save the environment as an environment template:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/clip_image0083.jpg\"><img decoding=\"async\" title=\"clip_image008\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"clip_image008\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/clip_image008_thumb3.jpg\" width=\"792\" height=\"496\"><\/a><\/p>\n<p>2) Change the trigger from Continuous Deployment to Manual for RM.CDP.TfsOnPrem since we want to effectively deactivate it:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/clip_image0104.jpg\"><img decoding=\"async\" title=\"clip_image010\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"clip_image010\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/clip_image010_thumb4.jpg\" width=\"783\" height=\"536\"><\/a><\/p>\n<p>3) Add an environment into RM.CDP based on this template: Edit RM.CDP \u2013&gt; Add Environment \u2013&gt; select \u201cCustom\u201d tab of Deployment Templates \u2013&gt; select the template that you just saved off.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/clip_image0122.jpg\"><img decoding=\"async\" title=\"clip_image012\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"clip_image012\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/clip_image012_thumb2.jpg\" width=\"774\" height=\"399\"><\/a><\/p>\n<p>4) So far, so good. Now the painful part: You need to manually ensure that all the variables that were present in RM.CDP.TfsOnPrem are also available in RM.CDP. We just trundled through all the variable of RM.CDP.TfsOnPrem and added them to RM.CDP. Variables that had pretty much the same value across all the test environments ended up Release-level variables, while variables that had different values for each test environment ended up being Environment-level variables.<\/p>\n<p>Here is a view of the Release-level variables of RM.CDP:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/image530.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/image_thumb399.png\" width=\"793\" height=\"382\"><\/a><\/p>\n<p>Here\u2019s a view of the Environment-level variables of RM.CDP:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/image532.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/image_thumb400.png\" width=\"792\" height=\"296\"><\/a><\/p>\n<p>A quick note on how to add Environment-level variables. Its not through the Configuration tab, but rather through the Environment option i.e. Click \u201c\u2026\u201d on the environment \u2013&gt; Configure variables:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/clip_image0182.jpg\"><img decoding=\"async\" title=\"clip_image018\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"clip_image018\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/clip_image018_thumb2.jpg\" width=\"804\" height=\"407\"><\/a><\/p>\n<p>5) Finally, we renamed RM.CDP.TfsOnPrem to RM.LegacyCDP.TfsOnPrem, and we don\u2019t use it any more. After a few months of disuse, we expect to delete it.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/clip_image0201.jpg\"><img decoding=\"async\" title=\"clip_image020\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"clip_image020\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/03\/clip_image020_thumb1.jpg\" width=\"799\" height=\"650\"><\/a><\/p>\n<h3>Looking forward<\/h3>\n<p>The next feature that I am really looking forward to is support for branch filters in RMO, so that we can easily find the quality of a build in a particular branch.&nbsp; To get this right, we need to normalize the branch data that is stored in the DB and then expose it in the UI.&nbsp; Hopefully we will get this feature out in a few sprints, at which time I will blog again on how we use it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had earlier blogged about how we use Release Management to run our test automation in the RM team. Since then, the RM service or Release Management Online (RMO) has added support for parallel environments (with the Sprint 94 payload (also called M94)), and we have tweaked our automation pipeline to leverage this feature. We [&hellip;]<\/p>\n","protected":false},"author":123,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[226,1],"tags":[],"class_list":["post-14093","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ci","category-devops"],"acf":[],"blog_post_summary":"<p>I had earlier blogged about how we use Release Management to run our test automation in the RM team. Since then, the RM service or Release Management Online (RMO) has added support for parallel environments (with the Sprint 94 payload (also called M94)), and we have tweaked our automation pipeline to leverage this feature. We [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/14093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/123"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=14093"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/14093\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=14093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=14093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=14093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}