<div dir="ltr"><div>Thank you Jesper,<br></div><div>I *very* rarely do it. However, I'm in need to slow down a node to allow for distributed tests to work.</div><div class="gmail_extra"><br></div><div class="gmail_extra">BTW this is exactly what I'm doing right now.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best,</div><div class="gmail_extra">r.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 5:18 PM, Jesper Louis Andersen <span dir="ltr"><<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Dec 10, 2015 at 5:10 PM, Roberto Ostinelli <span dir="ltr"><<a href="mailto:roberto@widetag.com" target="_blank">roberto@widetag.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Ideally, I would like to define a conditional macro depending on code running in tests or not.</div><div><br></div></blockquote><div><br></div></span><div>You can probably have a configuration option via application:get_env/2 you can use to make the discrimination. On the top of my head, this is what I would do.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div><div>Any ideas welcome!</div></blockquote></div><br></div><div class="gmail_extra">Advice: don't do it. Keep your test artifact equivalent to the deployment artifact. Make the application such that normal configuration parameters can be set in order to make the application work in the test environment. It is safer in the long run because you don't want too many diverging code paths based on the environment it lives in. It is simply too brittle, and that would be my advice.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br><br>-- <br><div>J.</div>
</div></font></span></div>
</blockquote></div><br></div></div>