Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Running Monkop Tests On Travis CI

DZone's Guide to

Running Monkop Tests On Travis CI

How to integrate the free Monkop CLI tool with Travis CI to start automatically deploying your software after your builds go through CI tests.

· DevOps Zone
Free Resource

The Nexus Suite is uniquely architected for a DevOps native world and creates value early in the development pipeline, provides precise contextual controls at every phase, and accelerates DevOps innovation with automation you can trust. Read how in this ebook.

When we use Travis CI or other continuous integration tools, we start looking at automation, notifications, and testing as part of our daily tasks. After a short period, you’ll surely start to wonder: “How did I survive without this process before?” Basically, devs love CI tools because they can sleep better at night eliminating hassles often caused by long integration cycles: broken builds, manual merging hell, and regressions in a huge fragmented world.

Adding Monkop CLI after your build process will provide your team a dedicated bot that automatically installs your app on all relevant real devices (including different OS versions and screen sizes) and starts playing with it, looking for crashes and other common problems.

Moreover, the ability to know what is happening in the jungle of mobile hardware in terms of resource consumption and bottlenecks is crucial. Gathering this information early on in each development cycle helps us to avoid bad UX. That’s just one more benefit of adding Monkop CLI to your testing.

Setting Up Monkop for Travis

1. Enable Monkop’s API in your Add-ons section: https://console.monkop.com/addOns.xhtml 

image

2. Add Monkop APIKey as a Travis-CI Variable in Repository Settings named monkopapikey

image

3. Update your Travis file .travis.yml. We recommend using Monkop-cli in the after_success section, but each DevOp designs his or her own pipeline:

Image title

Note: According to travis-ci documentation, if Monkop-cli is invoked from a script step, any failure of the apk processing will make your travis build fail. On the other hand, if you set up Monkop-cli on after_success or after_script step, your Monkop tests will never affect your build result.

Pull Request Integration for GitHub

Monkop has a bot that contributes to your build steps and documentation with test results by automatically tagging / commenting on your pull requests inside your GitHub repository. All you need to do is give access to Monkop inside your GitHub account. 

Using the OAuth Authentication Method

1. Enable github add-ons in the Monkop console and authorize to give Monkop these permissions:

image









2.  You will be redirected to GitHub in order to authorize application:

image

3. Then you will see your GitHub account info inside Monkop’s console: 

image

Now all pull-requests in GitHub can be tagged by Monkop

image

To revoke Monkop privileges, click the revoke access button in GitHub add-ons section in the Monkop console. This will redirect you to GitHub settings so you can revoke access anytime: 

image

As a result you will be adding Monkop to your pipeline, enabling your team to have each build under test using real devices, tagged and documented with just a few steps, running smoke / sanity tests, evaluating mobile side performance or running even more complex tests. 

The DevOps Zone is brought to you in partnership with Sonatype Nexus.  See how the Nexus platform infuses precise open source component intelligence into the DevOps pipeline early, everywhere, and at scale. Read how in this ebook

Topics:
android ,android app developers ,android apps development ,android tips ,travis-ci ,travis ci ,github

Published at DZone with permission of Fabian Baptista. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}