Kong/kong-python-pdk

Plugin Testing Patterns

wjziv opened this issue · 4 comments

wjziv commented

I've been working with Kong and custom plugins for about a month now; powerful stuff!

As my plugin collection is growing, and complexity is increasing, I was wondering what kind of testing schemes you would recommend for python specifically? I'm not able to find very much in the docs for this particular side of non-lua plugin development.

Currently, we achieve integration tests through Kong deployed in kind with an echo server.
Validation there, and recommendations for unit tests and "mock kong"s would be great!

Thanks!

Hi @wjziv , we haven't implemented "mock kong" test yet, but that's on our roadmap. Please stay tuned for this issue!

wjziv commented

Super glad to hear it's on the roadmap!

Are there suggested testing patterns put forth by Kong generally for plugin development?
If integration tests over a cluster which services echo servers alone are the end-all, be-all of tests, that's fine.

Checking to see if there's anything I've missed in this regard.

@wjziv usually you will need both for good coverage. The "mock kong" suite is more for a semi-e2e test, it will help you catch typos, type mismatches regarding your RPC calls, and also helps you do unit test on your plugin's functionality. And I recommand to also have an additional (real) e2e test setup.

Hi guys, any updates about mock kong?