On daily basis, many of you are using Jenkins as your Continuous Integration / Continuous Delivery system while developing your mobile apps and games. We’ve had a Jenkins support from the beginning of Testdroid Cloud and have constantly made improvements and enhancements in it to make your local test environment work even more seamlessly with our Android and iOS devices. In fact, Jenkins has been used quite a lot to build and test your app and game projects.
In case you are new to Jenkins or currently don’t have it in use, I’ll walk you through the installation and how to configure things with Testdroid Jenkins CI / continuous integration plugin for real devices. And this will only take few minutes!
Installing and Configuring Jenkins CI Continuous Integration
Jenkins is the most popular continuous integration used in mobile software development, and in order to make it easy and seamless for you to integrate your build and testing environment with any of Bitbar Testing products, we have developed the Testdroid Run in Cloud Plugin.
Jenkins offers lots of great features out of the box, and many more can be added through additional plugins. There are variety of options for downloading and installing Jenkins:
- You can select of these platform-specific installers directly from the Jenkins site.
- You can also download jenkins.war directly from this link and launch it by executing the following command:
java -jar jenkins.war
- If you use containers that support JSP 2.0 or later, you can deploy this jenkins.war file the same way. Check more information about certain container-specific installation here.
Installation is easy, you don’t need additional tools to be installed, no database and Jenkins site have lots of different native packages and installers available.
Instructions for Testdroid Run in Cloud Plugin Configuration
Once you have Jenkins properly installed, download Testdroid Run In Cloud Plugin and open your Jenkins main page. Then navigate in Jenkins ‘main menu’ to Manage Jenkins -> Manage plugins to start configuring your plugins.
Click Advanced -> Upload Plugin to install recently downloaded Testdroid Run in Cloud Plugin. After you’ve installed this plugin, restart Jenkins and get back to start the configuration of this plugin. The plugin adds a new build step what can be used in any Jenkins job to launch builds in Testdroid Cloud and/or Testdroid Privatecloud.
Click Manage Jenkins -> Configure System (on top of that list) and you’ll find a Testdroid Cloud section where you can enter your login credentials (email and password) and then press Authorize button to validate your account details and access.
Run In Cloud – Build Step(s) for Android and iOS
To get started, you can open existing Jenkins job or create a new one. From the Job Configuration -> Build select Run tests in Testdroid Cloud.
Now you can select your target project (must exist in Testdroid Cloud) and enter the name for your test run. The next ones are the Application and Test where you specify the files that will be uploaded in Testdroid Cloud. If you need to further customize project settings click the “Edit project on Testdroid Cloud website” button and it will open Testdroid Cloud webpage with access to configure your project details.
Furthermore, you can configure annotations in the following section. In this blog post the use of annotations is described in details and explained how to use annotations with Run-in-cloud plugin to execute subsets of tests. The actual annotation information can be configured with the following section:
Notifications from Testdroid Cloud about Test Run
There’s two simple ways to get notifications from Testdroid Cloud that your test runs are finished. Whether you are running just on few devices or hundreds different devices simultaneously, both of these ways provide extremely easy and straightforward way to get results back to your Jenkins environment.
Jenkins is polling Testdroid Cloud for the results. Test results are fetched from Testdroid Cloud to Jenkins workspace after all your tests are finished.
Testdroid Cloud sends
post message to the specified URL when test run is finished. Testdroid Run in Cloud Plugin listens these messages in default location and then downloads results when
post message arrives. User can change the URL in the following section:
POST message body: testRunId=%s&projectId=%s&status=FINISHED
Note! This requires your HOOK URL is reachable from Internet e.g. Jenkins instance can be reached from Testdroid Cloud.
In addition to hook URL, you can set up specific folder where results and data will be stored, timeout for finalization message (timeout for results) as well as if you want to include screenshots and other graphical data from your test runs.
Happy Testing with Jenkins CI and Testdroid!