Test error but on manual access not error

5 views
Skip to first unread message

Phang Mulianto

unread,
Feb 10, 2018, 11:28:17 AM2/10/18
to ChicagoBoss
Hi,

i have a situation where my code working on manual access , but in test it fails.

The code was to find a record in db, with postgresql. 

my code use 'equals' to find the records.

Data = boss_db:find(caller, [{tname, 'equals', "player1"}]

When i access via browser, the records returned. But when running test , its fail with 500 errors.

anyone experience this? or this is caused by testing using mock and dev using postgresql as db?

Thanks 

Dmitry Polyanovsky

unread,
Feb 10, 2018, 11:38:36 AM2/10/18
to chica...@googlegroups.com
Please post your test code. Stacktrace could help too.

--
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+unsubscribe@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/bb64ec29-6ca0-46eb-961e-80e45a5b9365%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Phang Mulianto

unread,
Feb 14, 2018, 1:38:27 PM2/14/18
to ChicagoBoss
Hi Dymitry, 

Found the culprit anyway.

Data = boss_db:find(caller, [{tname, 'equals', "player1"}]

should be 

Data = boss_db:find(caller, [{tname, 'equals', list_to_binary("player1")}]

With this changes, the functional test working as expected, no error 500 anymore.

but i wonder how to see the error  message trace in func test? it not show the stack, but it seems use the production setup which look for the 500 error tempate.
I have 500 error handling function, and when i disable it to make CB use default 500 error, it complain no 500 error template setup.

so i am in the dark try to figure out why functional test and dev code test manually are different result.

Is this expected to be a binary data feed to the boss_db find on functional test.

Hope this helps with other using the test driven development with CB :).

Thanks 

On Sunday, 11 February 2018 00:38:36 UTC+8, Dmitry Polyanovsky wrote:
Please post your test code. Stacktrace could help too.
On Feb 10, 2018 18:28, "Phang Mulianto" <brav...@gmail.com> wrote:
Hi,

i have a situation where my code working on manual access , but in test it fails.

The code was to find a record in db, with postgresql. 

my code use 'equals' to find the records.

Data = boss_db:find(caller, [{tname, 'equals', "player1"}]

When i access via browser, the records returned. But when running test , its fail with 500 errors.

anyone experience this? or this is caused by testing using mock and dev using postgresql as db?

Thanks 

--
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.
Reply all
Reply to author
Forward
0 new messages