Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for library projects #26

Open
trevjonez opened this issue Aug 8, 2018 · 8 comments
Open

support for library projects #26

trevjonez opened this issue Aug 8, 2018 · 8 comments
Labels

Comments

@trevjonez
Copy link

As far as I can tell this step assumes the typical apk pair or triple that you would see in an application project [main, test] or [main, test, orch]. In and module that uses com.android.library it is possible to build a single test apk which also includes the contents of the AAR library for testing.

Either I am being too lazy about reading the docs or there is not way to do this without some questionable workarounds happening.

@BirmacherAkos
Copy link
Contributor

Hi @trevjonez !

Thanks for the request.
I have made a ticket for the Tooling Team. They will check it.

@tir38
Copy link

tir38 commented Aug 31, 2018

I don't remember if I read this somewhere but I gave it a try and it has been working for us for about 3-4 months running connectedDebugAndroidTest on a library module. You just have to add a step to actually build the library module test apk. For our api library module:

  - gradle-runner:
        inputs:
        - mapping_file_include_filter: ''
        - apk_file_include_filter: ''
        - gradle_task: api:assembleDebugAndroidTest
        title: Build api module instrumentation test apk
    - virtual-device-testing-for-android:
        inputs:
        - test_devices: "$INSTRUMENTATION_DEVICE_LIST"
        - test_type: instrumentation
        title: Run api module instrumentation test on virtual devices

Just know that if you are going to run this for a library module and an app module in the same workflow you may experience the problem I faced in #24

@GEllickson-Hover
Copy link

I'm wondering if this is still in consideration or if there's a simple workaround. I see this issue thread relating to the Android Build for UI Testing step.

@bitrise-coresteps-bot
Copy link
Contributor

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant.
This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it.
If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

@koral--
Copy link

koral-- commented Sep 24, 2021

This issue is still unresolved and should not be marked as stale automatically.

@hb0
Copy link

hb0 commented Sep 27, 2021

I don't remember if I read this somewhere but I gave it a try and it has been working for us for about 3-4 months running connectedDebugAndroidTest on a library module. You just have to add a step to actually build the library module test apk. For our api library module:

  - gradle-runner:
        inputs:
        - mapping_file_include_filter: ''
        - apk_file_include_filter: ''
        - gradle_task: api:assembleDebugAndroidTest
        title: Build api module instrumentation test apk
    - virtual-device-testing-for-android:
        inputs:
        - test_devices: "$INSTRUMENTATION_DEVICE_LIST"
        - test_type: instrumentation
        title: Run api module instrumentation test on virtual devices

Just know that if you are going to run this for a library module and an app module in the same workflow you may experience the problem I faced in #24

You also have to link a random apk next to the test apk generated or else virtual-device-testing-for-android fails, e.g. this small apk or one you generated from a sample app of yours:

Add this step between assembleDebugAndroidTest and virtual-device-testing-for-android:

   - script@1:
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -e
            set -x
            wget https://some_place_you_uploaded_the_apk_to.apk -O $BITRISE_DEPLOY_DIR/dummy.apk

            envman add --key BITRISE_APK_PATH --value "$BITRISE_DEPLOY_DIR/dummy.apk"
        title: 'workaround: dummy APK'

@DevDema
Copy link

DevDema commented Nov 24, 2021

I also am having this issue. The step looks for an apk in a library project, I think it should be fixed.

@mateherber mateherber added the bug label Nov 24, 2021
@jac-usai
Copy link

@mateherber do you have any news on this? I see that @tothszabi already fixed the problem, but the change was never released ☹️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants