Skip to content

[Android] Support "com.android.test" module #974

@dongyi-chun

Description

@dongyi-chun

Describe the bug
I'm currently using a test module in my project which is officially supported by Google.
https://developer.android.com/studio/test/advanced-test-setup#use-separate-test-modules-for-instrumented-tests

When I configure Marathon with a current project, all of test modules are not supporting marathon gradle test command, seems like it does not compatible with this type of modules.

I tried to find any relevant issues in the history but I can't.

To Reproduce
Steps to reproduce the behaviour:

  1. Multi module Android project with test module.
  2. Try to run ./gradlew :app_test:marathonDevelopmentDebugAndroidTest for example, but it complains cannot find a gradle task even though I can see a marathon related tasks.

Expected behavior
Should support test module for given gradle command: marathonDevelopmentDebugAndroidTest

Logs and reports

FAILURE: Build failed with an exception.

* What went wrong:
Cannot locate tasks that match ':app_test:marathonDevelopmentDebugAndroidTest' as task 'marathonDevelopmentDebugAndroidTest' not found in project ':app_test'.

* Try:
> Run gradlew tasks to get a list of available tasks.
> For more on name expansion, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:name_abbreviation in the Gradle documentation.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Devices (please complete the following information):

  • N/A, general issue

Additional context

  • Running ./gradlew :app_test:marathon triggers some tasks but it saying all test cases incomplete and eventually all test cases are flagged as failed.
  • Result of ./gradlew :app_test:tasks | grep marathon
marathonDevelopmentDebugGenerateMarathonfile - Generates Marathonfile for 'developmentDebug' variation
marathonProductionDebugGenerateMarathonfile - Generates Marathonfile for 'productionDebug' variation
marathon - Runs all the instrumentation test variations on all the connected devices
marathonDevelopmentDebug - Runs instrumentation tests on all the connected devices for 'developmentDebug' variation and generates a report with screenshots
marathonProductionDebug - Runs instrumentation tests on all the connected devices for 'productionDebug' variation and generates a report with screenshots
  • connectedDevelopmentDebugAndroidTest working

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions