[QA] Add content provider to handle settings in QA variant#4776
Draft
[QA] Add content provider to handle settings in QA variant#4776
Conversation
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.
Summary
Adds a
ContentProviderto the qa variant that allows to handle the shared preferences with testing purposes.The
ContentProvideroverrides thecallfunction that receives three parameters:method: name of the method that will execute the action. In this case, only one methodset_booleansince it's intended (for the moment) for boolean preferencesarg: the name of the preferenceextras: value of the preference (in this case,trueorfalse)How it works
adbcommand, the content provider is called with the proper argumentsF. ex:
to enable the
show_disabled_spacespreference:to disable the
show_hidden_filespreference:Security
In order to assure that this implementation is only available in the qa variant, the following checks have been performed:
1. Check that
Manifestis OKFirstly, a
Manifestfor every variant is generated:Then, inspect them:
Result: 81: android:name="com.owncloud.android.test.TestPreferencesProvider"
That means, the qa manifest contains the
TestPreferencesProviderclass.Let's check in the original:
That returns no results, so the original manifest does not contain the
TestPreferencesProviderclass2. Check if the compilings contain the TestPreferencesProvider class
Execute the following commands
./gradlew clean-> clean up directory./gradlew :owncloudApp:compileOriginalReleaseKotlin-> compile the originalRelease variantfind owncloudApp/build/tmp/kotlin-classes/originalRelease -iname '*TestPreferencesProvider*'-> tries to find theTestPreferencesProviderinside of it. It shouldn't find anything../gradlew clean-> clean up again./gradlew :owncloudApp:compileQaReleaseKotlin-> compile the qaRelease variantfind owncloudApp/build/tmp/kotlin-classes/qaRelease -iname '*TestPreferencesProvider*'-> it should returnowncloudApp/build/tmp/kotlin-classes/qaRelease/com/owncloud/android/test/TestPreferencesProvider.class3. Check the presence of TestPreferencesProvider in the artifacts
Build a signed apk with both
originalandqavariant, and execute over both of them:(set the right apk name in the command fot every case)
That command list the code files inside the apk. The
TestPreferencesProviderclass should be listed only in the apk that was built with the qa variant.Those checks show that the
originalXXXvariants will never include theTestPreferencesProviderand the qaManifest.(open to other ideas)
App:
ReleaseNotesViewModel.ktcreating a newReleaseNote()with String resources (if required)QA