lunarmodules / busted

Elegant Lua unit testing.
https://lunarmodules.github.io/busted/
MIT License
1.4k stars 185 forks source link

Exclude folders / files on coverage reports luacov.stats.out #614

Closed enrialonso closed 3 years ago

enrialonso commented 4 years ago

Hi people!

I try to exclude files on my reports coverage but for the moment it's not possible for me.

all test run over a docker container.

The folders of the test files are:

/usr/local/openresty/lualib/helper/spec

Run this command to execute the test:

busted /usr/local/openresty/lualib/helper/ -c

This command generate a luacov.stats.out and include files and dependencies that do not interest me, and the end of the report include my files test.

example file: luacov.stats.out

3:/usr/local/openresty/luajit/lib/luarocks/rocks-5.1/busted/2.0.0-1/bin/busted 0 0 1 163:/usr/local/openresty/luajit/share/lua/5.1/busted/block.lua 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 2 1802 0 1802 1804 0 2 106 106 1908 3498 5$38:/usr/local/openresty/luajit/share/lua/5.1/busted/compatibility.lua 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 124:/usr/local/openresty/luajit/share/lua/5.1/busted/context.lua 0 0 0 10 450 440 0 10 10 10 20 10 0 0 0 10 478 468 0 1082 1072 0 $315:/usr/local/openresty/luajit/share/lua/5.1/busted/core.lua 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 $31:/usr/local/openresty/luajit/share/lua/5.1/busted/environment.lua 0 0 0 0 0 0 0 10686 0 10612 24654 10612 0 0 0 268 268 268 0 0 4936 0 0 0 536 268 0 0 0 0 10 72:/usr/local/openresty/luajit/share/lua/5.1/busted/execute.lua 2 2 2 0 0 0 0 0 0 0 0 0 2 0 0 2 0 0 2 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127:/usr/local/openresty/luajit/share/lua/5.1/busted/init.lua 0 0 0 0 10 20 10 0 10 10 0 0 58 116 58 0 58 58 0 0 106 106 0 212 0 0 0 0 0$50:/usr/local/openresty/luajit/share/lua/5.1/busted/languages/en.lua 2 0 2 0 0 2 2 2 2 0 2 2 2 2 0 2 2 2 2 0 2 2 2 2 0 2 0 2 2 0 0 2 2 0 0 0 0 0 0 0 0 2 2 0 0 0 0 0 2 2 23:/usr/local/openresty/luajit/share/lua/5.1/busted/modules/files/lua.lua 2 0 2 0 0 164 328 164 2 0 0 20 2 0 0 10 10 0 0 10 2 0 2

....

21:/usr/local/openresty/lualib/helper/spec/api_gw_spec.lua 2 2 2 2 2 2 0 1 0 1 0 1 0 3 3 0 3 4 2 2 3 275:/usr/local/openresty/lualib/helper/spec/authentication_spec.lua 2 2 2 2 2 0 1 0 1 0 1 0 3 3 0 3 1 1 1 2 6 5 2 5 2 2 0 3 0 3 1 1 1 1 0$76:/usr/local/openresty/lualib/helper/spec/logger_spec.lua 2 2 2 2 0 3 3 0 3 1 1 3 2 0 3 1 1 3 2 2 0 3 0 3 1 3 5 2 0 3 1 1 148:/usr/local/openresty/lualib/helper/spec/redis_spec.lua 2 2 2 2 0 1 0 1 0 1 0 1 11 20 11 9 11 11 7 11 11 4 11 11 5 11 1

how to filter this files on the report?

Tieske commented 4 years ago

not sure where LuaCov filters, when recording, or when reporting. Have you tried creating a luacov config file?

Tieske commented 3 years ago

fixed by #660