[erlang-questions] An approach to common test

Mahesh Paolini-Subramanya mahesh@REDACTED
Thu Jul 18 19:23:14 CEST 2013

That would actually work quite well, but you need to be sure to tear down your connections etc. in end_per_group (otherwise you'll end up w/ duplicated connections, errors, etc.)
In general, we tend to do this somewhat hierarchically, i.e.
 * init_per_suite : "Global" setup/initializations, that are done just once for the entire test run
 * init_per_group : Any additional setup/initializations necessary for the specific group of testcases being run
 * init_per_testcase : Any setup/initialization necessary for this (and only this!) testcase

Do remember to tear down pretty much everything you setup/initialized in the init_per_*.  Yes, the temptation is always there to say "yeah, the process is going to get killed so what do I care", but trust me, it *will* come back to bite you.


Mahesh Paolini-Subramanya
That Tall Bald Indian Guy...
Google+  | Blog   | Twitter  | LinkedIn

On Jul 17, 2013, at 11:46 AM, Maruthavanan Subbarayan <maruthavanan_s@REDACTED> wrote:

> HI All,
> I am new to common test in erlang, I just wanted to know how to approach the below scenario in common test.
> I have an application that would send group of multiple messages to RMQ, and expects response in back and I have to validate in testcase, so I thought of doing the below.
> all() -> 
> [{group,general_test_group}, {group,rmq_test_group}]
> groups() ->
> [{general_group_test, [sequence], GeneralTestList}
> ,{rmq_test_group, [sequence], RmqTestList}].
> so I thought I can have init_per_group function doing all initialization stuff like queue/exchange creation and bindings and subscribings.
> But I would not be getting the RMQ messages to my test case process, or I would endup in duplication by writing the above in all testcases. 
> Thanks in advance,
> Marutha
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130718/4e7b3f37/attachment.htm>

More information about the erlang-questions mailing list