-
Notifications
You must be signed in to change notification settings - Fork 503
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
Fixes part of #59: Introduce app module Robolectric tests + Bazel [BLOCKED: #1622] #1634
Merged
Conversation
This file contains 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
… stage1_bazel_utility
…-android into stage1_bazel_testing
…-android into introduce-bazel-roboelectric-testing
…-android into introduce-bazel-roboelectric-testing
….com/oppia/oppia-android into introduce-domain-bazel-build
…ia/oppia-android into traslate-binding-adapters-to-java
…ia/oppia-android into traslate-binding-adapters-to-java
This reverts commit 84037cb.
This reverts commit ce92d0a.
This reverts commit 88c9492.
This reverts commit d66af07.
BenHenning
requested changes
Aug 21, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing 'approved' per the incorrect @Inject
.
app/src/main/java/org/oppia/app/utility/PackageManagerHelper.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/utility/PackageManagerHelper.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/utility/PackageManagerHelper.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/app/utility/PackageManagerHelper.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/app/administratorcontrols/AppVersionActivityTest.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Ben Henning <[email protected]>
…ppia/oppia-android into introduce-robolctric-app-tests
BenHenning
approved these changes
Aug 21, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @miaboloix. LGTM!
… build-app-library-binary-bazel
Co-authored-by: Ben Henning <[email protected]>
…ppia/oppia-android into introduce-robolctric-app-tests
…ppia/oppia-android into introduce-robolctric-app-tests
… introduce-robolctric-app-tests
miaboloix
added a commit
that referenced
this pull request
Aug 22, 2020
…1679) * Translated RecyclerViewBindingAdapter * Deleted kotlin binding adapters * Translated GuidelineBindingAdapter * Translated StateAssemblerMarginBindingAdapters * Translated StateAssemblerPaddingBindingAdapters * Almost finished translating ViewBindingAdapter * Fixed the duplicate google-services.json issue * Created Issue and added TODO * Translated ViewBindingAdapter * Added minSDK back * Alphabetized dependencies * Fixed firebase target * Trying to fix StateRetreiverTest * Binding Adapter files are building with Gradle! * Fixed ktlint violation * Revert "Deleted kotlin binding adapters" This reverts commit 84037cb. * Revert "Translated GuidelineBindingAdapter" This reverts commit ce92d0a. * Revert "Translated StateAssemblerMarginBindingAdapters" This reverts commit 88c9492. * Revert "Translated StateAssemblerPaddingBindingAdapters" This reverts commit d66af07. * Git mv on DrawableBindingAdapters * Translated DrawableBindingAdapters * Deleted java files * Translated EditTextBA and GuidelineBA * Translated ImageViewBA * Added missing semicolon * Translated MarginBindingAdapters * Translated State AssemblerMarginBA * Translated StateAssemblerPaddingBA * Translated TextViewBA * Revert "Translated TextViewBA" This reverts commit 849549d. * Changed targetSdk to 28 * Revert "Revert "Translated TextViewBA"" This reverts commit 6cfa75d. * Fixed formatting issues and changed NotNull to NonNull * Refactored GuidelineBindingAdapter to be GuidelineBindingAdapters * Fixed some double space errors and other typos * Added missing ViewBindingAdapter * Deleted extra spaces and fixed more nit issues * Made all classes final * Added top level documentation * Reformatted some comments to fit java style * Reformatted imports * Created Issue and added TODOs for re-restricitng access * Added min and target SDK to domain manifest * Added documentation comment * Deleted unused domain_tests library * Revert "Deleted unused domain_tests library" This reverts commit 65e71cc. * Removed unused domain)tests library * Annotations and helpers library builds * Listeners library builds * View models build * Views now build * Added documentation comments * Started removing binding dependencies from views * Removed fragment imports used only for comments in order to build view files * Pulled binding dependenvy out of ConceptCardViewModel * Edited R import statements for Bazel to build * Fixed more errors, view_model builds * Worked through more errors * Added a dependency * View library builds * Ordered BUILD file for better merging * Both databinding adapters and recyclerview adapters are building * Starting writing databinding resources library * Removed unused listeners * Added missing comments * Formatted files and added missing @nonnull annotations * Fixed ktlint errors * Revert "Formatted files and added missing @nonnull annotations" This reverts commit 84b6125. * Added genrule for viewmodel files * Added view genrule * Both Bazel and Gradle are building * Fixed ktlint errors * Delete vcs.xml * Renamed files, deleted unused files, and added some documentation * Improved implementation of some functions in ViewBindingShimImpl and added documentation * Fixed ktlint errors * Put genrules in a loop, created issue to remove genrules post-gradle and added TODO * Added more documentation, created an issue to remove shim files, added TODO * Fixed Gradle build error * Added documentation, created an issue, added a TODO * Formatted single line comments * Fixing more nits * Fixed more nits. * Fixed getTimeAgo() function * Suppressed warning in bindToRecyclerViewAdapter * Builds in both Bazel and Gradle * Added comments to BUILD file * Fixed profile_chooser_profile_view error * Fixed profile_chooser_add_view * Fixed walthrough_final_fragment error * Fixed profile_chooser_fragment error * Fixed walthrough_activity error * Fixed onboarding_fragment error * Fixed audio_fragment error * Fixed unused presnter errors, databining resources now build * Builds with Gradle * Fixed WalkthroughWelcomeFragmentPresenter to not contain unnecessary methods bc of interface * Removed unnecessary method from WalkthroughActivity * Removed the need for ProfileChooserListener, added comments to WalkthroughListeners * Genrule is working * Simplified genrule * Alphabetized lists in app module BUILD * Quick cleanup, added missing documentation * App library is building with Bazel * Added Retrofit+Gson dependency for NetworkModule to build with Gradle * Binary builds * Started debugging runtime errors * Fixed domain BUILD * Added genrule comments, simplified gnerule targets in lists * Fixed QuestionPlayerFragmentPresenter and StateFragmentPresenter * Fixed QuestionPlayerViewModel & FRagmentPresenter as well as StateViewModel & FragmentPresenter * Fixed some nits * Fixed ktlint errors * Added assets * First test builds and passes * Fixed DragDrop ViewBinding implementations, added modules to TestComponent * Fix ktlint errors * Fixed nits in TextViewBA * Fixed Audio + Language test appearance bug * Fixed ktlint errors * Fixed ktlint error in FAQSingleActivityPresenter * Fixed ktlin errors * Cleaned up app BUILD file a bit * Testing module tests now pass, all domain tests pass except StateRetreiver * Removed unused dependencies, aplhabetized dependencies * Fixed list formation * Cleaned up BUILD * Fixed nits * Fixing some nits * Refactored file names * Altered walkthrough welcome fragment * Renamed wasProfileEverBeenAddedValue to hasProfileEverBeenAddedValue * Fixed ktlint error * Removed unused dependencies and alphabetized them * Deleted unused methods in ImageViewBA * Removed data attribute from domain library * Excluded DataBinderMapperImpl from Gradle build * Most tests build and pass * Started getting sharedTests to run * All tests now build * Fixed ktlint errors * Fixed ktlint error * Added missing TODOs * Fixed merge errors * Fixed nits * Removed unnecessary field in StateFragmentAccessibilityTest * Fixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTest * Injected context in AppVersionViewModel * Used lambda function to resolve issues with QuestionPlayerVM and QuestionPlayerFragmentPresenter * Fixed small errors * Fixed ktlint errors * Removed Moshi dependency from NetworkModule * Fixed ktlint error * Fixing listener file naming * Fixed NetworkModule issue by removing it from ApplicationComponent temporarily * Restored NetworkModule, fixed some nits * Fixed typo, deleted unused file, removed retrofit gradle dependencies * Removed NetworkModule from test files, fixed nits, fixed enable_data_binding in oppia_android_test * Fixing nits * Fixed more nits * Fixed StateFragmentPresenter and view model, fixed some nits * Fixed ktlint errors * Altered for loop to append directly to DATABINDING_ADAPTERS * Created issue and added TODO for ApplicationComponent and NetworkModule * Added TODOs to test files with NetworkModule removed, added documentation to DataBinderMapperImple, fixed nits * Added documentations, fixed nits * Added proto optimization * Fixed nits * Fixed ktlint error * Added documentation, fixed nits * Added a few nits * Removed unused imports * Fixed nits * Created issue, added TODO, updated docs * Starting to put genrules into a macro * Fixed documentation * Added comment about binding adapters in Java * Created test_with_resources and applied it to tests * Add more context * Fixed nits, created a PackageManagerHelper file * Update WORKSPACE with Markdown Co-authored-by: Ben Henning <[email protected]> * Fixed doumenting comment * Update app/src/main/java/org/oppia/app/utility/PackageManagerHelper.kt Co-authored-by: Ben Henning <[email protected]> * Fixed inject issue and nits * Fixed typo * Changed filename, included new file in Annotations library * Fixed lint error Co-authored-by: Ben Henning <[email protected]>
miaboloix
added a commit
that referenced
this pull request
Aug 22, 2020
) * Fixed the duplicate google-services.json issue * Created Issue and added TODO * Translated ViewBindingAdapter * Added minSDK back * Alphabetized dependencies * Fixed firebase target * Trying to fix StateRetreiverTest * Binding Adapter files are building with Gradle! * Fixed ktlint violation * Revert "Deleted kotlin binding adapters" This reverts commit 84037cb. * Revert "Translated GuidelineBindingAdapter" This reverts commit ce92d0a. * Revert "Translated StateAssemblerMarginBindingAdapters" This reverts commit 88c9492. * Revert "Translated StateAssemblerPaddingBindingAdapters" This reverts commit d66af07. * Git mv on DrawableBindingAdapters * Translated DrawableBindingAdapters * Deleted java files * Translated EditTextBA and GuidelineBA * Translated ImageViewBA * Added missing semicolon * Translated MarginBindingAdapters * Translated State AssemblerMarginBA * Translated StateAssemblerPaddingBA * Translated TextViewBA * Revert "Translated TextViewBA" This reverts commit 849549d. * Changed targetSdk to 28 * Revert "Revert "Translated TextViewBA"" This reverts commit 6cfa75d. * Fixed formatting issues and changed NotNull to NonNull * Refactored GuidelineBindingAdapter to be GuidelineBindingAdapters * Fixed some double space errors and other typos * Added missing ViewBindingAdapter * Deleted extra spaces and fixed more nit issues * Made all classes final * Added top level documentation * Reformatted some comments to fit java style * Reformatted imports * Created Issue and added TODOs for re-restricitng access * Added min and target SDK to domain manifest * Added documentation comment * Deleted unused domain_tests library * Revert "Deleted unused domain_tests library" This reverts commit 65e71cc. * Removed unused domain)tests library * Annotations and helpers library builds * Listeners library builds * View models build * Views now build * Added documentation comments * Started removing binding dependencies from views * Removed fragment imports used only for comments in order to build view files * Pulled binding dependenvy out of ConceptCardViewModel * Edited R import statements for Bazel to build * Fixed more errors, view_model builds * Worked through more errors * Added a dependency * View library builds * Ordered BUILD file for better merging * Both databinding adapters and recyclerview adapters are building * Starting writing databinding resources library * Removed unused listeners * Added missing comments * Formatted files and added missing @nonnull annotations * Fixed ktlint errors * Revert "Formatted files and added missing @nonnull annotations" This reverts commit 84b6125. * Added genrule for viewmodel files * Added view genrule * Both Bazel and Gradle are building * Fixed ktlint errors * Delete vcs.xml * Renamed files, deleted unused files, and added some documentation * Improved implementation of some functions in ViewBindingShimImpl and added documentation * Fixed ktlint errors * Put genrules in a loop, created issue to remove genrules post-gradle and added TODO * Added more documentation, created an issue to remove shim files, added TODO * Fixed Gradle build error * Added documentation, created an issue, added a TODO * Formatted single line comments * Fixing more nits * Fixed more nits. * Fixed getTimeAgo() function * Suppressed warning in bindToRecyclerViewAdapter * Builds in both Bazel and Gradle * Added comments to BUILD file * Fixed profile_chooser_profile_view error * Fixed profile_chooser_add_view * Fixed walthrough_final_fragment error * Fixed profile_chooser_fragment error * Fixed walthrough_activity error * Fixed onboarding_fragment error * Fixed audio_fragment error * Fixed unused presnter errors, databining resources now build * Builds with Gradle * Fixed WalkthroughWelcomeFragmentPresenter to not contain unnecessary methods bc of interface * Removed unnecessary method from WalkthroughActivity * Removed the need for ProfileChooserListener, added comments to WalkthroughListeners * Genrule is working * Simplified genrule * Alphabetized lists in app module BUILD * Quick cleanup, added missing documentation * App library is building with Bazel * Added Retrofit+Gson dependency for NetworkModule to build with Gradle * Binary builds * Started debugging runtime errors * Fixed domain BUILD * Added genrule comments, simplified gnerule targets in lists * Fixed QuestionPlayerFragmentPresenter and StateFragmentPresenter * Fixed QuestionPlayerViewModel & FRagmentPresenter as well as StateViewModel & FragmentPresenter * Fixed some nits * Fixed ktlint errors * Added assets * First test builds and passes * Fixed DragDrop ViewBinding implementations, added modules to TestComponent * Fix ktlint errors * Fixed nits in TextViewBA * Fixed Audio + Language test appearance bug * Fixed ktlint errors * Fixed ktlint error in FAQSingleActivityPresenter * Fixed ktlin errors * Cleaned up app BUILD file a bit * Testing module tests now pass, all domain tests pass except StateRetreiver * Removed unused dependencies, aplhabetized dependencies * Fixed list formation * Cleaned up BUILD * Fixed nits * Fixing some nits * Refactored file names * Altered walkthrough welcome fragment * Renamed wasProfileEverBeenAddedValue to hasProfileEverBeenAddedValue * Fixed ktlint error * Removed unused dependencies and alphabetized them * Deleted unused methods in ImageViewBA * Removed data attribute from domain library * Excluded DataBinderMapperImpl from Gradle build * Most tests build and pass * Started getting sharedTests to run * All tests now build * Fixed ktlint errors * Fixed ktlint error * Added missing TODOs * Fixed merge errors * Fixed nits * Removed unnecessary field in StateFragmentAccessibilityTest * Fixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTestFixed StateFragmentAccessibilityTest * Injected context in AppVersionViewModel * Used lambda function to resolve issues with QuestionPlayerVM and QuestionPlayerFragmentPresenter * Fixed small errors * Fixed ktlint errors * Removed Moshi dependency from NetworkModule * Fixed ktlint error * Fixing listener file naming * Fixed NetworkModule issue by removing it from ApplicationComponent temporarily * Restored NetworkModule, fixed some nits * Fixed typo, deleted unused file, removed retrofit gradle dependencies * Removed NetworkModule from test files, fixed nits, fixed enable_data_binding in oppia_android_test * Fixing nits * Fixed more nits * Fixed StateFragmentPresenter and view model, fixed some nits * Fixed ktlint errors * Altered for loop to append directly to DATABINDING_ADAPTERS * Created issue and added TODO for ApplicationComponent and NetworkModule * Added TODOs to test files with NetworkModule removed, added documentation to DataBinderMapperImple, fixed nits * Added documentations, fixed nits * Fixed nits * Fixed ktlint error * Added documentation, fixed nits * Added a few nits * Removed unused imports * Fixed nits * Created issue, added TODO, updated docs * Starting to put genrules into a macro * Fixed documentation * Added comment about binding adapters in Java * Created test_with_resources and applied it to tests * Fixed nits, created a PackageManagerHelper file * Fixed nits * Update app/src/main/java/org/oppia/app/utility/PackageManagerHelper.kt Co-authored-by: Ben Henning <[email protected]> * Fixed inject issue and nits * Fixed typo * Changed filename, included new file in Annotations library * Fixed lint error * Added bazel_build_app task to main.yml * Test out GITHUB_WORKSPACE and HOME * Using env PATH variables * Added $GITHUB_WORKSPACE to android_tools command * Fixed typo in build command * Change from my repo to oppia's bazel repo Co-authored-by: Ben Henning <[email protected]> * Change Setup to Set up Co-authored-by: Ben Henning <[email protected]> * Collapse creating tmp/android_tools into extract android_tools Co-authored-by: Ben Henning <[email protected]> * Changed apk path to be absolute * Made cp use absolute path * Updated cp command * Update main.yml * Update main.yml Co-authored-by: Ben Henning <[email protected]>
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.
Explanation
Fixes part of #59: Introduce app module Robolectric tests + Bazel [BLOCKED: #1622]
This PR sets up Robolectric tests for app module + Bazel. Because
rules_kotlin
does not have akt_android_local_test
rule, each test must be built in it's ownkt_android_library
and fed into anandroid_local_test
rule as a dependency - the macro fileapp_tests.bzl
handles this. On top of this, certain necessary data binding processing is not being handled bykt_android_library
andandroid_local_test
, causingDataBinderMapperImpl.java
not to be generated. The workaround for this is manually creatingDataBinderMapperImpl.java
and adding it to the source file list for each test target.In order to set up the correct version of Bazel, please follow the instructions laid out in this document.
To build and run all the tests in app module, run
To build and run a specific test in app module, run
Checklist