Skip to content

Plugin for running tests based on impact analysis of changes

License

Notifications You must be signed in to change notification settings

SunnyDayDev/test-impact-plugin

Repository files navigation

test-impact-plugin

Plugin for running tests based on impact analysis of changes.

Integration

// settings.gradle.kts

pluginManagement {
    repositories {
        maven { url = uri("https://jitpack.io" )}
        // ...
    }
}
// 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.

./gradlew testImpact

To run the specified tests if they are affected, run the tests after the testImpact task.

./gradlew testImpact :subproject:test

About

Plugin for running tests based on impact analysis of changes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages