Test custom plugins without cloning full Kong repository


#1

I’m following the Plugin Development Guide and it makes it sound like I can set up a test environment for my plugin without cloning the entire Kong repo:

“If you are writing your plugin in your own repository, you will need to copy the following files until the Kong testing framework is released:”

bin/busted
spec/helpers.lua
spec/kong_tests.conf

However, I’ve tried copying these files, but can’t even run bin/busted without errors. On line 64 it tries to pull in kong.globalpatches, which I don’t have because I theoretically don’t have to copy that file.

Out of curiosity, I did copy that file anyway, but then that file just tries to pull in even more dependencies. What gives? Seems like you really can’t run busted without the whole repo.


#2

After coming back to this, I ended up figuring it out. I did have to temporarily clone the Kong repo and run make install. That installed all the Kong modules to my LuaRocks tree.

Now I can develop my plugin in a different directory on my machine, and it is still able to pull in kong.globalpatches and all the other modules