Skip to content

Commit

Permalink
Update cth_surefire to report errors in end_per_testcase
Browse files Browse the repository at this point in the history
Note: the 4th argument of post_end_per_testcase (Result) should be
      {fail, ...} (as documented), but it is actually {failed, ...}.
  • Loading branch information
chrzaszcz committed Dec 13, 2024
1 parent 0f2536c commit 37836b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion big_tests/src/cth_surefire.erl
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ pre_init_per_testcase(_Suite,_TC,Config,State) ->

post_end_per_testcase(Suite,TC,Config,Result,Proxy) when is_pid(Proxy) ->
{gen_server:call(Proxy,{?FUNCTION_NAME, [Suite, TC, Config, Result]}),Proxy};
post_end_per_testcase(Suite, TC, Config, {failed, _} = Result, State) ->
{Result, do_tc_fail(Suite, Result, end_tc(TC, Config, Result, State))};
post_end_per_testcase(_Suite,TC,Config,Result,State) ->
{Result, end_tc(TC,Config, Result,State)}.

Expand Down Expand Up @@ -574,7 +576,7 @@ test_report(Group) ->
{<<"skipped_tc">>, Group, skipped},
{<<"failing_tc_1">>, Group, failed},
{<<"failing_tc_2">>, Group, failed}, % init_per_testcase failed
{<<"failing_tc_3">>, Group, ok} % end_per_testcase failed, still ok
{<<"failing_tc_3">>, Group, failed} % end_per_testcase failed
].

wrap_nested_group_report(Report) ->
Expand Down

0 comments on commit 37836b8

Please sign in to comment.