-
Notifications
You must be signed in to change notification settings - Fork 3
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
build: Change java version to 17 for robolectric-extension tests #83
Conversation
- adding an integration test to test with java 11
WalkthroughThe recent changes introduce support for Java 11 in an Android project, enhancing testing capabilities by configuring a dedicated integration test setup. Key updates include the addition of a new Gradle module for Java 11 tests, integration of essential plugins, and enhancements to code coverage and static analysis tools. These updates aim to improve compatibility and maintainability while ensuring robust testing across different versions of Android. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant CI/CD
participant Test Environment
participant Code Coverage Tool
Developer->>CI/CD: Commit changes for Java 11 support
CI/CD->>Test Environment: Trigger integration tests
Test Environment->>Code Coverage Tool: Collect coverage data
Code Coverage Tool-->>Test Environment: Provide coverage report
Test Environment-->>CI/CD: Send test results
CI/CD-->>Developer: Notify test outcome
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- .idea/gradle.xml (2 hunks)
- build.gradle (1 hunks)
- gradle/libs.versions.toml (2 hunks)
- integration-tests/java-11/build.gradle (1 hunks)
- integration-tests/java-11/src/test/kotlin/tech/apter/junit/jupiter/robolectric/integration/tests/java11/Java11Test.kt (1 hunks)
- robolectric-extension/build.gradle (1 hunks)
- settings.gradle (1 hunks)
Files skipped from review due to trivial changes (1)
- settings.gradle
Additional comments not posted (11)
build.gradle (1)
22-22
: Dependency addition for Java 11 integration tests.The addition of
kover(project(':integration-tests:java-11'))
appears correct and aligns with the objective of adding Java 11 integration tests. Ensure that theintegration-tests:java-11
project is correctly configured and that this dependency does not introduce any conflicts.integration-tests/java-11/src/test/kotlin/tech/apter/junit/jupiter/robolectric/integration/tests/java11/Java11Test.kt (1)
1-18
: New test class for Java 11 integration.The test class
Java11Test
is well-structured and correctly uses theRobolectricExtension
and@Config
annotation to specify the SDK version. The test methodGiven an android project with kotlin-dsl build script when using Robolectric with JUnit5 the android app should be available
verifies that the Android application context is available, which is a valid test for this scenario.integration-tests/java-11/build.gradle (5)
1-7
: Plugins configuration for Java 11 integration tests.The plugins configuration includes necessary plugins for Android, Kotlin, Kover, Detekt, and the Robolectric extension. This setup appears comprehensive and appropriate for the integration tests.
9-22
: Android configuration for Java 11 integration tests.The Android configuration specifies the namespace, compile SDK version, build tools version, and minimum SDK version. The
testOptions
block configures the enabled SDKs for Robolectric, which is essential for testing across different Android versions. This configuration is well-defined and aligns with best practices.
25-28
: Detekt configuration for Java 11 integration tests.The Detekt configuration specifies the tool version and enables auto-correct. This setup ensures that code quality is maintained and adheres to the defined rules.
30-32
: Kotlin configuration for Java 11 integration tests.The Kotlin configuration specifies the JVM toolchain version, which is necessary for ensuring compatibility with the specified Java version.
34-37
: Dependencies for Java 11 integration tests.The dependencies include Detekt plugins for formatting and rules libraries. This setup ensures that the code adheres to the defined style and quality rules.
.idea/gradle.xml (1)
28-28
: LGTM! Addition of Java 11 integration tests path.The new entry for Java 11 integration tests is correctly placed within the
<option name="modules">
section.gradle/libs.versions.toml (2)
5-5
: LGTM! Addition ofandroidCompileSdkJava11
version.The new entry for
androidCompileSdkJava11
is correctly placed within the[versions]
section.
5-5
: LGTM! Removal ofandroidGradle
entry.The removal of the
androidGradle
entry from the[libraries]
section is appropriate, given the presence ofandroidGradleJava11
.Also applies to: 5-5
robolectric-extension/build.gradle (1)
42-48
: LGTM! Addition ofjavaLauncher
configuration.The new configuration block within the
test
task sets thejavaLauncher
using a Java toolchain, enhancing the flexibility of the testing setup.
Branch Coverage (ubuntu-22.04)
|
Line Coverage (ubuntu-22.04)
|
Branch Coverage (windows-2022)
|
Line Coverage (windows-2022)
|
Summary by CodeRabbit
New Features
Improvements
Chores