Alex Lonyay

Alex Lonyay

  • NA
  • 123
  • 9.7k

Need help in migrating CruiseControl.Net to Jenkins for MSTest

Apr 9 2021 4:16 AM
Currently in our company we are executing tests from CCNet (in Automation VM) by specifying different build arguments, however I feel it is now best to migrate to better automation server which is Jenkins
 
I am new to Jenkins world however I started installing the jenkins (though had issue in starting the Jenkins Service, later found it was due to JDK version issue)
 
But now I have installed all the needed plugins(GIT - for gitlab repository, MSBuild and MStest)
 
But I do not know how do I specify build arguments in Jenkins the way we do it in CCNet.config files
 
Here is the CCNet Config File that we use to Force the build
  1. <project name="AutoTests - Payments" queue="Q13">    
  2.  <triggers>    
  3.      <!--<scheduleTrigger time="03:30" buildCondition="ForceBuild" name="Scheduled" />-->    
  4.   </triggers>    
  5.    <workingDirectory>D:\GIT-TA</workingDirectory>    
  6.   <artifactDirectory>D:\DEV\deploy\AutomatedTest\BuildLogs\BasicTests.Payments</artifactDirectory>    
  7.   <category>AutomatedTest</category>    
  8.   <modificationDelaySeconds>60</modificationDelaySeconds>    
  9.   <labeller type="defaultlabeller">    
  10.      <prefix>0.1.</prefix>    
  11.      <incrementOnFailure>true</incrementOnFailure>    
  12.      <labelFormat>000</labelFormat>    
  13.   </labeller>    
  14.   <tasks>    
  15.      <exec>    
  16.         <executable>D:\MSTestExtended\Runner.exe</executable>    
  17.         <buildArgs>run-tests /project:payments /retriesCount:1</buildArgs>    
  18.         <buildTimeoutSeconds>6800</buildTimeoutSeconds>    
  19.         <successExitCodes>0</successExitCodes>    
  20.      </exec>    
  21.   </tasks>    
  22.   <publishers>    
  23.      <merge>    
  24.         <files>    
  25.            <file>D:\DEV\deploy\AutomatedTest\Results\TestPublish\BasicTests.Payments_Rerun.trx</file>    
  26.         </files>    
  27.      </merge>    
  28.      <xmllogger />    
  29.   </publishers>  
Likewise we have many projects and then we do the build for that, but now in Jenkins I feel little lost - how do I configure it to with my according
 
Note: IN CCNet - it used to pick the branch whichever is checkout in VM, but I see in Jenkins we also need to manually setup the branch name; so in that case also Is there a way to specify the branch during build time?
 
And if I can add the selection for run-tests /project:payments /retriesCount:1 - when we initiate the jenkins build, it will aske to select the arguments
 
Can someone help me in that to understand the Jenkins way of doing this?