Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android InstrumentationTestRunner XML output for Hudson ingestion

I have an Android test project that I'd like to link into Hudson, but I haven't found a way to output the test results as XML instead of text. Does anyone know if there's an easy way to do this already?

-Dan

like image 769
Dan Avatar asked Apr 01 '10 17:04

Dan


People also ask

Why do you use the Android Junitrunner when running UL tests?

When you use AndroidJUnitRunner to run your tests, you can access the context for the app under test by calling the static ApplicationProvider. getApplicationContext() method. If you've created a custom subclass of Application in your app, this method returns your custom subclass's context.

What is testInstrumentationRunner Androidx test runner AndroidJUnitRunner?

Earlier in the module's build.gradle file, we have a testInstrumentationRunner statement: testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" (from ToDoTests/build.gradle) This tells Android how to run our JUnit instrumented tests. JUnit uses “runner” classes for this role, and androidx.

What is an Android instrumentation test?

Instrumented tests run on Android devices, whether physical or emulated. As such, they can take advantage of the Android framework APIs. Instrumented tests therefore provide more fidelity than local tests, though they run much more slowly.


1 Answers

FYI, for anyone else who happens to stumble on this question. I've created a new TestRunner that you can use in your Android test projects that will output your test results in XML readable by Hudson (and probably any other CI app). You can read about it here: http://droiddudes.com/2010/04/07/athenatestrunner/ or just grab it from here: http://github.com/dwatling/athena

like image 96
Dan Avatar answered Oct 12 '22 22:10

Dan