chore: test some apps with both emqx and emqx-enteprise profiles

This commit is contained in:
Ivan Dyachkov 2023-10-26 10:36:48 +02:00 committed by Zaiming (Stone) Shi
parent 2228a0d477
commit 37178e1572
2 changed files with 73 additions and 63 deletions

View File

@ -109,11 +109,21 @@ fi
ERLANG_CONTAINER='erlang' ERLANG_CONTAINER='erlang'
DOCKER_CT_ENVS_FILE="${WHICH_APP}/docker-ct" DOCKER_CT_ENVS_FILE="${WHICH_APP}/docker-ct"
case "${WHICH_APP}" in if [ -z "${PROFILE+x}" ]; then
case "${WHICH_APP}" in
apps/emqx)
export PROFILE='emqx-enterprise'
;;
apps/emqx_bridge)
export PROFILE='emqx-enterprise'
;;
# emqx_connector test suite is using kafka bridge which is only available in emqx-enterprise # emqx_connector test suite is using kafka bridge which is only available in emqx-enterprise
apps/emqx_connector) apps/emqx_connector)
export PROFILE='emqx-enterprise' export PROFILE='emqx-enterprise'
;; ;;
apps/emqx_dashboard)
export PROFILE='emqx-enterprise'
;;
lib-ee*) lib-ee*)
## ensure enterprise profile when testing lib-ee applications ## ensure enterprise profile when testing lib-ee applications
export PROFILE='emqx-enterprise' export PROFILE='emqx-enterprise'
@ -128,7 +138,8 @@ case "${WHICH_APP}" in
*) *)
export PROFILE="${PROFILE:-emqx}" export PROFILE="${PROFILE:-emqx}"
;; ;;
esac esac
fi
if [ -f "$DOCKER_CT_ENVS_FILE" ]; then if [ -f "$DOCKER_CT_ENVS_FILE" ]; then
# shellcheck disable=SC2002 # shellcheck disable=SC2002

View File

@ -54,7 +54,7 @@ fi
###### now deal with the github action's matrix. ###### now deal with the github action's matrix.
################################################## ##################################################
format_app_description() { format_app_entry() {
local groups="$2" local groups="$2"
local group=0 local group=0
while [ "$groups" -gt $group ]; do while [ "$groups" -gt $group ]; do
@ -72,17 +72,32 @@ END
done done
} }
describe_app() { matrix() {
app="$1" local runner
local runner="host"
local profile local profile
local entries=()
for app in ${APPS_ALL}; do
if [ -f "${app}/docker-ct" ]; then if [ -f "${app}/docker-ct" ]; then
runner="docker" runner="docker"
else
runner="host"
fi fi
case "${app}" in case "${app}" in
# emqx_connector test suite is using kafka bridge which is only available in emqx-enterprise apps/emqx)
entries+=("$(format_app_entry "$app" 5 emqx "$runner")")
entries+=("$(format_app_entry "$app" 5 emqx-enterprise "$runner")")
;;
apps/emqx_bridge)
entries+=("$(format_app_entry "$app" 1 emqx "$runner")")
entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")")
;;
apps/emqx_connector) apps/emqx_connector)
profile='emqx-enterprise' entries+=("$(format_app_entry "$app" 1 emqx "$runner")")
entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")")
;;
apps/emqx_dashboard)
entries+=("$(format_app_entry "$app" 1 emqx "$runner")")
entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")")
;; ;;
apps/*) apps/*)
if [[ -f "${app}/BSL.txt" ]]; then if [[ -f "${app}/BSL.txt" ]]; then
@ -90,34 +105,18 @@ describe_app() {
else else
profile='emqx' profile='emqx'
fi fi
entries+=("$(format_app_entry "$app" 1 "$profile" "$runner")")
;; ;;
lib-ee/*) lib-ee/*)
profile='emqx-enterprise' entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")")
;; ;;
*) *)
echo "unknown app: $app" echo "unknown app: $app"
exit 1 exit 1
;; ;;
esac esac
if [[ "$app" == "apps/emqx" ]]; then
suitegroups=5
else
suitegroups=1
fi
format_app_description "$app" "$suitegroups" "$profile" "$runner"
}
matrix() {
local sep='['
for app in ${APPS_ALL}; do
row="$(describe_app "$app")"
if [ -z "$row" ]; then
continue
fi
echo -n "${sep}${row}"
sep=', '
done done
echo ']' echo -n "[$(IFS=,; echo "${entries[*]}")]"
} }
matrix matrix