test: EMQX_ETC_DIR for test is app's etc dir
This commit is contained in:
parent
e0dc5645ab
commit
a1551213c8
|
@ -3181,5 +3181,13 @@ resolve_env(Name0) ->
|
||||||
true ->
|
true ->
|
||||||
{ok, Value};
|
{ok, Value};
|
||||||
false ->
|
false ->
|
||||||
error
|
special_env(Name)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-ifdef(TEST).
|
||||||
|
%% when running tests, we need to mock the env variables
|
||||||
|
special_env("EMQX_ETC_DIR") ->
|
||||||
|
{ok, filename:join([code:lib_dir(emqx), etc])}.
|
||||||
|
-else.
|
||||||
|
special_env(_Name) -> error.
|
||||||
|
-endif.
|
||||||
|
|
Loading…
Reference in New Issue