boss_db:execute error on testing

9 views
Skip to first unread message

Phang Mulianto

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

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.

Thanks

Konstantin Gorshkov

unread,
Jul 13, 2018, 3:56:44 PM7/13/18
to chica...@googlegroups.com
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 chicagoboss...@googlegroups.com.
Visit this group at https://groups.google.com/group/chicagoboss.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/32a7bfeb-1aa6-427e-a461-398c82172473%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Phang Mulianto

unread,
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
Forward
0 new messages