[erlang-questions] Examples of Common Test in apps built with rebar/relx?

Michael Truog mjtruog@REDACTED
Tue Oct 28 00:29:37 CET 2014


I like using reltool_util (https://github.com/okeuday/reltool_util/) to start applications within CT tests, since it can handle many edge-cases.  If you wanted to start a release inside a CT test you could do it with reltool_util:boot_start/1 or reltool_util:script_start/1. Normally, I use reltool_util:application_start/3 for CT test suites which has the added benefit of accepting application env settings for separate test cases.  A minimal example is here https://github.com/CloudI/cloudi_service_queue/blob/master/test/cloudi_write_ahead_logging_SUITE.erl .

On 10/27/2014 03:37 PM, Loïc Hoguin wrote:
> I wouldn't show Cowboy's test suites to a beginner. There's a lot of things that are unusual there from the cowboy_test module to a ct hook and error_logger handler.
>
> It also does not use rebar, but erlang.mk instead. Rebar making common_test runs very slow was the very first thing that made me move toward using Make and ultimately writing erlang.mk.
>
> It also does not use relx, although that's a smaller concern because Cowboy is just an Erlang application and not a whole system. I am not aware of people who run relx releases from inside common_test, although that's something I wish I could do sometimes.
>
> On 10/27/2014 11:10 PM, Alex Shneyderman wrote:
>> https://github.com/ninenines/cowboy/blob/master/test/http_SUITE.erl
>>
>> On Mon, Oct 27, 2014 at 1:45 PM, Nathan Fiedler <nathanfiedler@REDACTED
>> <mailto:nathanfiedler@REDACTED>> wrote:
>>
>>     I'm a beginner, so bear in mind I may be doing all of this
>>     incorrectly. I started with Fred Hebert's How I Start tutorial [1]
>>     and went from there. I have a very simple application that is built
>>     and assembled using a combination of rebar and relx; that much
>>     works. I have a single eunit test that exercises the one operation I
>>     have implemented to date. So far, so good. I would like to instead
>>     use Common Test, but I've run into a problem: noproc error.
>>     Apparently something is not getting started when I run ct but is
>>     fine with eunit and when I run the application manually.
>>
>>     Looking around for examples, I found ejabberd, but I'm not certain I
>>     understand how it's wired together, much less tested.
>>
>>     My question to the group is, do you have any favorite (open source)
>>     examples of applications that use Common Test and are assembled with
>>     rebar and relx? I am being specific because it seems to me that the
>>     tools have a big impact on how the code is setup and started.
>>
>>     Thanks
>>
>>     n
>>
>>     [1] http://howistart.org/posts/erlang/1
>>
>>
>>     _______________________________________________
>>     erlang-questions mailing list
>>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>>     http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>




More information about the erlang-questions mailing list