Conversation
Summary of ChangesHello @andreia-ferreira, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the test infrastructure by decoupling Compose UI tests from the main Hilt-based test class. This change improves test isolation and reduces boilerplate by allowing individual Compose tests to manage their own Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request successfully cleans up the test setup by localizing composeTestRule and removing unnecessary Hilt dependencies from pure UI component tests. It also introduces a helpful getString utility for accessing resources in tests. I've suggested a few improvements for consistency and better mock management in the newly refactored tests.
app/src/test/java/org/groundplatform/android/ui/signin/SignInScreenTest.kt
Show resolved
Hide resolved
app/src/test/java/org/groundplatform/android/ui/startup/StartupScreenTest.kt
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3572 +/- ##
============================================
- Coverage 71.03% 71.02% -0.02%
Complexity 1631 1631
============================================
Files 331 331
Lines 8956 8956
Branches 998 998
============================================
- Hits 6362 6361 -1
- Misses 1998 1999 +1
Partials 596 596 🚀 New features to boost your workflow:
|
shobhitagarwal1612
left a comment
There was a problem hiding this comment.
Love the cleaner test setup! Thanks for the refactor.
Does this have any impact on the total runtime of the tests?
|
Thanks! On local tests runs I only noticed a slight decrease in the average test runtime (around 10s or so), so nothing dramatic :) However, I'm marking this PR as a draft for now because I noticed the changes might introduce some flakiness in certain tests which I want to investigate better |
|
after #3580 this PR is now safe to merge. Since those changes removed the static dispatcher from The flakiness only surfaced after this decoupling refactor, which likely changed enough about the test setup to make the pre-existing issue visible. After the dispatchers fix that flakiness doesn't occur anymore |
BaseHiltTestcurrently holds acomposeTestRule, which adds unnecessary overhead to tests that don't need to test anything related to the UI. That may have a slight impact on runtime for non-UI tests but also it may make it harder for future modularization.This PR refactors this setup by:
composeTestRulefrom the base test class and moved it only to tests that actually need itTestResourcesHelperto provide resources without requiringcreateAndroidComposeRuleBaseHiltTestusage to decouple it from tests that don't need it (eg. pure compose tests)@shobhitagarwal1612 PTAL?