aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/rlx_command_SUITE.erl16
-rw-r--r--test/rlx_discover_SUITE.erl25
-rw-r--r--test/rlx_release_SUITE.erl21
3 files changed, 31 insertions, 31 deletions
diff --git a/test/rlx_command_SUITE.erl b/test/rlx_command_SUITE.erl
index 26783ff..db2794d 100644
--- a/test/rlx_command_SUITE.erl
+++ b/test/rlx_command_SUITE.erl
@@ -61,19 +61,18 @@ normal_passing_case(Config) ->
"-n", RelName, "-v", RelVsn, "-o", Outdir, "-a", "lib1:"++binary_to_list(Lib1)],
{ok, {Opts, Targets}} = getopt:parse(relx:opt_spec_list(), CmdLine),
{ok, State} = rlx_cmd_args:args2state(Opts, Targets),
- {ConfigProvider, {ok, State1}} = rlx_provider:new(rlx_prv_config, State),
- {ok, State2} = rlx_provider:do(ConfigProvider, State1),
- Overrides = rlx_state:overrides(State2),
+ {ok, State1} = rlx_config:do(State),
+ Overrides = rlx_state:overrides(State1),
?assertMatch([{lib1, Lib1}], Overrides),
?assertMatch([Lib1, Lib2],
- rlx_state:lib_dirs(State2)),
- ?assertMatch(Outdir, rlx_state:base_output_dir(State2)),
+ rlx_state:lib_dirs(State1)),
+ ?assertMatch(Outdir, rlx_state:base_output_dir(State1)),
?assertMatch([{app1,{{33,33},{[],[<<"build4">>]}},lte},
{app2,
{{33,22},{[],[]}},
{{45,22},{[],[<<"build">>,21]}}, between}],
- rlx_state:goals(State2)).
+ rlx_state:goals(State1)).
lib_expansion_case(Config) ->
DataDir = proplists:get_value(data_dir, Config),
@@ -85,10 +84,9 @@ lib_expansion_case(Config) ->
CmdLine = ["-l", filename:join(DataDir, "*")],
{ok, {Opts, Targets}} = getopt:parse(relx:opt_spec_list(), CmdLine),
{ok, State} = rlx_cmd_args:args2state(Opts, Targets),
- {ConfigProvider, {ok, State1}} = rlx_provider:new(rlx_prv_config, State),
- {ok, State2} = rlx_provider:do(ConfigProvider, State1),
+ {ok, State1} = rlx_config:do(State),
?assertMatch([Lib1, Lib2],
- rlx_state:lib_dirs(State2)).
+ rlx_state:lib_dirs(State1)).
lib_fail_case(Config) ->
DataDir = proplists:get_value(data_dir, Config),
diff --git a/test/rlx_discover_SUITE.erl b/test/rlx_discover_SUITE.erl
index 7e7015c..2db8e4d 100644
--- a/test/rlx_discover_SUITE.erl
+++ b/test/rlx_discover_SUITE.erl
@@ -49,11 +49,10 @@ init_per_testcase(_, Config) ->
ok = rlx_util:mkdir_p(LibDir1),
ok = rlx_util:mkdir_p(LibDir2),
State = rlx_state:new([], [{lib_dirs, [LibDir1, LibDir2]}], [release]),
- {ConfigProvider, {ok, State1}} = rlx_provider:new(rlx_prv_config, State),
- {ok, State2} = rlx_provider:do(ConfigProvider, State1),
+ {ok, State1} = rlx_config:do(State),
[{lib1, LibDir1},
{lib2, LibDir2},
- {state, State2} | Config].
+ {state, State1} | Config].
all() ->
@@ -78,8 +77,9 @@ normal_case(Config) ->
|| _ <- lists:seq(1, 100)]],
State0 = rlx_state:put(proplists:get_value(state, Config),
default_libs, false),
- {DiscoverProvider, {ok, State1}} = rlx_provider:new(rlx_prv_discover, State0),
- {ok, State2} = rlx_provider:do(DiscoverProvider, State1),
+ {ok, State1} = providers:new(rlx_prv_discover, State0),
+ DiscoverProvider = providers:get_provider(discover, rlx_state:providers(State1)),
+ {ok, State2} = providers:do(DiscoverProvider, State1),
lists:foreach(fun(App) ->
?assertMatch(true, lists:member(App, rlx_state:available_apps(State2)))
@@ -116,10 +116,11 @@ no_beam_case(Config) ->
State0 = proplists:get_value(state, Config),
%% Deliberately disable release discovery when running `rlx_prv_discover`
State1 = rlx_state:put(State0, disable_rel_discovery, true),
- {DiscoverProvider, {ok, State2}} = rlx_provider:new(rlx_prv_discover, State1),
+ {ok, State2} = providers:new(rlx_prv_discover, State1),
+ DiscoverProvider = providers:get_provider(discover, rlx_state:providers(State2)),
?assertMatch({ok, _},
- rlx_provider:do(DiscoverProvider, State2)).
+ providers:do(DiscoverProvider, State2)).
bad_ebin_case(Config) ->
LibDir1 = proplists:get_value(lib1, Config),
@@ -145,8 +146,9 @@ bad_ebin_case(Config) ->
ok = filelib:ensure_dir(Filename),
ok = ec_file:write_term(Filename, get_bad_app_metadata(BadName, BadVsn)),
State0 = proplists:get_value(state, Config),
- {DiscoverProvider, {ok, State1}} = rlx_provider:new(rlx_prv_discover, State0),
- {ok, State2} = rlx_provider:do(DiscoverProvider, State1),
+ {ok, State1} = providers:new(rlx_prv_discover, State0),
+ DiscoverProvider = providers:get_provider(discover, rlx_state:providers(State1)),
+ {ok, State2} = providers:do(DiscoverProvider, State1),
?assertMatch([], [App || App <- rlx_state:available_apps(State2),
BadName =:= rlx_app_info:name(App)]).
@@ -170,8 +172,9 @@ shallow_app_discovery(Config) ->
State0 = rlx_state:put(proplists:get_value(state, Config),
default_libs, false),
State1 = rlx_state:put(State0, enable_shallow_app_discovery, true),
- {DiscoverProvider, {ok, State2}} = rlx_provider:new(rlx_prv_discover, State1),
- {ok, State3} = rlx_provider:do(DiscoverProvider, State2),
+ {ok, State2} = providers:new(rlx_prv_discover, State1),
+ DiscoverProvider = providers:get_provider(discover, rlx_state:providers(State2)),
+ {ok, State3} = providers:do(DiscoverProvider, State2),
lists:foreach(fun(App) ->
?assertMatch(true, lists:member(App, rlx_state:available_apps(State3)))
end, Apps1),
diff --git a/test/rlx_release_SUITE.erl b/test/rlx_release_SUITE.erl
index 6f067dc..112afc8 100644
--- a/test/rlx_release_SUITE.erl
+++ b/test/rlx_release_SUITE.erl
@@ -61,10 +61,9 @@ init_per_testcase(_, Config) ->
LibDir1 = filename:join([DataDir, create_random_name("lib_dir1_")]),
ok = rlx_util:mkdir_p(LibDir1),
State = rlx_state:new([], [{lib_dirs, [LibDir1]}], [release]),
- {ConfigProvider, {ok, State1}} = rlx_provider:new(rlx_prv_config, State),
- {ok, State2} = rlx_provider:do(ConfigProvider, State1),
+ {ok, State1} = rlx_config:do(State),
[{lib1, LibDir1},
- {state, State2} | Config].
+ {state, State1} | Config].
all() ->
[make_release, make_extend_release, make_scriptless_release,
@@ -178,7 +177,7 @@ make_invalid_config_release(Config) ->
goal_app_2,]}"),
OutputDir = filename:join([proplists:get_value(data_dir, Config),
create_random_name("relx-output")]),
- {error, {rlx_prv_config,
+ {error, {rlx_config,
{consult, _, _}}} = relx:do(undefined, undefined, [], [LibDir1], 3,
OutputDir, ConfigFile).
@@ -575,7 +574,7 @@ overlay_release(Config) ->
Error ->
erlang:throw({failed_to_consult, Error})
end,
-
+
{ok, ReadFileInfo} = file:read_file_info(filename:join([OutputDir, "foo", "test_template_resolved"])),
?assertEqual(8#100777, ReadFileInfo#file_info.mode),
@@ -742,12 +741,12 @@ make_relup_release(Config) ->
{ok, _} = relx:do(foo, "0.0.2", [], [LibDir1], 3,
OutputDir, ConfigFile),
{ok, State} = relx:do([{relname, foo},
- {relvsn, "0.0.3"},
- {goals, []},
- {lib_dirs, [LibDir1]},
- {log_level, 3},
- {output_dir, OutputDir},
- {config, ConfigFile}], ["release", "relup"]),
+ {relvsn, "0.0.3"},
+ {goals, []},
+ {lib_dirs, [LibDir1]},
+ {log_level, 3},
+ {output_dir, OutputDir},
+ {config, ConfigFile}], ["release", "relup"]),
%% we should have one 'resolved' release and three discovered realized_releases.
?assertMatch([{foo, "0.0.1"},