CI: Enable Erlang problem matchers
In order to get the right subdirectory for GH to find our files we use `sed` to modify paths in the output. We use `pipefail` to make sure failures are propagated. We use `NON_DETERMINISTIC` to make sure our paths are full and not just the file.erl. We disable styling in non-parallel CT runs. This is needed in order to pick up errors. Currently these errors will not be annotated directly in PRs, a pending OTP PR will improve that. Parallel CT runs write GH annotations directly.
This commit is contained in:
		
							parent
							
								
									1c264fa471
								
							
						
					
					
						commit
						422ef89163
					
				| 
						 | 
				
			
			@ -54,6 +54,16 @@ jobs:
 | 
			
		|||
        # restricted to the build jobs to avoid duplication in output.
 | 
			
		||||
        disable_problem_matchers: true
 | 
			
		||||
 | 
			
		||||
    # We install Erlang problem matchers from ci.erlang.mk.
 | 
			
		||||
    - name: CHECKOUT ERLANG PROBLEM MATCHERS
 | 
			
		||||
      uses: actions/checkout@v4
 | 
			
		||||
      with:
 | 
			
		||||
        repository: ninenines/ci.erlang.mk
 | 
			
		||||
        path: ci.erlang.mk
 | 
			
		||||
 | 
			
		||||
    - name: INSTALL ERLANG PROBLEM MATCHERS
 | 
			
		||||
      run: echo "::add-matcher::ci.erlang.mk/.github/matchers/erlang-matchers.json"
 | 
			
		||||
 | 
			
		||||
    - name: MIXED CLUSTERS - FETCH SIGNING KEYS
 | 
			
		||||
      uses: dsaltares/fetch-gh-release-asset@master
 | 
			
		||||
      if: inputs.mixed_clusters
 | 
			
		||||
| 
						 | 
				
			
			@ -120,7 +130,8 @@ jobs:
 | 
			
		|||
      if: inputs.plugin != 'rabbitmq_cli'
 | 
			
		||||
      run: |
 | 
			
		||||
        sudo netstat -ntp
 | 
			
		||||
        make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }}
 | 
			
		||||
        set -o pipefail
 | 
			
		||||
        make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }} NON_DETERMINISTIC=1 | sed "s/src\//deps\/${{ inputs.plugin }}\/src\//" | sed "s/test\//deps\/${{ inputs.plugin }}\/test\//"
 | 
			
		||||
 | 
			
		||||
    - name: CACHE ACTIVEMQ
 | 
			
		||||
      uses: actions/cache/save@v4
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,9 +36,11 @@ CT_OPTS += -kernel net_ticktime 5
 | 
			
		|||
#
 | 
			
		||||
# cth_styledout
 | 
			
		||||
#   This hook will change the output of common_test to something more
 | 
			
		||||
#   concise and colored.
 | 
			
		||||
#   concise and colored. Not used on GitHub Actions except in parallel CT.
 | 
			
		||||
 | 
			
		||||
ifndef GITHUB_ACTIONS
 | 
			
		||||
CT_HOOKS += cth_styledout
 | 
			
		||||
endif
 | 
			
		||||
TEST_DEPS += cth_styledout
 | 
			
		||||
 | 
			
		||||
ifdef CONCOURSE
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -723,14 +723,28 @@ master_print_summary_for(Title,List) ->
 | 
			
		|||
    _ = case List of
 | 
			
		||||
        [] -> ok;
 | 
			
		||||
        _ ->
 | 
			
		||||
            Chars = [
 | 
			
		||||
            Chars = [[
 | 
			
		||||
                master_format_gh_anno(Reason),
 | 
			
		||||
                io_lib:format("Node: ~w~nCase: ~w:~w~nReason: ~p~n~n",
 | 
			
		||||
                    [Node, Suite, FuncOrGroup, Reason])
 | 
			
		||||
            || {Node, Suite, FuncOrGroup, Reason} <- List],
 | 
			
		||||
            ] || {Node, Suite, FuncOrGroup, Reason} <- List],
 | 
			
		||||
            log(all,Title,Chars,[])
 | 
			
		||||
    end,
 | 
			
		||||
    ok.
 | 
			
		||||
 | 
			
		||||
master_format_gh_anno({error, {{exception, Reason, [{Mod, Fun, Arity, Loc}|_]}, _}}) ->
 | 
			
		||||
    %% We use .github because that file exists in our repository
 | 
			
		||||
    %% so GH will still put annotations in pull requests even
 | 
			
		||||
    %% if we don't have the real file name.
 | 
			
		||||
    File = proplists:get_value(file, Loc, ".github"),
 | 
			
		||||
    Line = proplists:get_value(line, Loc, 0),
 | 
			
		||||
    io_lib:format("::error file=~s,line=~b::~w:~tw/~b: ~w~n",
 | 
			
		||||
        [File, Line, Mod, Fun, Arity, Reason]);
 | 
			
		||||
master_format_gh_anno(Reason) ->
 | 
			
		||||
    %% Do the bare minimum if we don't know the error reason.
 | 
			
		||||
    io_lib:format("::error file=.github,line=0::~w~n",
 | 
			
		||||
        [Reason]).
 | 
			
		||||
 | 
			
		||||
update_queue(take,Node,From,Lock={Op,Resource},Locks,Blocked) ->
 | 
			
		||||
    %% Locks: [{{Operation,Resource},Node},...]
 | 
			
		||||
    %% Blocked: [{{Operation,Resource},Node,WaitingPid},...]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue