Explorar el Código

Merge pull request #2319 from pablocostass/2318_fix_ct_symlink_with_logdir

Fix symlink to last CT logs directory with logdir option present
pull/2321/head
Fred Hebert hace 4 años
cometido por GitHub
padre
commit
dab793821f
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 1 ficheros con 8 adiciones y 5 borrados
  1. +8
    -5
      src/rebar_prv_common_test.erl

+ 8
- 5
src/rebar_prv_common_test.erl Ver fichero

@ -74,11 +74,11 @@ do(State, Tests) ->
%% Run ct provider post hooks for all project apps and top level project hooks
rebar_hooks:run_project_and_app_hooks(Cwd, post, ?PROVIDER, Providers, State),
rebar_paths:set_paths([plugins, deps], State),
symlink_to_last_ct_logs(State),
symlink_to_last_ct_logs(State, T),
{ok, State};
Error ->
rebar_paths:set_paths([plugins, deps], State),
symlink_to_last_ct_logs(State),
symlink_to_last_ct_logs(State, T),
Error
end;
Error ->
@ -122,9 +122,12 @@ format_error({error_reading_testspec, Reason}) ->
%% @doc Tries to make the symlink `_build/<profile>/logs/last` to the `ct_run` directory
%% of the last common test run.
-spec symlink_to_last_ct_logs(rebar_state:t()) -> ok.
symlink_to_last_ct_logs(State) ->
LogDir = filename:join([rebar_dir:base_dir(State), "logs"]),
-spec symlink_to_last_ct_logs(rebar_state:t(), list()) -> ok.
symlink_to_last_ct_logs(State, Opts) ->
LogDir = case proplists:get_value(logdir, Opts) of
undefined -> filename:join([rebar_dir:base_dir(State), "logs"]);
Dir -> Dir
end,
{ok, Filenames} = file:list_dir(LogDir),
CtRunDirs = lists:filter(fun(S) -> re:run(S, "ct_run", [unicode]) /= nomatch end, Filenames),
case CtRunDirs of

Cargando…
Cancelar
Guardar