From d45bacb73bd1a255a5042929a49c81ab298df946 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Tue, 5 Dec 2017 13:05:14 -0500 Subject: Run a soft purge while within the compiler step Prevents the killing of a plugin with itself --- systest/all_SUITE.erl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'systest/all_SUITE.erl') diff --git a/systest/all_SUITE.erl b/systest/all_SUITE.erl index a0cfd3f..ba06a9c 100644 --- a/systest/all_SUITE.erl +++ b/systest/all_SUITE.erl @@ -29,7 +29,7 @@ end_per_testcase(_Name, Config) -> Config. all() -> - [noop, resource_plugins, alias_clash]. + [noop, resource_plugins, alias_clash, grisp_explode]. %groups() -> % [{plugins, [shuffle], []}, @@ -66,6 +66,16 @@ alias_clash(Config) -> ?assertNotEqual(nomatch, re:run(Output, "Not adding provider default test from module rebar_prv_alias_test " "because it already exists from module rebar_prv_alias_test")), + +grisp_explode() -> + [{doc, "Don't force purge a plugin that runs the compile job itself"}]. +grisp_explode(Config) -> + %% When the purge handling is wrong, the run fails violently. + {error, {_,Output}} = rebar3("grisp deploy -n robot -v 0.1.0", Config), + ct:pal("Rebar3 Output:~n~s",[Output]), + ?assertNotEqual(nomatch, + re:run(Output, "No releases exist in the system for robot:0.1.0!") + ), ok. %%%%%%%%%%%%%%% -- cgit v1.1 From f12871451f2c60bc35da053198ccc48d1b1db687 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 6 Dec 2017 08:53:12 -0500 Subject: Safer purge switch Rather than the caller having to think of what to purge or not, use erlang:check_process_code/2 to detect if the caller (rebar3) may die because of the operation. If so, do a soft purge with a conditional delete instead of a hard purge with a mandatory delete. --- systest/all_SUITE.erl | 1 + 1 file changed, 1 insertion(+) (limited to 'systest/all_SUITE.erl') diff --git a/systest/all_SUITE.erl b/systest/all_SUITE.erl index ba06a9c..6d2f14f 100644 --- a/systest/all_SUITE.erl +++ b/systest/all_SUITE.erl @@ -66,6 +66,7 @@ alias_clash(Config) -> ?assertNotEqual(nomatch, re:run(Output, "Not adding provider default test from module rebar_prv_alias_test " "because it already exists from module rebar_prv_alias_test")), + ok. grisp_explode() -> [{doc, "Don't force purge a plugin that runs the compile job itself"}]. -- cgit v1.1