Continuous Integration and Testing Configuring Bamboo, Hudson, and TestMaker Operate PushToTest TestMaker tests from Continuous Integration environments. PushToTest checks TestMaker compatibility with Hudson and Bamboo. Product Version Details Setup Build to run tests in Hudson (Windows - localhost) Setup Build to run tests in Hudson (Linux - localhost) Setup Build to run tests in Bamboo (Windows - localhost) Setup Build to run tests in Bamboo (Linux - localhost) Setup Build to run tests in Bamboo (Atlassian/JIRA Hosted) Configure/execute ANT based targets (Atlassian/JIRA Hosted) 1. Product Version Details TestMaker Version : 5.5 RC3 Bamboo Version : 2.6.2 (Standalone) Hudson Version : 1.374 Java Verison : 1.6 (1.6.18 or later) Tomcat Verison : 6.0.26 (To run Hudson) 2. Setup Build to run tests in Hudson (Windows - localhost) Setup a build in Hudson Pre-requisite to execute the build Execute the build in Hudson Configure the build/test output to detect failures in Junit output Setup a build in Hudson: Hudson comes with a web archive file (hudson.war). You need a web server (tomcat/jboss/jetty) to run Hudson. Tomcat Console (runs in 8090 http port) Page 1 of 52
Hudson Home URL: http://localhost:8090/hudson/ Create New Job link to create a new Job Page 2 of 52
Click OK to proceed Page 3 of 52
You can select Source Code Management option to checkout the code from (CVS/Subversion). All the source/tests will checkout in the build workspace directory. Select Execute Windows build Command from the Build Type the following command %TESTMAKER_HOME%\TestMaker.cmd -t example_agents\ajaxriaseleniumtest_tutorial\calendar_functional_test.scenario -log-junit testreport\junitreport.xml Note: The scenario file path (example_agents\ajaxriaseleniumtest_tutorial\calendar_functional_test.scenario) and reports path (testreport\junitreport.xml ) is relative to your build workspace. Click Save. Page 4 of 52
Pre-requisite to execute the build: Create Environment variables: Create the below two environment variables in Hudson Console (Hudson -> Manage Hudson - > Configure Your System -> Global Properties) as shown below: JAVA_HOME TESTMAKER_HOME Page 5 of 52
Or you can create these two system environment variables (My computer -> Advanced -> Environment Variables) Page 6 of 52
Start TestNode: If required, start the Testmaker testnode. The current example is using the local testnode which runs in 8080 http port. Testnode console Page 7 of 52
Execute the build in Hudson: Page 8 of 52
Click on Build Now link available in the left side to start the build Page 9 of 52
Due to some reason, the first build failed, so I ran the build for the second time. You can watch the logs by clicking the build link Page 10 of 52
Click on the Console output Page 11 of 52
In the meantime, you can watch the testnode logs: Page 12 of 52
Configure the build/test output to detect failures in Junit output: Check the Publish JUnit test result report option from the Post-build Actions Note: You may not have the report file for the first time build. So, do not select this option until unless you have the report file (junitreport.xml) available in the specified directory. Click on the Test Result Page 13 of 52
Page 14 of 52
3. Setup Build to run tests in Hudson (Linux - localhost) Setup a build in Hudson Pre-requisite to execute the build Page 15 of 52
Execute the build in Hudson Configure the build/test output to detect failures in Junit output Setup a build in Hudson: Same as windows - Please refer windows section You can select Source Code Management option to checkout the code from (CVS/Subversion). All the source/tests will checkout in the build workspace directory. Select Execute Shell from the Build Page 16 of 52
Type the following command $TESTMAKER_HOME/TestMaker.sh -t example_agents/ajaxriaseleniumtest_tutorial/calendar_functional_test.scenario -log-junit testreport/junitreport.xml Note: The scenario file path (example_agents/ajaxriaseleniumtest_tutorial/calendar_functional_test.scenario) and reports path (testreport/junitreport.xml ) is relative to your build workspace. Make sure the /, $, TestMaker.sh Click Save. Pre-requisite to execute the build: Page 17 of 52
Create Environment variables: --Same as Windows But only the Path is going to change. It has to be valid unix path. Start the TestNode: --Same as Windows Execute the build in Hudson: --Same as Windows Page 18 of 52
Configure the build/test output to detect failures in Junit output: --Same as Windows 4. Setup Build to run tests in Bamboo (Windows - localhost) Setup a build in Bamboo Pre-requisite to execute the build Execute the build in Bamboo Configure the build/test output to detect failures in Junit output Setup build in Bamboo Start Bamboo Server Page 19 of 52
Launch Bamboo console in browser and login with your admin user. (By default it runs in 8085 port. So the URL would be http://localhost:8085/ ) Page 20 of 52
Click on Create Plan link (key shortcut: Alt-Shift-C) to start creating a new plan: Start filling all the details: Page 21 of 52
Source Repository Details (It supports CVS, Subversion & Perforce. But JIRA hosted bamboo only supports Subversion) Select the Ant / Command Builder type Ant Builder type Page 22 of 52
If Command Builder type is not available, click on the Add New Builder to add one. Either we can provide full path of the command or append the command path in PATH System environment variable and call the command only. Page 23 of 52
Command Builder type Requirements: Page 24 of 52
Artifacts: (No artifacts setup for this) Notification: (No notification setup for this) Page 25 of 52
Post Action: (No Post Actions setup for this) Page 26 of 52
Select the appropriate permissions: Click Save to create the plan, which will create the first build immediately. Page 27 of 52
Pre-requisite to execute the build: Create Environment variables: Create these two system environment variables (My computer -> Advanced -> Environment Variables) JAVA_HOME TESTMAKER_HOME Create one Global Variable in Bamboo administrator Console (Home -> Administration -> Global Variable) Page 28 of 52
Note : Why we need to create the TESTMAKER_HOME variable in two places? Ans: As we can not access the system enviorment variables inside bamboo. To execute the TestMaker.cmd command, we need to tell Bamboo where to lookup the command. This we can achive by setting in PATH varibale also as PATH=%PATH%;%TESTMAKER_HOME% Start TestNode: If required, start the Testmaker testnode. The current example is using the local testnode which runs in 8080 http port. Testnode console Page 29 of 52
Execute the Build plan in Bamboo When you save the build for first time, it automatically triggers the build. Page 30 of 52
Or select the build and click Run Build under Plan Actions Monitor the result in the running log. Configure the build/test output to detect failures in Junit output Page 31 of 52
Upon completion of build, you can see your report in the following section: Click Test Page 32 of 52
5. Setup Build to run tests in Bamboo (Linux - localhost) Setup a build in Bamboo Pre-requisite to execute the build Execute the build in Bamboo Configure the build/test output to detect failures in Junit output Setup build in Bamboo Start Bamboo Server Launch Bamboo console in browser and login with your admin user. -- Same as Windows Start filling all the details: Make sure the path is linux based. Select the Script Builder type Script Builder type Page 33 of 52
For default installation click next-> next and click Save/Finish to create the plan, which will create the first build immediately. Pre-requisite to execute the build: Create Environment variables: Create these two system environment variables in userʼs.profile file JAVA_HOME TESTMAKER_HOME Command to modify.profile file (if you do not have.profile file, please create a file with the name.profile) as shown below: vi ~/.profile # add the following lines at the end of the file JAVA_HOME=<<JAVA_INSTALL_PATH>> TESTMAKER_HOME=<<Testmaker_INSTALL_PATH>> export JAVA_HOME TESTMAKER_HOME Page 34 of 52
Create one Global Variable in Bamboo administrator Console (Home -> Administration -> Global Variable) Note : Why we need to create the TESTMAKER_HOME variable in two places? Ans: As we can not access the system enviorment variables inside bamboo. To execute the TestMaker.cmd command, we need to tell Bamboo where to lookup the command. Start TestNode: -- Same as Windows Execute the Build plan in Bamboo -- Same as Windows Configure the build/test output to detect failures in Junit output -- Same as Windows 6. Setup Build to run tests in Bamboo (Atlassian/JIRA Hosted) Login to JIRA System (http://pushtotest.jira.com/secure/dashboard.jspa) Page 35 of 52
Click on the It will list down all the projects with their build plans. Page 36 of 52
To create a New Build plan click Select project name, Build Plan Name and prove a unique Build plan Key. Click Next to enter source repository details: Page 37 of 52
Page 38 of 52
Page 39 of 52
Page 40 of 52
Click Save to create the plan. 7. Configure/execute ANT based targets (Atlassian/JIRA Hosted) The community version of TestMaker can have 3 different versions according to the OS. Click on any of these build link will take you to the build plan screen. Page 41 of 52
To run a new build click Run Build from Plan Actions. To Edit the plan, click Edit Plan option. Note: The Bamboo remote agent is configured in Amazon EC2. So, whenever we run a build, it checks for the agent. If not started, click on the following Run Elasitc Instance as shown below. We can start the elastic instance using other mechanism as well. Page 42 of 52
Click on State Elastic Instance link Select # of instances you want to run and then click Submit Page 43 of 52
The remote instance and then the remote bamboo agent will start automatically and the queued Build will start automatically. Page 44 of 52
Click the Build link will show you the live logs of your build. Page 45 of 52
Page 46 of 52
If the build successful, you can see the following screen. If it failed, you will get the following screen Page 47 of 52
Monitor the changes: Click on diffs will give you a clear indication of change: Page 48 of 52
Do not forget to shutdown the elastic instance which was started manually by us to run this build. Goto (Administration -> Builds -> Elastic Bamboo -> Instances) and click Shutdown or Shutdown all instances link. (http://pushtotest.jira.com/builds/admin/agent/configureagents!default.action) Click Confirm to shutdown. Page 49 of 52
Shutdown will take 30-40 secs. So, make sure it shutdown properly. ii. To build enterprise TestMaker product (Windows/Mac/Linux) Select Project Enterprise TestMaker and select the build as shown below: Repeat the same steps as described to build the Community Product. iii. To build standalone PTTMonitor (Windows (32 and 64 bit)/mac/linux) - TBD - Repeat the same steps as described to build the Community Product. iv. To build standalone Testnode (Windows/Mac/Linux) - TBD - Repeat the same steps as described for to build the Community Product. v. To Run Tests (Example Agents) Page 50 of 52
Repeat the same steps as described for to build the Community Product. vi. To deploy installers in Amazon S3 - TBD - vii. To Compiling/building EC2 AMI file - TBD - viii. Start cloud testnode Goto (Administration -> Builds -> Elastic Bamboo -> Instances) and click Start New Elastic Instances (http://pushtotest.jira.com/builds/admin/elastic/manageelasticinstances.action) Page 51 of 52
Additional documentation, product downloads and updates are at www.pushtotest.com. While the PushToTest testmaker software is distributed under an open-source license, the documenation remains (c) 2011 PushToTest. All rights reserved. PushToTest is a trademark of the PushToTest company. Page 52 of 52