Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.24 KB

File metadata and controls

50 lines (41 loc) · 1.24 KB

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