https://github.com/sunnydaydev/test-impact-plugin
Plugin for running tests based on impact analysis of changes
https://github.com/sunnydaydev/test-impact-plugin
Last synced: 11 months ago
JSON representation
Plugin for running tests based on impact analysis of changes
- Host: GitHub
- URL: https://github.com/sunnydaydev/test-impact-plugin
- Owner: SunnyDayDev
- License: mit
- Created: 2023-05-09T19:07:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-22T03:51:05.000Z (over 1 year ago)
- Last Synced: 2025-04-01T18:23:46.157Z (over 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 89.8 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://jitpack.io/#dev.sunnyday/test-impact-plugin)
# test-impact-plugin
Plugin for running tests based on impact analysis of changes.
# Integration
```kotlin
// settings.gradle.kts
pluginManagement {
repositories {
maven { url = uri("https://jitpack.io" )}
// ...
}
}
```
```kotlin
// build.gradle.kts
plugins {
id("dev.sunnyday.test-impact-plugin")
}
testImpact {
// Later, predefined providers will be added here, such as androidTests("buildType"...)
testTaskNameProvider = TestTaskNameProvider {
listOf("test")
}
// Later, predefined sources will be added here, such as git diff
changesSource = ChangesSource {
listOf(
"subproject/src/main/kotlin/some/package/SomeClass.kt",
)
}
}
```
# Execution
Currently testImpact requires to be a start task to run properly, otherwise it will be ignored.
To run all the affected tests, simply run the task, and when it completes, the tasks specified in `testTaskNameProvider` will run.
```bash
./gradlew testImpact
```
To run the specified tests if they are affected, run the tests after the testImpact task.
```bash
./gradlew testImpact :subproject:test
```