diff --git a/apps/emqx/test/emqx_bpapi_static_checks.erl b/apps/emqx/test/emqx_bpapi_static_checks.erl index 2d514d5e5..57f6d95ea 100644 --- a/apps/emqx/test/emqx_bpapi_static_checks.erl +++ b/apps/emqx/test/emqx_bpapi_static_checks.erl @@ -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(). diff --git a/apps/emqx/test/emqx_bpapi_suite.erl b/apps/emqx/test/emqx_bpapi_suite.erl index 5d0a313f8..ab86e5211 100644 --- a/apps/emqx/test/emqx_bpapi_suite.erl +++ b/apps/emqx/test/emqx_bpapi_suite.erl @@ -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()).