Closed warnyul closed 6 months ago
The recent updates enhance the Robolectric JUnit Jupiter Gradle Plugin by refining its testing capabilities and configuration management. Key changes include the introduction of JUnit Platform support, dependency management adjustments, and methodological refinements in plugin configuration. These improvements aim to streamline testing processes and enhance the plugin's integration with Android and Kotlin environments.
File Path | Changes Summary |
---|---|
.../build.gradle |
Added test configurations and dependencies for JUnit 5, Kotlin, and Android Gradle. |
.../RobolectricJUnitJupiterGradlePlugin.kt and .../RobolectricJUnitJupiterGradlePluginExtension.kt |
Updated property access and refactored test task setup; transformed a class into an interface with property management. |
.../RobolectricJUnitJupiterGradlePluginTest.kt |
Enhanced testing with new functions and scenarios to ensure plugin functionality across different project types. |
🐰✨ In the burrow of code, where the digital hops, A plugin was polished with not a flop. JUnit and Kotlin, together they bind, In tests they trust, leaving no bug behind. Cheers to the devs, with each line they craft, In the realm of builds, they've mastered the art. 🌟 🐰💻
robolectric-extension-gradle-plugin/src/main/kotlin/tech/apter/robolectric/junit/jupiter/gradle/plugin/RobolectricJUnitJupiterGradlePluginExtension.kt (1)
`6-8`: Conversion to interface and use of `Property` for `doNotAddDependencies` aligns well with Gradle's configuration avoidance APIs. robolectric-extension-gradle-plugin/src/main/kotlin/tech/apter/robolectric/junit/jupiter/gradle/plugin/RobolectricJUnitJupiterGradlePlugin.kt (3)
`21-21`: Proper use of `doNotAddDependencies.get()` ensures dependencies are conditionally added based on the property's value. --- `30-33`: Setting a default value for `doNotAddDependencies` during extension registration is a good practice for maintainability and clarity. --- `46-52`: Method `prepareForRobolectric` correctly sets up test tasks with necessary configurations for JUnit 5 integration.robolectric-extension-gradle-plugin/build.gradle (2)
`29-31`: Correct configuration of JUnit Platform within the `test` block to enable JUnit 5 testing. --- `38-43`: Dependencies added are appropriate for enhancing testing capabilities with JUnit 5, Kotlin, and Android Gradle.robolectric-extension-gradle-plugin/src/test/kotlin/tech/apter/robolectric/junit/jupiter/gradle/plugin/RobolectricJUnitJupiterGradlePluginTest.kt (5)
`20-40`: Test function correctly verifies the enabling of JUnit Platform and setting of launcher interceptors, ensuring proper integration with JUnit 5. --- `43-55`: Test function effectively verifies the inclusion of Android resources when the plugin is applied to an Android project. --- `58-78`: Test functions correctly verify the conditional addition of dependencies based on the `doNotAddDependencies` flag. --- `81-131`: Test functions correctly verify the conditional addition of dependencies based on the `doNotAddDependencies` flag. --- `134-140`: Method `triggerEvaluate` appropriately handles project evaluation and exceptions, facilitating effective testing of plugin configurations.
File | Coverage [83.33%] | :white_check_mark: |
---|---|---|
robolectric-extension-gradle-plugin/src/main/kotlin/tech/apter/robolectric/junit/jupiter/gradle/plugin/RobolectricJUnitJupiterGradlePlugin.kt | 83.33% | :white_check_mark: |
Total Project Coverage | 65.46% | :white_check_mark: |
---|
File | Coverage [96.97%] | :white_check_mark: |
---|---|---|
robolectric-extension-gradle-plugin/src/main/kotlin/tech/apter/robolectric/junit/jupiter/gradle/plugin/RobolectricJUnitJupiterGradlePlugin.kt | 96.97% | :white_check_mark: |
Total Project Coverage | 82.70% | :white_check_mark: |
---|
Summary by CodeRabbit
New Features
Refactor
Tests