From abad0e14bb5a6ea5df21f2732bd72bf6efb0ca1e Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Fri, 23 Feb 2018 04:07:24 +0100 Subject: sort-as: show issue more clearly --- test/rebar_profiles_SUITE.erl | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'test/rebar_profiles_SUITE.erl') diff --git a/test/rebar_profiles_SUITE.erl b/test/rebar_profiles_SUITE.erl index 6afdc39..9f7912d 100644 --- a/test/rebar_profiles_SUITE.erl +++ b/test/rebar_profiles_SUITE.erl @@ -28,7 +28,8 @@ test_profile_erl_opts_order_4/1, test_profile_erl_opts_order_5/1, test_erl_opts_debug_info/1, - first_files_exception/1]). + first_files_exception/1, + deduplication_stability/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -52,7 +53,8 @@ all() -> test_profile_erl_opts_order_4, test_profile_erl_opts_order_5, test_erl_opts_debug_info, - first_files_exception]. + first_files_exception, + deduplication_stability]. init_per_suite(Config) -> application:start(meck), @@ -133,7 +135,7 @@ profile_merge_umbrella_keys(Config) -> {profiles, [{ct, [{vals, [{a,1},{b,2}]}]}]}], - + SubRebarConfig = [{vals, []}, {profiles, [{ct, [{vals, [{c,1}]}]}]}], @@ -546,6 +548,17 @@ first_files_exception(_Config) -> ?assertEqual(["c","a","b","a","e"], rebar_state:get(State1, mib_first_files)), ok. +deduplication_stability(_Config) -> + ?assertEqual([default,all_deps_test], rebar_state:deduplicate([default,all_deps_test])), + ?assertEqual([default,profile1,profile2], rebar_state:deduplicate([default,profile1,profile2])), + ?assertEqual([default,bar,foo], rebar_state:deduplicate([default,bar,foo,bar])), %% master wants [default,foo,bar] + ?assertEqual([default,test,bar], rebar_state:deduplicate([default,test,bar])), + ?assertEqual([default,test,bar], rebar_state:deduplicate([default,test,bar,test])), + ?assertEqual([default,profile1], rebar_state:deduplicate([default,profile1,profile1,profile1])), + ?assertEqual([default,a,b,c,d,e], rebar_state:deduplicate([default,a,b,c,d,e,a,e,b])), + ?assertEqual([default,test], rebar_state:deduplicate([default,test])), + ok. + get_compiled_profile_erl_opts(Profiles, Config) -> AppDir = ?config(apps, Config), PStrs = [atom_to_list(P) || P <- Profiles], -- cgit v1.1 From 6aeff6300bf8986079ac6e8f83fa37150e239810 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Fri, 23 Feb 2018 12:50:29 +0100 Subject: Revert "sort-as: show issue more clearly" This reverts commit 4ad1db97336a3ac070880876ada07d4c7b769327. --- test/rebar_profiles_SUITE.erl | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'test/rebar_profiles_SUITE.erl') diff --git a/test/rebar_profiles_SUITE.erl b/test/rebar_profiles_SUITE.erl index 9f7912d..6afdc39 100644 --- a/test/rebar_profiles_SUITE.erl +++ b/test/rebar_profiles_SUITE.erl @@ -28,8 +28,7 @@ test_profile_erl_opts_order_4/1, test_profile_erl_opts_order_5/1, test_erl_opts_debug_info/1, - first_files_exception/1, - deduplication_stability/1]). + first_files_exception/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -53,8 +52,7 @@ all() -> test_profile_erl_opts_order_4, test_profile_erl_opts_order_5, test_erl_opts_debug_info, - first_files_exception, - deduplication_stability]. + first_files_exception]. init_per_suite(Config) -> application:start(meck), @@ -135,7 +133,7 @@ profile_merge_umbrella_keys(Config) -> {profiles, [{ct, [{vals, [{a,1},{b,2}]}]}]}], - + SubRebarConfig = [{vals, []}, {profiles, [{ct, [{vals, [{c,1}]}]}]}], @@ -548,17 +546,6 @@ first_files_exception(_Config) -> ?assertEqual(["c","a","b","a","e"], rebar_state:get(State1, mib_first_files)), ok. -deduplication_stability(_Config) -> - ?assertEqual([default,all_deps_test], rebar_state:deduplicate([default,all_deps_test])), - ?assertEqual([default,profile1,profile2], rebar_state:deduplicate([default,profile1,profile2])), - ?assertEqual([default,bar,foo], rebar_state:deduplicate([default,bar,foo,bar])), %% master wants [default,foo,bar] - ?assertEqual([default,test,bar], rebar_state:deduplicate([default,test,bar])), - ?assertEqual([default,test,bar], rebar_state:deduplicate([default,test,bar,test])), - ?assertEqual([default,profile1], rebar_state:deduplicate([default,profile1,profile1,profile1])), - ?assertEqual([default,a,b,c,d,e], rebar_state:deduplicate([default,a,b,c,d,e,a,e,b])), - ?assertEqual([default,test], rebar_state:deduplicate([default,test])), - ok. - get_compiled_profile_erl_opts(Profiles, Config) -> AppDir = ?config(apps, Config), PStrs = [atom_to_list(P) || P <- Profiles], -- cgit v1.1 From cfe6dfcca5d6526d835531a81cb5bdc1a21c17b3 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Fri, 23 Feb 2018 13:08:02 +0100 Subject: sort-as: bar profile specializes dep "b" into a version anterior to what test profile wants --- test/rebar_profiles_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/rebar_profiles_SUITE.erl') diff --git a/test/rebar_profiles_SUITE.erl b/test/rebar_profiles_SUITE.erl index 6afdc39..ddc3cf1 100644 --- a/test/rebar_profiles_SUITE.erl +++ b/test/rebar_profiles_SUITE.erl @@ -211,7 +211,7 @@ implicit_profile_deduplicate_deps(Config) -> rebar_test_utils:run_and_check(Config, RebarConfig, ["as", "test,bar", "eunit"], {ok, [{app, Name} ,{dep, "a", "1.0.0"} - ,{dep, "b", "2.0.0"}]}). + ,{dep, "b", "1.0.0"}]}). all_deps_code_paths(Config) -> AppDir = ?config(apps, Config), -- cgit v1.1