-
Notifications
You must be signed in to change notification settings - Fork 13
Adds unit, component and feature tests #25
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
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # AdaptiveJetStream/jetstream/src/main/res/values/strings.xml
Also fixes some screenshot tests.
Adds the JaCoCo plugin to generate test coverage reports. This change also includes the migration of existing Android instrumented tests to local Robolectric tests. - Enable unit test coverage in the debug build type. - Configure the `jacocoTestReport` task to define sources, classes, and execution data for the report. - Add Robolectric tests for `SearchScreen`, `ShowsScreen`, and `ProfileScreen`. - Move existing instrumented tests from the `androidTest` directory to the `test` directory, converting them to run with Robolectric. - Add a `robolectric.properties` file to configure the test environment.
Updates the GitHub Actions workflow to: - Rename the job to `build-and-test`. - Upgrade the Java version to 21. - Add a step to execute unit tests (`testDebugUnitTest`).
The `GradientBg` composable now accepts a seed to ensure that the generated radial gradient is deterministic. This seed is derived from the movie category's ID on the `CategoriesScreen`, making the background gradient for each category consistent across recompositions. This change also includes an update to the screenshot tests to reflect the new deterministic gradients.
Summary of ChangesHello @JoseAlcerreca, 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 significantly enhances the testing infrastructure of the AdaptiveJetStream project by introducing comprehensive documentation and configurations for unit, component, and feature tests. It also includes crucial refactoring for improved testability and visual fallback mechanisms for UI elements, alongside a substantial addition of new tests to ensure the stability and correctness of the application. 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. Ignored Files
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces comprehensive documentation for various testing types (unit, component, feature, screenshot) in an Android Compose application, along with significant updates to the build configuration and codebase to support these testing strategies. Key changes include adding new Gradle dependencies for testing frameworks like JUnit, Kotlin Coroutines Test, Robolectric, and the Compose Screenshot Testing plugin. The gradle.properties file was updated to increase JVM memory and enable experimental screenshot testing. The project's Kotlin JVM toolchain was upgraded from version 17 to 21, and Jacoco code coverage reporting was configured. The codebase was refactored to introduce an AssetReader interface for better testability, and several UI components were modified to use this interface and to generate gradient placeholders when image URIs are empty. Additionally, the visibility of several Composable functions was changed from private to internal to facilitate testing, and new screenshot test files were added for various components and screens. Review comments highlighted copy-paste errors in the compose-testing.md.txt file where GitHub URLs were incorrectly embedded within code blocks, and identified a duplicate test file (CategoryMovieListScreenTest.kt) that should be removed to maintain a clean test suite. A missing newline character at the end of screenshot-testing.md.txt was also noted.
...est/java/com/google/jetstream/presentation/screens/categories/CategoryMovieListScreenTest.kt
Show resolved
Hide resolved
Adds a screenshot testing and update process to the CI workflow. The new steps will: - Run screenshot verification tests. - If tests fail on a fork, the workflow will fail with an error, instructing the user to create a PR on their fork first. - If tests fail on a PR within the main repository, it will automatically generate new screenshots. - Commit and push the newly generated screenshots back to the PR branch.
- Deleted the `CategoryMovieListScreenRobolectricTest` as it is no longer required. - Cleaned up testing documentation by removing invalid URLs.
No description provided.