<div dir="ltr"><div class="gmail_extra">Thank you for the help.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 19, 2016 at 1:14 PM, Fred Hebert <span dir="ltr"><<a href="mailto:mononcqc@ferd.ca" target="_blank">mononcqc@ferd.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p dir="ltr">If the default mode isn't enough, the easiest solution is always:</p>
<p dir="ltr">    ct_run -dir test -pa `rebar3 path`</p>
<p dir="ltr">Which makes your whole app available to the tests. You can bypass rebar3 for the run, but still use it for the rest.</p></blockquote><div><br></div><div>This fixes the node naming issue, but unfortunately this not enough to make it work.<br></div><div><br></div><div>Long story short: in my tests I define some callback functions that need to be called for the tests to pass.</div><div>However, I need to specify the path to the test directory too, because otherwise my slave node doesn't have these functions defined.</div><div><br></div><div>This is how I do the trick now:</div><div><a href="https://github.com/ostinelli/syn/blob/1.2.0/test/syn_test_suite_helper.erl#L59">https://github.com/ostinelli/syn/blob/1.2.0/test/syn_test_suite_helper.erl#L59</a> (this passes)<br></div><div><a href="https://github.com/ostinelli/syn/blob/1.2.0/test/syn_test_suite_helper.erl#L60">https://github.com/ostinelli/syn/blob/1.2.0/test/syn_test_suite_helper.erl#L60</a> (this directory does not exist when I use rebar3).<br></div><div><br></div><div>SO: is there a way to have rebar copy the test directory to:</div><div>syn/_build/default/lib/syn/test</div><div><br></div><div>?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<p dir="ltr">You may want to try:</p>
<p dir="ltr">    rebar3 shell --sname=mynode<br>
     ...<br>
    r3:do(ct).</p>
<p dir="ltr">To run tests from the interactive shell with a named node, but I have never tried that and don't know how it would go.</p></blockquote><div>This actually works, though I see an "experimental" warning on top and I cannot really automate it in a script, as there's no `--eval` option in `rebar shell`.</div><div><br></div><div>So I've tried adding a test.escript file:</div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">%%%%%%%%%%%%%%%%%%%</font></div></div><div><div><font face="monospace, monospace">#!/usr/bin/env escript</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">main(_) -></font></div><div><span style="font-family:monospace,monospace">    r3:do(ct),</span><br></div><div><font face="monospace, monospace">    init:stop().</font></div></div><div><font face="monospace, monospace">%%%%%%%%%%%%%%%%%%%</font></div><div><br></div><div><br></div><div>But:</div><div><br></div><div><br></div><div><font face="monospace, monospace">$ rebar3 shell --sname=mynode --script test.escript<br></font></div><div><font face="monospace, monospace">===> Verifying dependencies...<br></font></div><div><div><font face="monospace, monospace">===> Compiling syn</font></div><div><font face="monospace, monospace">Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Eshell V7.3  (abort with ^G)</font></div><div><font face="monospace, monospace">(mynode@robertos-neato)1> ===> Couldn't run shell escript "/Users/roberto/workspace/syn/test.escript" - exit:{noproc,</font></div><div><font face="monospace, monospace">                                                                                               {gen_server,</font></div><div><font face="monospace, monospace">                                                                                                call,</font></div><div><font face="monospace, monospace">                                                                                                [rebar_agent,</font></div><div><font face="monospace, monospace">                                                                                                 {cmd,</font></div><div><font face="monospace, monospace">                                                                                                  ct},</font></div><div><font face="monospace, monospace">                                                                                                 infinity]}}</font></div><div><font face="monospace, monospace">Stack: [{gen_server,call,3,[{file,"gen_server.erl"},{line,212}]},</font></div><div><font face="monospace, monospace">        {test_escript__escript__1458__464329__444078__2,main,1,</font></div><div><font face="monospace, monospace">            [{file,"/Users/roberto/workspace/syn/test.escript"},{line,5}]},</font></div></div><div><br></div><div><br></div><div><br></div><div>And I'm stuck.</div><div><br></div><div>Any ideas?</div></div></div></div>