[erlang-questions] Common Tests and config files

Maruthavanan Subbarayan maruthavanan_s@REDACTED
Thu Feb 6 19:24:42 CET 2014


Hi,
I have a application that I want to pass different config files, one for production and one for running tests.








sh-3.2# cat $PROJECT/test/app.config 
[{sample_app, [{test, test}]}].
I have also tried using{sample_app, [{test, test}]}.
and this is my test case, located in $PROJECT/test/sample_app_SUITE.erl directory
my_test_case(_Config) ->    Result = application:load(sample_app),    Environment = application:get_all_env(sample_app),    ct:pal("Loaded Environment:~p", [Result]),    ct:pal("Loaded variables:~p", [Environment]),












    ok.
My source code as of now has nothing. When I run "./rebar ct" and look into log files I see the below result

----------------------------------------------------
2014-02-06 23:41:37.328
Loaded Environment:ok
----------------------------------------------------
2014-02-06 23:41:37.329
Loaded variables:[{included_applications,[]}]
I tried without rebar too
ct_run -noshell -pa "/WorkArea/sample/ebin" "/WorkArea/sample/rebar/rebar/ebin" "/WorkArea/sample/rebar" "/WorkArea/sample/."   -name test@REDACTED -logdir "/WorkArea/sample/logs" -env TEST_DIR "/WorkArea/sample/test"   -config test/app.config -dir test >> /WorkArea/sample/logs/raw.log
Why my app.config variables are not merge and what should I do to get those impacted in environment variables before a test starts? Am I missing out something?
Note: I am able to get the config variable over a file when I use erl -config <files> 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140206/db2ba426/attachment.htm>


More information about the erlang-questions mailing list