App env vars overwritten when config specified in ERL_FLAGS on second app eunit tested

David Smith dizzyd at
Thu Feb 9 12:02:18 EST 2012

This sounds like a bug to me, no?

On Thu, Feb 9, 2012 at 6:40 AM, Jeremy Raymond <jeraymond at> wrote:
> When I run rebar eunit I pass an app configuration via the ERL_FLAGS
> environment variable with app overrides for testing purposes
>    $ ERL_FLAGS="-config test.config" ./rebar eunit
> The first eunit tested app has access to the flags, but the second app
> to get eunit tested doesn't. The default rebar behaviour to reset app
> env vars after testing each app is wiping them out. Looking at the
> code the intent seems to be to reset the app vars to their state
> before the tests were run (perhaps in case the tests modified them).
> However rebar_eunit:reconstruct_app_env_vars/1 is only consulting the
> .app file for env vars which is overriding the values supplied in the
> config file though the opposite should be true (the config file should
> override the .app vars).
> Setting eunit_opts {reset_after_eunit, false} in rebar.config can
> workaround the problem by disabling the resets. But now we're at the
> mercy of the tests not messing the the env vars.
> --
> Jeremy
> _______________________________________________
> rebar mailing list
> rebar at

Dave Smith
VP, Engineering
Basho Technologies, Inc.
dizzyd at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rebar mailing list