[erlang-questions] rebar3 and CT's main node

Roberto Ostinelli <>
Sun Mar 20 10:22:20 CET 2016

On Sun, Mar 20, 2016 at 10:07 AM, Roberto Ostinelli <>

> Long story short: in my tests I define some callback functions that need
> to be called for the tests to pass.
> However, I need to specify the path to the test directory too, because
> otherwise my slave node doesn't have these functions defined.
> This is how I do the trick now:
> https://github.com/ostinelli/syn/blob/1.2.0/test/syn_test_suite_helper.erl#L59
> (this passes)
> https://github.com/ostinelli/syn/blob/1.2.0/test/syn_test_suite_helper.erl#L60
> (this directory does not exist when I use rebar3).
> SO: is there a way to have rebar copy the test directory to:
> syn/_build/default/lib/syn/test
> ?

Found an alternative to this, leaving it here for anyone interested. I
start the slave node with:

start_slave(NodeShortName) ->
    CodePath = code:get_path(),
    {ok, Node} = ct_slave:start(NodeShortName, [{boot_timeout, 10}]),
    true = rpc:call(Node, code, set_path, [CodePath]),
    {ok, Node}.

Hence I do not need to "rebuild" the directories.

Fred, Tristan, thank you for your help I can consider this matter closed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160320/58f90f34/attachment.html>

More information about the erlang-questions mailing list