Merge pull request #6829 from k32/bpapi-lockdown
ci(bpapi): Fail static check on BPAPI violations
This commit is contained in:
commit
ffa857ccd9
|
@ -70,15 +70,20 @@
|
|||
|
||||
-spec run() -> boolean().
|
||||
run() ->
|
||||
dump(), %% TODO: check return value
|
||||
Dumps = filelib:wildcard(dumps_dir() ++ "/*.bpapi"),
|
||||
case Dumps of
|
||||
[] ->
|
||||
?ERROR("No BPAPI dumps are found in ~s, abort", [dumps_dir()]),
|
||||
false;
|
||||
_ ->
|
||||
?NOTICE("Running API compatibility checks for ~p", [Dumps]),
|
||||
check_compat(Dumps)
|
||||
case dump() of
|
||||
true ->
|
||||
Dumps = filelib:wildcard(dumps_dir() ++ "/*.bpapi"),
|
||||
case Dumps of
|
||||
[] ->
|
||||
?ERROR("No BPAPI dumps are found in ~s, abort", [dumps_dir()]),
|
||||
false;
|
||||
_ ->
|
||||
?NOTICE("Running API compatibility checks for ~p", [Dumps]),
|
||||
check_compat(Dumps)
|
||||
end;
|
||||
false ->
|
||||
?CRITICAL("Backplane API violations found on the current branch."),
|
||||
false
|
||||
end.
|
||||
|
||||
-spec check_compat([file:filename()]) -> boolean().
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
-compile(export_all).
|
||||
-compile(nowarn_export_all).
|
||||
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
-include_lib("common_test/include/ct.hrl").
|
||||
-include_lib("stdlib/include/assert.hrl").
|
||||
|
||||
|
@ -28,7 +29,8 @@ init_per_suite(Config) ->
|
|||
Config.
|
||||
|
||||
end_per_suite(_Config) ->
|
||||
ok.
|
||||
?NOTICE("If this test suite failed, and you are unsure why, read this:~n"
|
||||
"https://github.com/emqx/emqx/blob/master/apps/emqx/src/bpapi/README.md", []).
|
||||
|
||||
t_run_check(_) ->
|
||||
?assertMatch(true, emqx_bpapi_static_checks:run()).
|
||||
|
|
Loading…
Reference in New Issue