diff --git a/big_tests/failure_repoting_testing.spec b/big_tests/failure_repoting_testing.spec index 71982b85596..b68a0a03a35 100644 --- a/big_tests/failure_repoting_testing.spec +++ b/big_tests/failure_repoting_testing.spec @@ -17,6 +17,9 @@ %%% and an overall resulting all_groups.summary file. {ct_hooks, [ct_groups_summary_hook]}. +%%% this hook generates /tmp/ct_summary, /tmp/ct_markdown +%%% and /tmp/ct_markdown_truncated. these files are required +%%% for GH and GA4 CI reporting. {ct_hooks, [ct_markdown_errors_hook]}. %%% this hook prints execution summary in the end of diff --git a/big_tests/src/ct_markdown_errors_hook.erl b/big_tests/src/ct_markdown_errors_hook.erl index 515b229f79c..358402383cf 100644 --- a/big_tests/src/ct_markdown_errors_hook.erl +++ b/big_tests/src/ct_markdown_errors_hook.erl @@ -76,31 +76,22 @@ handle_return_unsafe(SuiteName, Place, Return, Config, State) -> exec_limited_number_of_times(F, State) end. -exec_limited_number_of_times(_F, State=#state{limit=0, file=_File, - truncated_counter_file = TrFile}) -> +exec_limited_number_of_times(F, State=#state{limit=Limit}) when Limit > 0-> + F(), + State#state{limit=Limit-1}; +exec_limited_number_of_times(_F, State=#state{truncated_counter_file = TrFile, + limit=Limit, file=_File})-> %% Log truncated, increment counter - TrCounter = old_truncated_counter_value(TrFile), + TrCounter = (-1 * Limit), file:write_file(TrFile, integer_to_binary(TrCounter+1)), - State; -exec_limited_number_of_times(F, State=#state{limit=Limit}) -> - F(), State#state{limit=Limit-1}. -old_truncated_counter_value(TrFile) -> - case file:read_file(TrFile) of - {ok, Bin} -> - binary_to_integer(Bin); - _ -> - 0 - end. - log_summary(SuiteName, GroupName, Place, #state{summary_file = SummaryFile}) -> SummaryText = make_summary_text(SuiteName, GroupName, Place), file:write_file(SummaryFile, [SummaryText, $\n], [append]), ok. log_error(SuiteName, GroupName, Place, Error, Config, #state{file = File, summary_file = _SummaryFile}) -> - _MaybeLogLink = make_log_link(Config), LogLink = make_log_link(Config), %% Spoler syntax %% https://github.com/dear-github/dear-github/issues/166 diff --git a/big_tests/src/ct_test_hook.erl b/big_tests/src/ct_test_hook.erl index 44a3c70f38c..70a2fcd7fb9 100644 --- a/big_tests/src/ct_test_hook.erl +++ b/big_tests/src/ct_test_hook.erl @@ -87,8 +87,7 @@ start_tracing() -> {ok, _Pid} -> dbg:p(all, call), % dbg:tp(?MODULE, []), - % dbg:tpl(ct_markdown_errors_hook, cx), - dbg:tp(ct_groups_summary_hook, cx), + dbg:tp(ct_markdown_errors_hook, cx), ok; {error, already_started} -> ok diff --git a/big_tests/tests/test_SUITE.erl b/big_tests/tests/test_SUITE.erl index 0cc03e145fe..9222bb76fcc 100644 --- a/big_tests/tests/test_SUITE.erl +++ b/big_tests/tests/test_SUITE.erl @@ -6,19 +6,19 @@ -define(ERROR(E), (error(E))). % -define(ERROR(E), (exit(E))). -all() -> [{group, passing_repeating_group_with_autoskip}]. - % [{group, test_group}, - % {group, skipped_test_group}, - % {group, failing_test_group_1}, - % {group, failing_test_group_2}, - % {group, nested_test_group}, - % {group, deeply_nested_test_group}, - % {group, failing_nested_test_group_1}, - % {group, failing_nested_test_group_2}, - % {group, failing_repeating_group}, - % {group, passing_repeating_group}, - % {group, passing_repeating_group_with_autoskip} - % | test_cases() ]. +all() -> + [{group, test_group}, + {group, skipped_test_group}, + {group, failing_test_group_1}, + {group, failing_test_group_2}, + {group, nested_test_group}, + {group, deeply_nested_test_group}, + {group, failing_nested_test_group_1}, + {group, failing_nested_test_group_2}, + {group, failing_repeating_group}, + {group, passing_repeating_group}, + {group, passing_repeating_group_with_autoskip} + | test_cases() ]. groups() -> [{test_group, [], test_cases()},