From 02caf6297db344348f43b39dbe55b80420633d5f Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Mon, 16 Oct 2017 23:57:08 +0100 Subject: Profile deps counter test --- test/rebar_compile_SUITE.erl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl index 6579617..0b62cbe 100644 --- a/test/rebar_compile_SUITE.erl +++ b/test/rebar_compile_SUITE.erl @@ -40,6 +40,7 @@ clean_all/1, override_deps/1, profile_override_deps/1, + profile_deps/1, deps_build_in_prod/1, include_file_relative_to_working_directory/1, include_file_in_src/1, @@ -75,6 +76,7 @@ all() -> parse_transform_test, erl_first_files_test, mib_test, umbrella_mib_first_test, only_default_transitive_deps, clean_all, override_deps, profile_override_deps, deps_build_in_prod, + profile_override_deps, profile_deps, deps_build_in_prod, include_file_relative_to_working_directory, include_file_in_src, include_file_relative_to_working_directory_test, include_file_in_src_test, recompile_when_parse_transform_as_opt_changes, @@ -1305,6 +1307,19 @@ profile_override_deps(Config) -> {ok, [{dep, "some_dep"},{dep_not_exist, "other_dep"}]} ). +profile_deps(Config) -> + mock_git_resource:mock([{deps, [{some_dep, "0.0.1"},{other_dep, "0.0.1"}]}]), + Deps = rebar_test_utils:expand_deps(git, [{"some_dep", "0.0.1", [{"other_dep", "0.0.1", []}]}]), + TopDeps = rebar_test_utils:top_level_deps(Deps), + + RebarConfig = [ + {deps, TopDeps}, + {profiles, [{a, []}]}], + rebar_test_utils:run_and_check( + Config, RebarConfig, ["as", "a", "compile"], + {ok, [{dep, "some_dep"},{dep, "other_dep"}]} + ). + %% verify a deps prod profile is used %% tested by checking prod hooks run and outputs to default profile dir for dep %% and prod deps are installed for dep -- cgit v1.1 From 510748e099b27e7ccff33524f38895f306925587 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Tue, 21 Nov 2017 16:41:00 -0500 Subject: Fix test mocking for profile overrides --- test/rebar_compile_SUITE.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl index 62df7aa..c5336cf 100644 --- a/test/rebar_compile_SUITE.erl +++ b/test/rebar_compile_SUITE.erl @@ -1290,9 +1290,10 @@ override_deps(Config) -> ). profile_override_deps(Config) -> - mock_git_resource:mock([{deps, [{some_dep, "0.0.1"},{other_dep, "0.0.1"}]}]), Deps = rebar_test_utils:expand_deps(git, [{"some_dep", "0.0.1", [{"other_dep", "0.0.1", []}]}]), TopDeps = rebar_test_utils:top_level_deps(Deps), + {SrcDeps, _} = rebar_test_utils:flat_deps(Deps), + mock_git_resource:mock([{deps, SrcDeps}]), RebarConfig = [ {deps, TopDeps}, @@ -1310,9 +1311,10 @@ profile_override_deps(Config) -> ). profile_deps(Config) -> - mock_git_resource:mock([{deps, [{some_dep, "0.0.1"},{other_dep, "0.0.1"}]}]), Deps = rebar_test_utils:expand_deps(git, [{"some_dep", "0.0.1", [{"other_dep", "0.0.1", []}]}]), TopDeps = rebar_test_utils:top_level_deps(Deps), + {SrcDeps, _} = rebar_test_utils:flat_deps(Deps), + mock_git_resource:mock([{deps, SrcDeps}]), RebarConfig = [ {deps, TopDeps}, -- cgit v1.1