Using Bitrise with inner modules in Android


I have an Android library with multiple modules in a structure like this:

:library (root, contains gradlew, settings.gradle etc)
⠀⠀⠀|-:module (own build.gradle)
⠀⠀⠀|-:another-module (own build.gradle)

How can I use Bitrise to test and display test results for this case? Using the Android Unit Test step, I tried specifying the inner modules, but Bitrise says it did not find them. I also tried to change the project’s location, but it tried to use the Gradle wrapper in that location (even though I set the path to the root directory), which fails.

I also tried running a script and using the Gradle Unit Test step. While it worked, the JUnit test results were not displayed in the Test Reports add-on. Maybe it isn’t supported, though.

Hy @dicksson.oliveira👋

Could you please send us the url of a build with this issue please?
also the test result add-on tab is for the [BETA] Virtual device test for Android step, the Junit and normal unit test results will be in the Apps & artifacts tab, if you have a Deploy to step in the workflow :upside_down_face:

Hi @fehersanyi-bitrise ,

got it! I haven’t tried the Virtual Device Test step yet, I wanted to set up unit testing first.

Not sure if you’ll be able to see it, as it’s a private project, but here ya go:

Basically, the Android Unit Test step cannot find the inner module, no matter how I specify it (module, library:module etc).

Hello @dicksson.oliveira

Could you try a build in which you don’t specify the module and the variant? :thinking:
I think that way the step will run every test in the project

@fehersanyi-bitrise, trying with no module/variant gives a weird result: one of the variants (not debug/release) lists the inner modules over 200 times each. The build ID is d1963189bdef97a6.

Specifying the debug variant does run the gradle tasks, but the tests in inner modules are not executed. The build ID for this one is 94c16479d03934bc.

Guess I can modify the build.gradle to make this task execute the inner tasks, but apparently Bitrise is not able to identify them.

Hey @dicksson.oliveira!

Could you send us a link instead and allow Support Access for us? We’d run a few tests in attempt to get to the bottom of the behaviour - as long as that is okay with you

Hey @dicksson.oliveira

Did you find any solution for your question? I am also facing the same problem

Hey guys, sorry for the late reply.

@saikrupacg, I ended up making the root testDebugUnitTest task depend on the inner modules’ testDebugUnitTest task, and setting the Android Unit Test step’s module to the root module.

@bitce, here’s a link to a build:

In the Android Unit Test step, you can see that the root module is being listed as a variant, with the inner modules being listed over 200 times.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.