From 37836b8279aefa10ba044caac4a2a0d4b6f39b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chrz=C4=85szcz?= Date: Fri, 13 Dec 2024 09:14:42 +0100 Subject: [PATCH] Update cth_surefire to report errors in end_per_testcase Note: the 4th argument of post_end_per_testcase (Result) should be {fail, ...} (as documented), but it is actually {failed, ...}. --- big_tests/src/cth_surefire.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/big_tests/src/cth_surefire.erl b/big_tests/src/cth_surefire.erl index f67f53a9f9..23822e9f17 100644 --- a/big_tests/src/cth_surefire.erl +++ b/big_tests/src/cth_surefire.erl @@ -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)}. @@ -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) ->