Do Not Merge – Only here to trigger CI on https://github.com/wordpress-mobile/WordPress-Android/pull/15653#15659
Closed
renanferrari wants to merge 16 commits intotrunkfrom
Closed
Do Not Merge – Only here to trigger CI on https://github.com/wordpress-mobile/WordPress-Android/pull/15653#15659renanferrari wants to merge 16 commits intotrunkfrom
renanferrari wants to merge 16 commits intotrunkfrom
Conversation
- Updated Dagger modules with @Installin(SingletonComponent::class) annotation. - AppComponent is converted to entry point aggregator. This is a temporary change. AppComponent will be removed when Hilt migration is done. - Added @ApplicationContext to context parameters in modules.
Before this commit, app was crashing at start. Because some initializing stuff were working after Hilt injections. Now they are starting together with other injections.
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
Generated by 🚫 dangerJS |
|
You can test the changes on this Pull Request by downloading the APKs: |
Hilt test requires test application but test applications have some drawbacks. While real applications can inject before onCreate, test applications can only inject after onCreate. Thus, AppInitializer is created and will be used as a rule in test cases.
- Added HiltAndroidTest to UserAgentTest - Moved getUserAgent(), getDefaultUserAgent(), USER_AGENT_APPNAME from WordPress to AppInitializer
# Conflicts: # WordPress/src/main/java/org/wordpress/android/modules/AppComponent.java # build.gradle
Since SingletonComponent is recreated for each test cases, caching AndroidInjector and AppInitializer causes failing UI tests. AndroidInjector and AppInitializer are no longer cached for UI tests. But some static functions were crashing while AppInitializer is recreating. Added a boolean to AppInitializer to manage reinitializing of these functions.
Other classes are casting application to WordPress but WordPress couldn't be used in UI tests. And test application (WordPressTest) was crashing. With this common abstract WordPress application, other classes can cast application to WordPress safely.
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.
Only here to trigger CI on #15653