Skip to content

Commit

Permalink
Quick fix: support parallel test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Dec 20, 2022
1 parent 80fa3cc commit 3418701
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions big_tests/src/cth_surefire.erl
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ on_tc_fail(Suite,TC,Result,Proxy) when is_pid(Proxy) ->
Proxy;
on_tc_fail(_Suite,_TC, _Res, State = #state{test_cases = []}) ->
State;
on_tc_fail(Suite, _TC, Res, State) ->
on_tc_fail(Suite, TcStr, Res, State) ->
TCs = State#state.test_cases,
TC = hd(TCs),
TC = lists:keyfind(TcStr, #testcase.name, TCs),
Line = case get_line_from_result(Suite, Res) of
undefined ->
TC#testcase.line;
Expand All @@ -228,7 +228,7 @@ on_tc_fail(Suite, _TC, Res, State) ->
line = Line,
result =
{fail,lists:flatten(io_lib:format("~tp",[Res]))} },
State#state{ test_cases = [NewTC | tl(TCs)]}.
State#state{ test_cases = lists:keyreplace(TcStr, #testcase.name, TCs, NewTC) }.

get_line_from_result(Suite, {_Error, [{__M,__F,__A,__I}|_] = StackTrace}) ->
case lists:filter(fun({Mod, _Func, _Arity, _Info}) ->
Expand Down

0 comments on commit 3418701

Please sign in to comment.