boss_db:execute error on testing

Skip to first unread message

Phang Mulianto

Jul 13, 2018, 1:52:05 PM7/13/18
to ChicagoBoss

I have a situation here. maybe some have experience it. I found no answer on the list.

when i do run the test, my test fail on some fun which have boss_db:execute(query)

here are the error trace.

Root test                                                   {"init terminating in do_boot",{{undef,[{boss_db_adapter_mock,execute,[undefined,"select * from pmusers"],[]},{boss_db_controller,handle_call,3,[{file,"src/boss_db_controller.erl"},{line,197}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,639}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]},{gen_server,call,[<0.214.0>,{execute,"select * from pmusers"},30000]}}}

as i look, seems on boss_db_adapter_mock.erl source , there are no execute func.

so how  do we test the boss_db:execute() . 
Do we just mock it using meck ?
is this the correct way to handle this situation.


Konstantin Gorshkov

Jul 13, 2018, 3:56:44 PM7/13/18
Mock doesn't support the SQL interface. It isn't suitable for complex tests. It's best to use mysql or postgres in the test environment.

You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Phang Mulianto

Jul 15, 2018, 10:01:04 AM7/15/18
to ChicagoBoss
Ah ic. how is the performance on test while hit the real DB.

i use mock because its in memory access, fast for test.
Reply all
Reply to author
0 new messages