Produce pretty tests reports with the "Gradle Unit Test" step (same as "Android Unit Test")

Description of the feature request

Apparently the “Android Unit Test” step produces nice test reports which are browsable online (see here : Redirecting…)

Why not make “Gradle Unit Test” do it as well?

The reasons why “Android Unit Test” is not a suitable solution for my team are :

  • It seem to require one step per module => So it does not take advantage of gradle parallelization capabilities (and builds may become waaaaay longer)
  • It is not possible to run a gradle command line like “gradle testAllMyModules” in this step but it rather needs a manual build modification each time a new module is added to the project (which is error prone)

Use case / for what or how I would use it

Visualizing in a an online user-friendly report the reason why a build step “Gradle Unit Test” may have failed

Thank you for the feature request! :upside_down_face:

Hey, I looked into the “Android Unit Test” step (here : https://github.com/bitrise-steplib/bitrise-step-android-unit-test/blob/master/main.go) and the good news is most of the code should be reusable to make the “Gradle Unit Test” test-add-on compatible !

It’s the first time I read GoLang but from what I grasped, algorithm is :

  • Find all report_path_pattern/TEST-*.xml files
  • Build unique export directory names from those files
  • Add some Json description files
  • Export them into $BITRISE_DEPLOY_DIR
    Let the test-add-on do the rest of the magic.

Given that “Gradle Unit Test” also produces TEST-*.xml it should be feasible !

3 Likes

Hi!
A bit more why Android step is not enough for my project:

  • It doesn’t test pure-java module as there are no variants. It evaluates to Classes variant that runs my domain:testClasses task (which only compiles) rather then domain:test .
  • I’d like a single task for all of the tests to speed up things as three Android tests task in a row do not share work done already.
  • I’d like to control tests to run combining gradle tasks inside project build.gradle rather than step config - it’s more robust for me and makes possible for branch-to-branch different test scenarios
3 Likes

Hi motorro, I have the same use case as you, have you come up with a step that runs your unit tests for pure java modules? Thanks, I appreciate it!

Hi qracledev! Actually no. It is not that critical for me as any test error requires some efforts locally so I just made test task log output a bit more informative and look through build log for error.

Ah I see, thanks !

Hey good folks :slight_smile:
This feature would be very helpful for us as well.
We’re also using the “Gradle Unit Test” step, as the Android Unit Test doesn’t run tests in non-android modules.
Any news if there’re plans to support the functionality proposed in the original post?

Hey everyone!

I’m Michal, the Product Manager on Bitrise’s Core CI team. We are working on features to make finding and solving test failures easier for you. This is one is a feature request we’d like to take a good look at.

I would like to invite you to join us for an interview with me and my team. We’d like to give you an early preview on what we are planning, ask for your feedback on our plans, and let you participate in early testing of our improvements.

How is this going to work?

  • Once you sign up, we will invite you for a short introduction/discovery interview.
  • We will discuss your current difficulties and expectations with finding and interpreting test results
  • We’ll show you a prototype and ask you to give us feedback on it

If you’re interested, sign up and we’ll get back to you.