From b8a2a8ea18066760f67f4f63aede2af56d0b37de Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:37:11 +0200 Subject: [PATCH] test(router): Skip certain tests on OSS --- apps/emqx/test/emqx_cth_suite.erl | 2 ++ apps/emqx/test/emqx_routing_SUITE.erl | 28 ++++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/apps/emqx/test/emqx_cth_suite.erl b/apps/emqx/test/emqx_cth_suite.erl index 75c54400b..8e7c84580 100644 --- a/apps/emqx/test/emqx_cth_suite.erl +++ b/apps/emqx/test/emqx_cth_suite.erl @@ -79,6 +79,8 @@ %% "Unofficial" `emqx_config_handler' and `emqx_conf' APIs -export([schema_module/0, upgrade_raw_conf/1]). +-export([skip_if_oss/0]). + -export_type([appspec/0]). -export_type([appspec_opts/0]). diff --git a/apps/emqx/test/emqx_routing_SUITE.erl b/apps/emqx/test/emqx_routing_SUITE.erl index 5112059ca..1e66a6ef7 100644 --- a/apps/emqx/test/emqx_routing_SUITE.erl +++ b/apps/emqx/test/emqx_routing_SUITE.erl @@ -64,18 +64,28 @@ init_per_group(routing_schema_v2, Config) -> init_per_group(batch_sync_on, Config) -> [{emqx_config, "broker.routing.batch_sync.enable_on = all"} | Config]; init_per_group(batch_sync_replicants, Config) -> - [{emqx_config, "broker.routing.batch_sync.enable_on = replicant"} | Config]; + case emqx_cth_suite:skip_if_oss() of + false -> + [{emqx_config, "broker.routing.batch_sync.enable_on = replicant"} | Config]; + True -> + True + end; init_per_group(batch_sync_off, Config) -> [{emqx_config, "broker.routing.batch_sync.enable_on = none"} | Config]; init_per_group(cluster, Config) -> - WorkDir = emqx_cth_suite:work_dir(Config), - NodeSpecs = [ - {emqx_routing_SUITE1, #{apps => [mk_emqx_appspec(1, Config)], role => core}}, - {emqx_routing_SUITE2, #{apps => [mk_emqx_appspec(2, Config)], role => core}}, - {emqx_routing_SUITE3, #{apps => [mk_emqx_appspec(3, Config)], role => replicant}} - ], - Nodes = emqx_cth_cluster:start(NodeSpecs, #{work_dir => WorkDir}), - [{cluster, Nodes} | Config]; + case emqx_cth_suite:skip_if_oss() of + false -> + WorkDir = emqx_cth_suite:work_dir(Config), + NodeSpecs = [ + {emqx_routing_SUITE1, #{apps => [mk_emqx_appspec(1, Config)], role => core}}, + {emqx_routing_SUITE2, #{apps => [mk_emqx_appspec(2, Config)], role => core}}, + {emqx_routing_SUITE3, #{apps => [mk_emqx_appspec(3, Config)], role => replicant}} + ], + Nodes = emqx_cth_cluster:start(NodeSpecs, #{work_dir => WorkDir}), + [{cluster, Nodes} | Config]; + True -> + True + end; init_per_group(GroupName, Config) when GroupName =:= single_batch_on; GroupName =:= single