You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to write a simple test for my module and get unexpected error
/soldr-modules/utils/mock/core.lua:864: /soldr-modules/utils/engine/event.lua:488: attempt to call field 'fields_schema_validator' (a nil value)
After a little research, I realized that __mock.module_config hasn't enough data. I found the row with initializing and containing __mock.module_info https://github.com/vxcontrol/soldr-modules/blob/master/utils/mock/core.lua#L693 and was unhappy surprised there are no fields: fields, actions, events. As I understand __mock.module_info should contains data from file <module_name>/<version>/config/info.json.
I crookedly fixed it in my module, but it will be better if __mock.module_info contains real data from <module_name>/<version>/config/info.json.
Describe the bug
I tried to write a simple test for my module and get unexpected error
After a little research, I realized that __mock.module_config hasn't enough data. I found the row with initializing and containing __mock.module_info https://github.com/vxcontrol/soldr-modules/blob/master/utils/mock/core.lua#L693 and was unhappy surprised there are no fields:
fields
,actions
,events
. As I understand __mock.module_info should contains data from file<module_name>/<version>/config/info.json
.I crookedly fixed it in my module, but it will be better if __mock.module_info contains real data from
<module_name>/<version>/config/info.json
.Steps to Reproduce
prepare environment by Wiki: https://github.com/vxcontrol/soldr-modules/wiki/Unit-testing
cd soldr-modules
git fetch origin osquery_linux (if not merged)
Import test code:
./tests_framework/lua/bin/busted.osx64.cmd tests/osquery_linux_client_spec.lua
Expected behavior:
Actual behavior:
Screenshots, screen recording, code snippet
No response
Environment information
Which agent binary used?
The text was updated successfully, but these errors were encountered: