Hi everyone, I wrote a gradle plugin, I want to in...
# gradle
c
Hi everyone, I wrote a gradle plugin, I want to integration testing, what suggestions or simple example, it is a bit difficult to get 🤯
😶 2
j
gradle test kit, there are some examples in the docs but they are not working for me ootb and I have had to change things to get it working
m
My advice would be to not use
withPluginClassPath
stuff
And instead, publish your plugin to a local repo
This way you test 100% in the same conditions as your users
Besides that,
GradleRunner.create()
works well 👍
c
Good idea! I seem to be stuck in the
withPluginClassPath
yesterday
m
You can declare a dependency like:
Copy code
tasks.withType<Test> {
  dependsOn("publishAllPublicationsToPluginTestRepository")
}
Where
pluginTest
is a local repo that you also use in your test projects
c
Thx! cheers
j
What is the difference between
withPluginClassPath
and not? I think it only allows to not set the version, but rest was equal 🤔
And I am generating/deleting the test in
build
folder too
1
m
withPluginClassPath
somewhat bypasses the Gradle classloaders. Since classloaders can have weird behaviours, I find it reassuring to know my tests run in the same conditions as users.
👍 1
z
Please take this to the gradle community slack as this doesn't have anything to do with Kotlin