bitrise-steplib / steps-virtual-device-testing-for-android

MIT License
22 stars 23 forks source link

How to export coverage.ec file #58

Closed hernandazevedo closed 4 years ago

hernandazevedo commented 4 years ago

I am trying to use the step to export the coverage.ec file as described with no success, the file is not being exported.

What I am doing wrong?

This is my configuration

- virtual-device-testing-for-android@1.1.1:
        inputs:
        - environment_variables: |-
            coverage=true
            coverageFile=/sdcard/coverage.ec
        - directories_to_pull: "/sdcard/"
        - download_test_results: 'true'
        - use_verbose_log: 'true'
        - test_type: instrumentation

image

hernandazevedo commented 4 years ago

My mistake, the file was being generated but with an unexpected name "NexusLowRes-24-en-portrait_artifacts_sdcard_coverage.ec"

I think we can close this issue. We can use on jacoco like this:

executionData = files([fileTree(dir: project.buildDir, includes: [
            'jacoco/testDebugUnitTest.exec'
    ])], [fileTree(dir: "${System.env.VDTESTING_DOWNLOADED_FILES_DIR}", includes: [
            '*sdcard_coverage.ec'
    ])])
hernandazevedo commented 4 years ago

Here my implementation: https://gist.github.com/hernandazevedo/4c19558db2f138c99e3c24838cccf307