فهرست منبع

test(ds): Fix emqx standalone test profile selection

ieQu1 1 سال پیش
والد
کامیت
d7d878fd43

+ 15 - 6
apps/emqx/test/emqx_persistent_messages_SUITE.erl

@@ -32,13 +32,22 @@
 all() ->
     emqx_common_test_helpers:all(?MODULE).
 
+%% Needed for standalone mode:
+-ifndef(EMQX_RELEASE_EDITION).
+-define(EMQX_RELEASE_EDITION, ce).
+-endif.
+
+-if(?EMQX_RELEASE_EDITION == ee).
+
 init_per_suite(Config) ->
-    case emqx_ds_test_helpers:skip_if_norepl() of
-        false ->
-            Config;
-        Yes ->
-            Yes
-    end.
+    Config.
+
+-else.
+
+init_per_suite(Config) ->
+    {skip, no_replication}.
+
+-endif.
 
 end_per_suite(_Config) ->
     ok.

+ 2 - 2
apps/emqx_ds_backends/rebar.config.script

@@ -20,7 +20,7 @@ EEDeps =
     ],
 case Profile of
   ee ->
-    {deps, CEDeps ++ EEDeps};
+    [{deps, CEDeps ++ EEDeps}];
   ce ->
-    {deps, CEDeps}
+    [{deps, CEDeps}]
 end.

+ 15 - 10
apps/emqx_management/test/emqx_mgmt_api_ds_SUITE.erl

@@ -27,16 +27,21 @@ all() ->
     emqx_common_test_helpers:all(?MODULE).
 
 init_per_suite(Config) ->
-    Apps = emqx_cth_suite:start(
-        [
-            {emqx, "durable_sessions.enable = true"},
-            emqx_management,
-            {emqx_dashboard, "dashboard.listeners.http { enable = true, bind = 18083 }"}
-        ],
-        #{work_dir => emqx_cth_suite:work_dir(Config)}
-    ),
-    {ok, _} = emqx_common_test_http:create_default_app(),
-    [{suite_apps, Apps} | Config].
+    case emqx_ds_test_helpers:skip_if_norepl() of
+        false ->
+            Apps = emqx_cth_suite:start(
+                [
+                    {emqx, "durable_sessions.enable = true"},
+                    emqx_management,
+                    {emqx_dashboard, "dashboard.listeners.http { enable = true, bind = 18083 }"}
+                ],
+                #{work_dir => emqx_cth_suite:work_dir(Config)}
+            ),
+            {ok, _} = emqx_common_test_http:create_default_app(),
+            [{suite_apps, Apps} | Config];
+        Yes ->
+            Yes
+    end.
 
 end_per_suite(Config) ->
     ok = emqx_cth_suite:stop(?config(suite_apps, Config)).