Skip to content

Commit

Permalink
Just more linewrapping/cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunphy committed Oct 20, 2010
1 parent 5f16358 commit ccd5c01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
13 changes: 8 additions & 5 deletions lib/erlang/apps/beehive/src/beehive/beehive_bee_object.erl
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,17 @@ start(App, Port, From) ->
[{pidfile, PidFilename}|to_proplist(BeeObject)],
From,
fun(Tuple) -> log_shell_output(Tuple, Name) end),
% Because we are spawning off into a new process, we also want to make sure we can connect to the
% newly spawned bee. Here we'll spawn off a connector process
%% Because we are spawning off into a new process, we also
%% want to make sure we can connect to the newly spawned
%% bee. Here we'll spawn off a connector process
BuiltBee = bees:from_bee_object(BeeObject, App),
Bee = BuiltBee#bee{host = bh_host:myip()},
app_manager:spawn_update_bee_status(Bee, self(), 200),
% Now, let's wait to make sure that the spawn comes back with a success.
% If it does come back that it can be connected to, then we know it's started, let's
% grab the pid file and report back to the caller that the object has started
%% Now, let's wait to make sure that the spawn comes back
%% with a success. If it does come back that it can be
%% connected to, then we know it's started, let's grab the
%% pid file and report back to the caller that the object has
%% started
Continue = receive
{updated_bee_status, ready} ->
OPid = case read_pid_file_or_retry(PidFilename, 500) of
Expand Down
20 changes: 12 additions & 8 deletions lib/erlang/apps/beehive/test/beehive/beehive_bee_object_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ all_test_() ->
,fun responding_from/0
,fun ls_bee/0
% Type tests
,fun bundle_type/0
,fun bundle_template/0
,fun mount_t/0
,fun start_t/0
,fun stop_t/0
Expand All @@ -57,7 +57,8 @@ git_clone() ->
?DEBUG_PRINT({starting, git_clone}),
% Update the repos
{{Year, Month, Day}, {Hour, Minute, Second}} = erlang:universaltime(),
Ts = lists:flatten(io_lib:format("~w~2..0w~2..0w~2..0w~2..0w~2..0w", [Year, Month, Day, Hour, Minute, Second])),
Ts = lists:flatten(io_lib:format("~w~2..0w~2..0w~2..0w~2..0w~2..0w",
[Year, Month, Day, Hour, Minute, Second])),

ReposDir = proplists:get_value(repo_url, git_repos_props()),

Expand Down Expand Up @@ -120,20 +121,23 @@ git_bundle_with_errors() ->
?DEBUG_PRINT({git_bundle_with_errors, passed}),
passed.

bundle_type() ->
?DEBUG_PRINT({starting, bundle_type}),
bundle_template() ->
?DEBUG_PRINT({starting, bundle_template}),
BeeFile = filename:join([related_dir(), "squashed", "beehive_bee_object_test_app.bee"]),
beehive_bee_object:bundle([{type, rails}|git_repos_props()]),
beehive_bee_object:bundle([{template, rails}|git_repos_props()]),
% Run it with a before
% Untar and ensure the file is there
BeeDir = filename:join([related_dir(), "squashed", "testing_rack_out"]),
file:make_dir(BeeDir),
O = string:tokens(os:cmd(["tar -C ", BeeDir," -zxf ", BeeFile, " && ls ", BeeDir]), "\n"),
O = string:tokens(
os:cmd(["tar -C ", BeeDir," -zxf ", BeeFile, " && ls ", BeeDir]), "\n"),
?assert(lists:member("config.ru", O)),
% Let's make sure beehive_bee_object:info/1 works
?assertEqual("master", proplists:get_value(branch, beehive_bee_object:info("beehive_bee_object_test_app"))),
?assertEqual("master",
proplists:get_value(branch,
beehive_bee_object:info("beehive_bee_object_test_app"))),
?assertEqual({error, not_found}, beehive_bee_object:info("no-app-here")),
?DEBUG_PRINT({bundle_type, passed}),
?DEBUG_PRINT({bundle_template, passed}),
passed.

responding_from() ->
Expand Down

0 comments on commit ccd5c01

Please sign in to comment.