[Android] Dinamically set test cases dir under app's specific storage - #5439
Draft
IvanBM18 wants to merge 3 commits into
Draft
[Android] Dinamically set test cases dir under app's specific storage#5439IvanBM18 wants to merge 3 commits into
IvanBM18 wants to merge 3 commits into
Conversation
IvanBM18
commented
Aug 26, 2026
|
|
||
| def get_testcases_directory(): | ||
| """Returns the testcases directory.""" | ||
| testcases_dir = environment.get_value('DEVICE_TESTCASES_DIR', |
Collaborator
Author
There was a problem hiding this comment.
Maybe i should always grab the default value here, this way jobs that already define a custom test cases dir path continue to work
IvanBM18
force-pushed
the
fix/android/wrong_testcase_path
branch
from
September 1, 2026 00:34
cdaab95 to
c85946e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: b/545195031
Since Android API level 30(and all apps targeting android 11+), apps have scoped storage access, and we can only give it external storage permissions at runtime by a user facing dialog. To avoid this, we now copy the testcases to the app's external app-specific storage , which is always readable by our app's package.
We didn't noticed this issues because all test cases execute using
am startwhich almost the 99% of the time returns no error codes, hence we though that the test case executed but that is not the case.Example for chrome: Previously, if we tried to execute our test case, the app would tell us it can't find the file(because of the read external storage permissions):
TODO
But after this changes the html renders successfully!
TODO
Learn more:
Alternative
adb reverse tcp:8000 tcp:8000, this is what we usually do in regular chrome tests, clusterfuzz already support's this, but i think nevertheless we need to make this change to keep our options open.Changes
/sdcard/Android/data/{PKG_NAME}/files/which is always reable by the given app./sdcard/Android/data/{PKG_NAME}/files/*.Tests performed