From 799aff81d6c98b325bc819048c08f0bc9455d29c Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 5 Dec 2024 14:10:03 +0100 Subject: [PATCH] feat(luacov): prepare for newly released luacov html reporter --- CHANGELOG.md | 3 +++ assets/init/busted | 2 +- assets/init/luacov | 7 +++++++ pongo.sh | 7 +++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55adfe08..b9a9a14e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ * Fix: pass http-proxy variables when building `expose` [#637](https://github.com/Kong/kong-pongo/pull/637). +* Feat: prepare for LuaCov html reporter (in LuaCov 0.16.0) + [#638](https://github.com/Kong/kong-pongo/pull/638). + --- ## 2.14.0 released 24-Sep-2024 diff --git a/assets/init/busted b/assets/init/busted index ca66496a..313c185c 100644 --- a/assets/init/busted +++ b/assets/init/busted @@ -1,7 +1,7 @@ return { default = { verbose = true, - coverage = false, + coverage = true, output = "gtest", }, } diff --git a/assets/init/luacov b/assets/init/luacov index 07c19d8b..a503e5e5 100644 --- a/assets/init/luacov +++ b/assets/init/luacov @@ -3,5 +3,12 @@ include = { } statsfile = "/kong-plugin/luacov.stats.out" + +-- default reporter (text) reportfile = "/kong-plugin/luacov.report.out" + +-- html reporter +-- reportfile = "/kong-plugin/luacov.report.html" +-- reporter = "html" + runreport = true diff --git a/pongo.sh b/pongo.sh index 789f69ef..1b632863 100755 --- a/pongo.sh +++ b/pongo.sh @@ -1074,6 +1074,13 @@ function pongo_init { echo "luacov.report.out" >> .gitignore msg "added 'luacov.report.out' to '.gitignore'" fi + if grep --quiet "^luacov[.]report[.]html$" .gitignore ; then + msg "'.gitignore' already ignores 'luacov.report.html'" + else + echo "# exclude LuaCov html report" >> .gitignore + echo "luacov.report.html" >> .gitignore + msg "added 'luacov.report.html' to '.gitignore'" + fi if grep --quiet "^[.]containerid$" .gitignore ; then msg "'.gitignore' already ignores '.containerid'" else