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

Unable to generate code coverage report #96

Open
fwpascual opened this issue Mar 14, 2022 · 0 comments
Open

Unable to generate code coverage report #96

fwpascual opened this issue Mar 14, 2022 · 0 comments

Comments

@fwpascual
Copy link

fwpascual commented Mar 14, 2022

πŸ‘“ What did you see?

When enabling code coverage, it fails to generate a code coverage report and fails the build

βœ… What did you expect to see?

A successful build and code coverage report

πŸ“¦ Which version are you using?

4.9.0

πŸ”¬ How could we reproduce it?

A sample project has been created to demonstrate the issue:
https://github.com/fwpascual/cucumber-coverage-sample

Steps to reproduce the behavior:

  1. Download the provided repo
  2. Run ./gradlew clean cAT
  3. See error in output.

The above project is based off of a sample from the Android test samples:
https://github.com/android/testing-samples/tree/main/runner/AndroidTestOrchestratorWithTestCoverageSample

πŸ€” Anything else?

I suspect the issue is in the android test framework, but logging here in case there's any ideas. The android-test repo issue can be found here:
android/android-test#1319

The following are some additional details:

Get a failure during the :app:createDebugAndroidTestCoverageReport gradle task

* What went wrong:
Execution failed for task ':app:createDebugAndroidTestCoverageReport'.
> A failure occurred while executing com.android.build.gradle.internal.coverage.JacocoReportTask$JacocoReportWorkerAction
   > Unable to generate Jacoco report

Inspecting the folder under app/build/outputs/code_coverage/debugAndroidTest/connected/Pixel_4_XL_API_31(AVD) - 12, I see a Sample\ Feature#Sample\ Scenario.ec file, but it's zero bytes. When I look for this same file on the emulator, I see the same file under /sdcard/googletest/internal_use/data/data/com.example.android.testing.androidtestorchestratorsample/coverage_data/Sample Feature#Sample Scenario.ec with a 123 byte file.

Running the :app:connectedDebugAndroidTest task, I don't get a failure, and at this point the .ec file is also in the above described emulator device folder, however, I see this error in the gradle build log:

> Task :app:connectedDebugAndroidTest
Starting 1 tests on Pixel_4_XL_API_31(AVD) - 12
Mar 14, 2022 1:18:07 PM com.android.tools.utp.plugins.host.coverage.AndroidTestCoveragePlugin deviceShellAndCheckSuccess
WARNING: Shell command failed (1): cat "/sdcard/googletest/internal_use///data/data/com.example.android.testing.androidtestorchestratorsample/coverage_data//Sample\ Feature#Sample\ Scenario.ec" > "/data/local/tmp/b57c2a44-ba36-473d-9edf-5441bd14c514-coverage_data/Sample\ Feature#Sample\ Scenario.ec"
cat: /sdcard/googletest/internal_use///data/data/com.example.android.testing.androidtestorchestratorsample/coverage_data//Sample\ Feature#Sample\ Scenario.ec: No such file or directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant