Skip to content

Instantly share code, notes, and snippets.

@gerin98
Last active August 19, 2024 16:09
Show Gist options
  • Save gerin98/b60333ced7272997fb6785635f30cfa4 to your computer and use it in GitHub Desktop.
Save gerin98/b60333ced7272997fb6785635f30cfa4 to your computer and use it in GitHub Desktop.
[Blogpost] Creating a helper class to filter unit tests
class FilterUnitTests {
fun getResult(project: Project): List<String> {
val fileComponent = FilesChangedComponent(project)
val modulesComponent = ModulesChangedComponent(project)
val filesChanged = fileComponent.diff()
val modulesChanged = modulesComponent.affectedModules(filesChanged)
return modulesChanged.map {
val moduleName = it.split("/").last()
"com.wf.$moduleName.*"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment