chore: test some apps with both emqx and emqx-enteprise profiles
This commit is contained in:
parent
2228a0d477
commit
37178e1572
|
|
@ -109,26 +109,37 @@ 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
|
||||||
# emqx_connector test suite is using kafka bridge which is only available in emqx-enterprise
|
case "${WHICH_APP}" in
|
||||||
apps/emqx_connector)
|
apps/emqx)
|
||||||
export PROFILE='emqx-enterprise'
|
export PROFILE='emqx-enterprise'
|
||||||
;;
|
;;
|
||||||
lib-ee*)
|
apps/emqx_bridge)
|
||||||
## ensure enterprise profile when testing lib-ee applications
|
export PROFILE='emqx-enterprise'
|
||||||
export PROFILE='emqx-enterprise'
|
;;
|
||||||
;;
|
# emqx_connector test suite is using kafka bridge which is only available in emqx-enterprise
|
||||||
apps/*)
|
apps/emqx_connector)
|
||||||
if [[ -f "${WHICH_APP}/BSL.txt" ]]; then
|
export PROFILE='emqx-enterprise'
|
||||||
export PROFILE='emqx-enterprise'
|
;;
|
||||||
else
|
apps/emqx_dashboard)
|
||||||
export PROFILE='emqx'
|
export PROFILE='emqx-enterprise'
|
||||||
fi
|
;;
|
||||||
;;
|
lib-ee*)
|
||||||
*)
|
## ensure enterprise profile when testing lib-ee applications
|
||||||
export PROFILE="${PROFILE:-emqx}"
|
export PROFILE='emqx-enterprise'
|
||||||
;;
|
;;
|
||||||
esac
|
apps/*)
|
||||||
|
if [[ -f "${WHICH_APP}/BSL.txt" ]]; then
|
||||||
|
export PROFILE='emqx-enterprise'
|
||||||
|
else
|
||||||
|
export PROFILE='emqx'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
export PROFILE="${PROFILE:-emqx}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f "$DOCKER_CT_ENVS_FILE" ]; then
|
if [ -f "$DOCKER_CT_ENVS_FILE" ]; then
|
||||||
# shellcheck disable=SC2002
|
# shellcheck disable=SC2002
|
||||||
|
|
|
||||||
|
|
@ -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,52 +72,51 @@ END
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
describe_app() {
|
|
||||||
app="$1"
|
|
||||||
local runner="host"
|
|
||||||
local profile
|
|
||||||
if [ -f "${app}/docker-ct" ]; then
|
|
||||||
runner="docker"
|
|
||||||
fi
|
|
||||||
case "${app}" in
|
|
||||||
# emqx_connector test suite is using kafka bridge which is only available in emqx-enterprise
|
|
||||||
apps/emqx_connector)
|
|
||||||
profile='emqx-enterprise'
|
|
||||||
;;
|
|
||||||
apps/*)
|
|
||||||
if [[ -f "${app}/BSL.txt" ]]; then
|
|
||||||
profile='emqx-enterprise'
|
|
||||||
else
|
|
||||||
profile='emqx'
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
lib-ee/*)
|
|
||||||
profile='emqx-enterprise'
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "unknown app: $app"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if [[ "$app" == "apps/emqx" ]]; then
|
|
||||||
suitegroups=5
|
|
||||||
else
|
|
||||||
suitegroups=1
|
|
||||||
fi
|
|
||||||
format_app_description "$app" "$suitegroups" "$profile" "$runner"
|
|
||||||
}
|
|
||||||
|
|
||||||
matrix() {
|
matrix() {
|
||||||
local sep='['
|
local runner
|
||||||
|
local profile
|
||||||
|
local entries=()
|
||||||
for app in ${APPS_ALL}; do
|
for app in ${APPS_ALL}; do
|
||||||
row="$(describe_app "$app")"
|
if [ -f "${app}/docker-ct" ]; then
|
||||||
if [ -z "$row" ]; then
|
runner="docker"
|
||||||
continue
|
else
|
||||||
|
runner="host"
|
||||||
fi
|
fi
|
||||||
echo -n "${sep}${row}"
|
case "${app}" in
|
||||||
sep=', '
|
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)
|
||||||
|
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/*)
|
||||||
|
if [[ -f "${app}/BSL.txt" ]]; then
|
||||||
|
profile='emqx-enterprise'
|
||||||
|
else
|
||||||
|
profile='emqx'
|
||||||
|
fi
|
||||||
|
entries+=("$(format_app_entry "$app" 1 "$profile" "$runner")")
|
||||||
|
;;
|
||||||
|
lib-ee/*)
|
||||||
|
entries+=("$(format_app_entry "$app" 1 emqx-enterprise "$runner")")
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unknown app: $app"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
echo ']'
|
echo -n "[$(IFS=,; echo "${entries[*]}")]"
|
||||||
}
|
}
|
||||||
|
|
||||||
matrix
|
matrix
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue