Skip to content

Commit 5aeffc4

Browse files
committed
Try direct gh anno
1 parent 92b0004 commit 5aeffc4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

deps/rabbitmq_ct_helpers/src/ct_master_fork.erl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,14 +723,28 @@ master_print_summary_for(Title,List) ->
723723
_ = case List of
724724
[] -> ok;
725725
_ ->
726-
Chars = [
726+
Chars = [[
727+
master_format_gh_anno(Reason),
727728
io_lib:format("Node: ~w~nCase: ~w:~w~nReason: ~p~n~n",
728729
[Node, Suite, FuncOrGroup, Reason])
729-
|| {Node, Suite, FuncOrGroup, Reason} <- List],
730+
] || {Node, Suite, FuncOrGroup, Reason} <- List],
730731
log(all,Title,Chars,[])
731732
end,
732733
ok.
733734

735+
master_format_gh_anno({error, {{exception, Reason, [{Mod, Fun, Arity, Loc}|_]}, _}}) ->
736+
%% We use .github because that file exists in our repository
737+
%% so GH will still put annotations in pull requests even
738+
%% if we don't have the real file name.
739+
File = proplists:get_value(file, Loc, ".github"),
740+
Line = proplists:get_value(line, Loc, 0),
741+
io_lib:format("::error file=~s,line=~d::~w:~tw/~d: ~w~n",
742+
[File, Line, Mod, Fun, Arity, Reason]);
743+
master_format_gh_anno(Reason) ->
744+
%% Do the bare minimum if we don't know the error reason.
745+
io_lib:format("::error file=.github,line=0::~w~n",
746+
[Reason]).
747+
734748
update_queue(take,Node,From,Lock={Op,Resource},Locks,Blocked) ->
735749
%% Locks: [{{Operation,Resource},Node},...]
736750
%% Blocked: [{{Operation,Resource},Node,WaitingPid},...]

0 commit comments

Comments
 (0)