aboutsummaryrefslogtreecommitdiffstats
path: root/test/rlx_release_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/rlx_release_SUITE.erl')
-rw-r--r--test/rlx_release_SUITE.erl30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/rlx_release_SUITE.erl b/test/rlx_release_SUITE.erl
index f123e79..e7b6c22 100644
--- a/test/rlx_release_SUITE.erl
+++ b/test/rlx_release_SUITE.erl
@@ -29,6 +29,7 @@
make_scriptless_release/1,
make_overridden_release/1,
make_skip_app_release/1,
+ make_exclude_app_release/1,
make_auto_skip_empty_app_release/1,
make_app_type_none_release/1,
make_rerun_overridden_release/1,
@@ -68,7 +69,7 @@ init_per_testcase(_, Config) ->
all() ->
[make_release, make_extend_release, make_scriptless_release,
make_overridden_release, make_auto_skip_empty_app_release,
- make_skip_app_release, make_app_type_none_release,
+ make_skip_app_release, make_exclude_app_release, make_app_type_none_release,
make_implicit_config_release, make_rerun_overridden_release,
overlay_release, make_goalless_release, make_depfree_release,
make_invalid_config_release, make_relup_release, make_relup_release2,
@@ -309,6 +310,33 @@ make_skip_app_release(Config) ->
?assertNot(lists:member({goal_app_2, "0.0.1"}, AppSpecs)),
?assert(lists:member({lib_dep_1, "0.0.1", load}, AppSpecs)).
+%% Test to ensure that an excluded app and its deps are not included in a release
+make_exclude_app_release(Config) ->
+ LibDir1 = proplists:get_value(lib1, Config),
+
+ rlx_test_utils:create_app(LibDir1, "goal_app_1", "0.0.1", [stdlib,kernel, non_goal_1], []),
+ rlx_test_utils:create_app(LibDir1, "non_goal_1", "0.0.1", [stdlib,kernel, non_goal_2], []),
+ rlx_test_utils:create_app(LibDir1, "non_goal_2", "0.0.1", [stdlib,kernel], []),
+
+ ConfigFile = filename:join([LibDir1, "relx.config"]),
+ rlx_test_utils:write_config(ConfigFile,
+ [{release, {foo, "0.0.1"},
+ [goal_app_1]},
+ {exclude_apps, [non_goal_1]}]),
+ OutputDir = filename:join([proplists:get_value(data_dir, Config),
+ rlx_test_utils:create_random_name("relx-output")]),
+ {ok, Cwd} = file:get_cwd(),
+ {ok, State} = relx:do(Cwd, undefined, undefined, [], [LibDir1], 3,
+ OutputDir, [],
+ ConfigFile),
+ [{{foo, "0.0.1"}, Release}] = ec_dictionary:to_list(rlx_state:realized_releases(State)),
+ AppSpecs = rlx_release:applications(Release),
+ ?assert(lists:keymember(stdlib, 1, AppSpecs)),
+ ?assert(lists:keymember(kernel, 1, AppSpecs)),
+ ?assertNot(lists:member({non_goal_1, "0.0.1"}, AppSpecs)),
+ ?assertNot(lists:member({non_goal_2, "0.0.1"}, AppSpecs)),
+ ?assert(lists:member({goal_app_1, "0.0.1"}, AppSpecs)).
+
make_auto_skip_empty_app_release(Config) ->
DataDir = proplists:get_value(data_dir, Config),
EmptyAppDir1 = filename:join([DataDir, rlx_test_utils:create_random_name("skip_app_dir_")]),