From e89dc32c907f88bd872979ea653a61d9bcfb48a0 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Sun, 7 Apr 2024 18:23:59 +0800 Subject: [PATCH] ci: run emqx_management both with ee and ce profile --- .../test/emqx_mgmt_data_backup_SUITE.erl | 43 +++++++++++-------- scripts/find-apps.sh | 4 ++ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/apps/emqx_management/test/emqx_mgmt_data_backup_SUITE.erl b/apps/emqx_management/test/emqx_mgmt_data_backup_SUITE.erl index e1d0a2512..fee392479 100644 --- a/apps/emqx_management/test/emqx_mgmt_data_backup_SUITE.erl +++ b/apps/emqx_management/test/emqx_mgmt_data_backup_SUITE.erl @@ -88,25 +88,30 @@ t_empty_export_import(_Config) -> ?assertEqual(ExpRawConf, emqx:get_raw_config([])). t_cluster_hocon_import_mqtt_subscribers_retainer_messages(Config) -> - FNameEmqx44 = "emqx-export-4.4.24-retainer-mqttsub.tar.gz", - BackupFile = filename:join(?config(data_dir, Config), FNameEmqx44), - Exp = {ok, #{db_errors => #{}, config_errors => #{}}}, - ?assertEqual(Exp, emqx_mgmt_data_backup:import(BackupFile)), - RawConfAfterImport = emqx:get_raw_config([]), - %% verify that MQTT sources are imported - ?assertMatch( - #{<<"sources">> := #{<<"mqtt">> := Sources}} when map_size(Sources) > 0, - RawConfAfterImport - ), - %% verify that retainer messages are imported - ?assertMatch( - {ok, [#message{payload = <<"test-payload">>}]}, - emqx_retainer:read_message(<<"test-retained-message/1">>) - ), - %% Export and import again - {ok, #{filename := FileName}} = emqx_mgmt_data_backup:export(), - ?assertEqual(Exp, emqx_mgmt_data_backup:import(FileName)), - ?assertEqual(RawConfAfterImport, emqx:get_raw_config([])), + case emqx_release:edition() of + ce -> + ok; + ee -> + FNameEmqx44 = "emqx-export-4.4.24-retainer-mqttsub.tar.gz", + BackupFile = filename:join(?config(data_dir, Config), FNameEmqx44), + Exp = {ok, #{db_errors => #{}, config_errors => #{}}}, + ?assertEqual(Exp, emqx_mgmt_data_backup:import(BackupFile)), + RawConfAfterImport = emqx:get_raw_config([]), + %% verify that MQTT sources are imported + ?assertMatch( + #{<<"sources">> := #{<<"mqtt">> := Sources}} when map_size(Sources) > 0, + RawConfAfterImport + ), + %% verify that retainer messages are imported + ?assertMatch( + {ok, [#message{payload = <<"test-payload">>}]}, + emqx_retainer:read_message(<<"test-retained-message/1">>) + ), + %% Export and import again + {ok, #{filename := FileName}} = emqx_mgmt_data_backup:export(), + ?assertEqual(Exp, emqx_mgmt_data_backup:import(FileName)), + ?assertEqual(RawConfAfterImport, emqx:get_raw_config([])) + end, ok. t_cluster_hocon_export_import(Config) -> diff --git a/scripts/find-apps.sh b/scripts/find-apps.sh index 89f0a66e5..908f22d9c 100755 --- a/scripts/find-apps.sh +++ b/scripts/find-apps.sh @@ -101,6 +101,10 @@ matrix() { entries+=("$(format_app_entry "$app" 1 emqx "$runner")") entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")") ;; + apps/emqx_management) + entries+=("$(format_app_entry "$app" 1 emqx "$runner")") + entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")") + ;; apps/*) if [[ -f "${app}/BSL.txt" ]]; then profile='emqx-enterprise'