开发者

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

开发者 https://www.devze.com 2023-03-19 00:16 出处:网络
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.

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 开发者_JAVA技巧on how to do the setup.

thanks!


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 :)


You might want to take a look at this Jenkins plugin:

https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin

We've been using it with reasonable success.

0

精彩评论

暂无评论...
验证码 换一张
取 消