diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2017-06-01 15:31:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-01 15:31:46 -0400 |
commit | 5ab3230649e30080ce88241f445eeed90a461792 (patch) | |
tree | 083ca6d22bc7c39242fd6e0efa59ef38794024bd /test/rebar_release_SUITE.erl | |
parent | 87e756d8dc30270a90d0fc12186bc4b14c1543a5 (diff) | |
parent | 249b5f13eb8f1859d7a70ab316bc7541543aaf57 (diff) |
Merge pull request #1563 from djnym/relx-overlay-fix
Avoid reversing relx overlays.
Diffstat (limited to 'test/rebar_release_SUITE.erl')
-rw-r--r-- | test/rebar_release_SUITE.erl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/rebar_release_SUITE.erl b/test/rebar_release_SUITE.erl index 1125a7e..e41339b 100644 --- a/test/rebar_release_SUITE.erl +++ b/test/rebar_release_SUITE.erl @@ -11,6 +11,7 @@ all() -> [release, profile_ordering_sys_config_extend_3_tuple_merge, extend_release, user_output_dir, profile_overlays, + profile_overlay_merge, overlay_vars]. init_per_testcase(Case, Config0) -> @@ -217,6 +218,30 @@ profile_overlays(Config) -> {dir, filename:join(ReleaseDir, "randomdir")}]} ). +profile_overlay_merge (_Config) -> + % when profile and relx overlays both exist, the profile overlays should be + % first, then the relx overlays, all the rest of the config should come + % after, rebar_relx:merge_overlays/1 should do this. + RelxOverlay = [{mkdir, "1_from_relx"}, {mkdir, "2_from_relx"}], + ProfileOverlay = [{mkdir, "0_from_other_profile"}], + OtherConfig = [{other1, config}, {other2, config}], + + % test with no overlays + ?assertEqual([{overlay,[]}] ++ OtherConfig, + rebar_relx:merge_overlays(OtherConfig)), + + % test with relx only, just move overlays to the top + RelxOnly = OtherConfig ++ [{overlay, RelxOverlay}], + ?assertEqual([{overlay, RelxOverlay}]++OtherConfig, + rebar_relx:merge_overlays(RelxOnly)), + + % now test with a profile (profiles end up after relx overlays + ProfilesToMerge = OtherConfig ++ + [{overlay, RelxOverlay}, + {overlay, ProfileOverlay}], + ?assertEqual([{overlay, ProfileOverlay ++ RelxOverlay}] ++ OtherConfig, + rebar_relx:merge_overlays(ProfilesToMerge)). + overlay_vars(Config) -> AppDir = ?config(apps, Config), Name = ?config(name, Config), |