Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Testing an Android application in Bamboo, Hudson, or any CI servers

it seems that running an Android Test requires that a device or emulator is present. even this article: http://code.google.com/p/the-missing-android-xml-junit-test-runner/ requires it.

does anyone able to setup Android Tests in a CI server? kindly enlighten me on how to do the setup.

thanks!

like image 341
firnnauriel Avatar asked Jul 07 '11 07:07

firnnauriel


1 Answers

Unfortunately I have not finished this task yet. But think I'm close to it. We use Jenkins as an integration server.

Android emulator has a nice option

-no-window

I managed to run emulator with this option on our Ubuntu server without any X-server.

So I'm going to implement the following steps:

  1. Create a dedicated AVD for running tests (not sure about their count, but we start with one AVD and one Android project and one job :) )
  2. The first build step will be to run an emulator with -no-window
  3. The second step - install application packages using adb. Here is one pretty feature of adb install command: it will finish after installation is completed only. So we don't worry about long emulator startup.
  4. And the last step - run tests using

    adb shell am instrument

There is also a task of gathering JUnit reports. I have not touched it yet... But I'm sure it's possible :)

like image 161
Roman Mazur Avatar answered Oct 19 '22 23:10

Roman Mazur