CLD-5783 Implement rolling upgrade tests (#27842)
* Make server.prepare idempotent, don't cleanup containers on server.start * Implement rolling upgrade E2E tests * Apply Akis' suggestions from code review * Apply Saturn's suggestions from review * Communicate RollingRelease on GHA and test automation results channel * Implement E2E test case versioning for rolling release tests --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Akis Maziotis <akis.maziotis@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
90884172ae
Коммит
39ca104688
@@ -35,6 +35,7 @@ export BUILD_TAG="${SERVER_IMAGE##*/}"
|
||||
export MM_DOCKER_IMAGE="${BUILD_TAG%%:*}" # NB: the 'mattermostdevelopment/' prefix is assumed
|
||||
export MM_DOCKER_TAG="${BUILD_TAG##*:}"
|
||||
export SERVER_TYPE="${SERVER}"
|
||||
export AUTOMATION_DASHBOARD_FRONTEND_URL="${AUTOMATION_DASHBOARD_URL:+${AUTOMATION_DASHBOARD_URL%%/api}}"
|
||||
|
||||
if [ -n "${TM4J_API_KEY:-}" ]; then
|
||||
# Set additional variables required for Zephyr reporting
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
set -e -u -o pipefail
|
||||
cd "$(dirname "$0")"
|
||||
. .e2erc
|
||||
[ -f .env.cloud ] && . .env.cloud
|
||||
|
||||
if [ "$SERVER" != "cloud" ]; then
|
||||
mme2e_log "Skipping cloud instance initialization: operation supported only for cloud server, but running with SERVER='$SERVER'"
|
||||
exit 0
|
||||
elif [ -n "${MM_CUSTOMER_ID:-}" ]; then
|
||||
mme2e_log "Skipping cloud user creation: customer with ID '$MM_CUSTOMER_ID' is already configured. Please run 'make cloud-teardown' before creating a new user."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mme2e_log "Initializing cloud tests"
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
set -e -u -o pipefail
|
||||
cd "$(dirname "$0")"
|
||||
. .e2erc
|
||||
[ -f .env.cloud ] && . .env.cloud
|
||||
|
||||
if [ "$SERVER" != "cloud" ]; then
|
||||
mme2e_log "Skipping cloud instance teardown: operation supported only for cloud server, but running with SERVER='$SERVER'"
|
||||
if [ -z "${MM_CUSTOMER_ID:-}" ]; then
|
||||
mme2e_log "Skipping cloud instance teardown: MM_CUSTOMER_ID variable is empty, no cloud user to cleanup."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -20,5 +21,6 @@ MME2E_ENVCHECK_MSG="variable required for tearing down cloud tests, but is empty
|
||||
|
||||
mme2e_log "Deleting customer $MM_CUSTOMER_ID."
|
||||
curl -fsSL -X DELETE -H @- "${CWS_URL}/api/v1/tests/customers/$MM_CUSTOMER_ID/payment-customer" <<<"${CWS_EXTRA_HTTP_HEADERS:-}"
|
||||
rm -fv .env.cloud
|
||||
|
||||
mme2e_log "Test cloud customer deleted, MM_CUSTOMER_ID: $MM_CUSTOMER_ID."
|
||||
|
||||
@@ -26,16 +26,33 @@ if [ "$TEST" = "cypress" ]; then
|
||||
${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress npm i
|
||||
${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress cypress install
|
||||
mme2e_log "Prepare Cypress: populating fixtures"
|
||||
${MME2E_DC_SERVER} exec -T -- server curl -L --silent https://github.com/mattermost/mattermost-plugin-gitlab/releases/download/v1.3.0/com.github.manland.mattermost-plugin-gitlab-1.3.0.tar.gz | ${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress tee tests/fixtures/com.github.manland.mattermost-plugin-gitlab-1.3.0.tar.gz >/dev/null
|
||||
${MME2E_DC_SERVER} exec -T -- server curl -L --silent https://github.com/mattermost/mattermost-plugin-demo/releases/download/v0.9.0/com.mattermost.demo-plugin-0.9.0.tar.gz | ${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress tee tests/fixtures/com.mattermost.demo-plugin-0.9.0.tar.gz >/dev/null
|
||||
${MME2E_DC_SERVER} exec -T -- server curl -L --silent https://github.com/mattermost/mattermost-plugin-demo/releases/download/v0.8.0/com.mattermost.demo-plugin-0.8.0.tar.gz | ${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress tee tests/fixtures/com.mattermost.demo-plugin-0.8.0.tar.gz >/dev/null
|
||||
${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress tee tests/fixtures/keycloak.crt >/dev/null <../../server/build/docker/keycloak/keycloak.crt
|
||||
for PLUGIN_URL in \
|
||||
"https://github.com/mattermost/mattermost-plugin-gitlab/releases/download/v1.3.0/com.github.manland.mattermost-plugin-gitlab-1.3.0.tar.gz" \
|
||||
"https://github.com/mattermost/mattermost-plugin-demo/releases/download/v0.9.0/com.mattermost.demo-plugin-0.9.0.tar.gz" \
|
||||
"https://github.com/mattermost/mattermost-plugin-demo/releases/download/v0.8.0/com.mattermost.demo-plugin-0.8.0.tar.gz"
|
||||
do
|
||||
PLUGIN_NAME="${PLUGIN_URL##*/}"
|
||||
PLUGIN_PATH="tests/fixtures/$PLUGIN_NAME"
|
||||
if ${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress test -f "$PLUGIN_PATH"; then
|
||||
mme2e_log "Skipping installation of plugin $PLUGIN_NAME: file exists"
|
||||
continue
|
||||
fi
|
||||
mme2e_log "Downloading $PLUGIN_NAME to fixtures directory"
|
||||
${MME2E_DC_SERVER} exec -T -- server curl -L --silent "${PLUGIN_URL}" | ${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress tee "$PLUGIN_PATH" >/dev/null
|
||||
done
|
||||
fi
|
||||
|
||||
# Run service-specific initialization steps
|
||||
for SERVICE in $ENABLED_DOCKER_SERVICES; do
|
||||
case "$SERVICE" in
|
||||
openldap)
|
||||
LDIF_FILE=../../server/tests/test-data.ldif
|
||||
LDIF_CANARY=$(sed -n -E 's/^dn:[[:space:]]*(.*)$/\1/p' ${LDIF_FILE} | tail -n1)
|
||||
if ${MME2E_DC_SERVER} exec -T -- openldap bash -c "ldapsearch -x -D \"cn=admin,dc=mm,dc=test,dc=com\" -w mostest -b \"$LDIF_CANARY\" >/dev/null"; then
|
||||
mme2e_log "Skipping configuration for the $SERVICE container: already initialized"
|
||||
continue
|
||||
fi
|
||||
mme2e_log "Configuring the $SERVICE container"
|
||||
${MME2E_DC_SERVER} exec -T -- openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest' <../../server/tests/test-data.ldif
|
||||
;;
|
||||
|
||||
@@ -3,10 +3,6 @@ set -e -u -o pipefail
|
||||
cd "$(dirname "$0")"
|
||||
. .e2erc
|
||||
|
||||
# Cleanup old containers, if any
|
||||
mme2e_log "Stopping leftover E2E containers, if any are running"
|
||||
${MME2E_DC_SERVER} down -v --remove-orphans
|
||||
|
||||
# Wait for the required server image
|
||||
mme2e_log "Waiting for server image to be available"
|
||||
mme2e_wait_image "$SERVER_IMAGE" 4 30
|
||||
|
||||
Ссылка в новой задаче
Block a user