Setting Up Testdroid Products with Jenkins CI

Setting up Continuous Integration with Bitbar Testing

Dear Testdroiders,

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!

jenkins-ci

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.

Manage-Jenkins-Manage-Plugins-Testdroid

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.

Screen Shot 2015-11-18 at 2.43.27 PM

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.

Screen Shot 2015-11-18 at 2.41.58 PM

 

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:

Screen Shot 2015-11-18 at 3.00.20 PM

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.

API CALL
Jenkins is polling Testdroid Cloud for the results. Test results are fetched from Testdroid Cloud to Jenkins workspace after all your tests are finished.

Screen Shot 2015-11-18 at 3.06.04 PM
HOOK URL
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.

RiC-Hook RiC-API-02

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!

  • Jukka R

    Would be nice if you had update site URL to provide so that plugin updates could be detected. The Jenkins I have access to does is behind proxy that does not even allow uploading file of that size (7+MB) .

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close