1

I have been trying to explore unit and integration testing frameworks for custom kong plugins. I'm very new to Lua and I started exploring busted and I was not able to successfully run tests on the plugin.

Here are the steps I followed -

  1. I ran a Docker container of kong version 2.5.0
  2. Inside the kong docker container I cloned https://github.com/Kong/kong repo
  3. when I try to run some tests from the above repository's spec folder i get error as ./kong/tools/utils.lua:37: attempt to index global 'ngx' (a nil value)

I'm following this documentation, to understand writing and running unit and integrtion tests in kong, but I'm having hard time setting up the environment.

Any help in setting up a docker container to run unit and integration tests in kong using busted is appreciated.

Ashay Fernandes
  • 353
  • 4
  • 14

0 Answers0