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

test
gradle
android
#1

Description of the feature request

Apparently the “Android Unit Test” step produces nice test reports which are browsable online (see here : https://devcenter.bitrise.io/testing/test-reports/)

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

0 Likes

Separate exporting test results for Test Reports from test steps as an independent step
#2

Thank you for the feature request! :upside_down_face:

0 Likes

#3

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 !

2 Likes