From 057a0b8a6616f1d078eed97519be12b32a76299b Mon Sep 17 00:00:00 2001 From: Chrono Date: Wed, 11 Sep 2024 15:49:03 +0800 Subject: [PATCH] tests(helpers): support ldoc generation (#13636) KAG-5333, support ldoc generation. - edit `config.ld`, add directory `./details` and `merge=true` - add `@module` header for separated test modules --- spec/config.ld | 3 ++- spec/details/dns.lua | 8 ++++++++ spec/details/misc.lua | 8 ++++++++ spec/details/shell.lua | 8 ++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/spec/config.ld b/spec/config.ld index e91166f7af98..79e2c9838615 100644 --- a/spec/config.ld +++ b/spec/config.ld @@ -2,10 +2,11 @@ project='Kong test helpers' title='Kong test framework' description='Test helper functions for Kong (integration) testing' format='markdown' -file={'./helpers.lua','./helpers'} +file={'./helpers.lua','./helpers','./details'} dir='docs' readme='README.md' sort=true sort_modules=true style='./' no_space_before_args=true +merge=true diff --git a/spec/details/dns.lua b/spec/details/dns.lua index 792ed4bc0873..d7aa04111885 100644 --- a/spec/details/dns.lua +++ b/spec/details/dns.lua @@ -1,3 +1,11 @@ +------------------------------------------------------------------ +-- Collection of utilities to help testing Kong features and plugins. +-- +-- @copyright Copyright 2016-2022 Kong Inc. All rights reserved. +-- @license [Apache 2.0](https://opensource.org/licenses/Apache-2.0) +-- @module spec.helpers + + local cjson = require("cjson.safe") diff --git a/spec/details/misc.lua b/spec/details/misc.lua index 0a288ff13b85..3cd97a91c6fa 100644 --- a/spec/details/misc.lua +++ b/spec/details/misc.lua @@ -1,3 +1,11 @@ +------------------------------------------------------------------ +-- Collection of utilities to help testing Kong features and plugins. +-- +-- @copyright Copyright 2016-2022 Kong Inc. All rights reserved. +-- @license [Apache 2.0](https://opensource.org/licenses/Apache-2.0) +-- @module spec.helpers + + -- miscellaneous diff --git a/spec/details/shell.lua b/spec/details/shell.lua index fffdfc49358d..76a5005d3b91 100644 --- a/spec/details/shell.lua +++ b/spec/details/shell.lua @@ -1,3 +1,11 @@ +------------------------------------------------------------------ +-- Collection of utilities to help testing Kong features and plugins. +-- +-- @copyright Copyright 2016-2022 Kong Inc. All rights reserved. +-- @license [Apache 2.0](https://opensource.org/licenses/Apache-2.0) +-- @module spec.helpers + + local shell = require("resty.shell") local conf_loader = require("kong.conf_loader") local strip = require("kong.tools.string").strip