Status Update
Comments
to...@gmail.com <to...@gmail.com> #2
I tried adding screenshotTestImplementation(libs.androidx.window)
but it didn't fix it.
to...@gmail.com <to...@gmail.com> #3
This is likely a duplicate of libs.androidx.window
dependency to implementation
to see if it works?
sp...@google.com <sp...@google.com>
je...@google.com <je...@google.com>
cm...@google.com <cm...@google.com> #4
Yuki, looks like you have the context from
Would it make sense to change any defaults here to make this a better experience?
hu...@google.com <hu...@google.com> #5
+1. Using the test storage service by default sounds like a good idea to me.
to...@gmail.com <to...@gmail.com> #6
Yes. this would be a good solution. Or pull test result after every test is done before clearPackageData happen. Or store put it to some path that is not cleared like /Android/media/ I think, but using storage service is probably even better.
br...@google.com <br...@google.com> #7
There are a couple recent additions to androidx.test which are related
-
I don't think it will directly help with this bug, but FYI a DeleteFileRule API was
that I hope can replace clearPackageDatajust added to androidx.test -
androidx.test:monitor:1.6.1 will now install a default
that will write data to /Android/media/ . I feel like we should remove thisPlatformTestStorage implementation and always write to PlatformTestStoragecheck
WDYT Yuki?
Description
I'm using the orchestrator.
And flag to clear data between tests
testInstrumentationRunnerArguments["clearPackageData"] = "true"
Attempt to generate code coverage ends up just with
```
Execution failed for task ':app:createDefaultBackendTestDebugAndroidTestCoverageReport'.
> java.io.IOException: No coverage data to process in directories [...\app\build\outputs\code_coverage\defaultBackendTestDebugAndroidTest\connected]
```
Without any explanation
After some time I found (wixth help of community)
That coverage data are stored to data/data/.... and cleared after every test.
Why?
So I tried to use
testInstrumentationRunnerArguments["coverageFilePath"] = "/sdcard/Android/media/com.myapp.android.cleaner/"
It is not cleaned, and coverage data are there.
But AGP did not use them,
app\build\outputs\code_coverage\defaultBackendTestDebugAndroidTest\connected is still empty
Why?
After a whole day of investigation, I found this issue
And this way
`testInstrumentationRunnerArguments["useTestStorageService"] = "true"`
+ correct dependency finally works
Why simply
`enableAndroidTestCoverage = true`
didn't work itself. Why does it need such a tricky setup, which is not documented?
The test result itself works fine, there is no issue with deleted data between tests, why coverage did not use the same way by default?
Would be possible to use Android/media/com.myapp.android.cleaner/ and fix pulling data from there?
Or use a test storage service by default?
```
Build: AI-221.6008.13.2211.9477386, 202301110627,
AI-221.6008.13.2211.9477386, JRE 11.0.15+0-b2043.56-8887301x64 JetBrains s.r.o., OS Windows 10(amd64) v10.0 , screens 2560.0x1440.0, 2560.0x1440.0
AS: Electric Eel | 2022.1.1
Kotlin plugin: 221-1.8.0-RC2-release-341-AS5591.52
Android Gradle Plugin: 7.3.1
Gradle: 7.6
Gradle JDK: AdoptOpenJDK (HotSpot) version 15.0.2
NDK: from local.properties: (not specified), latest from SDK: (not found)
CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read
```