From c2b9fece78546f7795f464d0f8b426d6e1e8348b Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Tue, 25 Feb 2025 11:23:45 +0000 Subject: [PATCH 1/6] Selenium: make conf_dir configurable CI can configure this variable to use a dynamic variable e.g. `${{ worker.temp }}` --- selenium/bin/components/rabbitmq | 5 ++--- selenium/bin/suite_template | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/selenium/bin/components/rabbitmq b/selenium/bin/components/rabbitmq index 7a550bcdcf6e..2cfeababf201 100644 --- a/selenium/bin/components/rabbitmq +++ b/selenium/bin/components/rabbitmq @@ -147,7 +147,7 @@ start_docker_rabbitmq() { init_rabbitmq kill_container_if_exist rabbitmq - mkdir -p $CONF_DIR/rabbitmq + mkdir -pv $CONF_DIR/rabbitmq/conf.d/ RABBITMQ_TEST_DIR="/var/rabbitmq" ${BIN_DIR}/gen-rabbitmq-conf ${RABBITMQ_CONFIG_DIR} $ENV_FILE $CONF_DIR/rabbitmq/rabbitmq.conf print "> EFFECTIVE RABBITMQ_CONFIG_FILE: $CONF_DIR/rabbitmq/rabbitmq.conf" @@ -161,13 +161,12 @@ start_docker_rabbitmq() { fi fi if [ -f ${RABBITMQ_CONFIG_DIR}/logging.conf ]; then - mkdir -p $CONF_DIR/rabbitmq/conf.d/ cp ${RABBITMQ_CONFIG_DIR}/logging.conf $CONF_DIR/rabbitmq/conf.d/ fi if [ -f ${RABBITMQ_CONFIG_DIR}/enabled_plugins ]; then cp ${RABBITMQ_CONFIG_DIR}/enabled_plugins $CONF_DIR/rabbitmq fi - if [ -d "${RABBITMQ_CONFIG_DIR}/certs" ]; then + if [ -d "${RABBITMQ_CONFIG_DIR}/certs" ]; then cp -r ${RABBITMQ_CONFIG_DIR}/certs $CONF_DIR/rabbitmq fi if [ -d ${RABBITMQ_CONFIG_DIR}/imports ]; then diff --git a/selenium/bin/suite_template b/selenium/bin/suite_template index fbccd71b952a..de820ef9dabb 100644 --- a/selenium/bin/suite_template +++ b/selenium/bin/suite_template @@ -31,7 +31,7 @@ SELENIUM_ROOT_FOLDER=$(find_selenium_dir $SCRIPT) TEST_DIR=$SELENIUM_ROOT_FOLDER/test BIN_DIR=$SELENIUM_ROOT_FOLDER/bin SCREENS=${SELENIUM_ROOT_FOLDER}/screens/${SUITE} -CONF_DIR=/tmp/selenium/${SUITE} +CONF_DIR=${CONF_DIR_PREFIX:-/tmp}/selenium/${SUITE} LOGS=${CONF_DIR}/logs ENV_FILE=$CONF_DIR/.env From e581b16f753a7db36acae24b81d34572893ada95 Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Tue, 25 Feb 2025 11:41:23 +0000 Subject: [PATCH 2/6] CI: remove bump branches Those branches were for Bazel builds. Bazel was replaced in main and 4.0+ --- .github/workflows/test-management-ui.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-management-ui.yaml b/.github/workflows/test-management-ui.yaml index ed3b208cb912..3d0e1a60311c 100644 --- a/.github/workflows/test-management-ui.yaml +++ b/.github/workflows/test-management-ui.yaml @@ -3,10 +3,7 @@ on: push: branches: - main - - v4.0.x - - bump-otp-for-oci - - bump-rbe-* - - bump-rules_erlang + - 'v4.*.x' paths: - 'deps/rabbitmq_management/src/**' - 'deps/rabbitmq_management/priv/**' From 73279a8f263d319339eadd2f8dcc379157035f3b Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Tue, 25 Feb 2025 11:49:20 +0000 Subject: [PATCH 3/6] Run full UI management suite on commits The workflow to tests PRs is meant to run the short suite for management UI tests. On commits, we want to run the full suite to ensure that management UI tests are passing. --- .github/workflows/test-management-ui-for-pr.yaml | 2 +- .github/workflows/test-management-ui.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-management-ui-for-pr.yaml b/.github/workflows/test-management-ui-for-pr.yaml index ced702da183f..7bd5d62b4a20 100644 --- a/.github/workflows/test-management-ui-for-pr.yaml +++ b/.github/workflows/test-management-ui-for-pr.yaml @@ -56,7 +56,7 @@ jobs: cd ${SELENIUM_DIR} docker build -t mocha-test --target test . - - name: Run short ui suites on a standalone rabbitmq server + - name: Run short UI suites on a standalone rabbitmq server run: | IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}') RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG \ diff --git a/.github/workflows/test-management-ui.yaml b/.github/workflows/test-management-ui.yaml index 3d0e1a60311c..2ef7f0ec9d2c 100644 --- a/.github/workflows/test-management-ui.yaml +++ b/.github/workflows/test-management-ui.yaml @@ -68,13 +68,13 @@ jobs: cd ${SELENIUM_DIR} docker build -t mocha-test --target test . - - name: Run short ui suite on a 3-node rabbitmq cluster + - name: Run full UI suite on a 3-node rabbitmq cluster run: | IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}') RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG \ - ${SELENIUM_DIR}/run-suites.sh short-suite-management-ui - mkdir -p /tmp/short-suite - mv /tmp/selenium/* /tmp/short-suite + ${SELENIUM_DIR}/run-suites.sh full-suite-management-ui + mkdir -p /tmp/full-suite + mv /tmp/selenium/* /tmp/full-suite - name: Upload Test Artifacts if: always() From 6c10cea3adffa29587c5eb846b6c95173bcbe161 Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Tue, 25 Feb 2025 11:51:31 +0000 Subject: [PATCH 4/6] CI: remove selenium summary jobs --- .github/workflows/test-management-ui-for-pr.yaml | 9 --------- .github/workflows/test-management-ui.yaml | 9 --------- 2 files changed, 18 deletions(-) diff --git a/.github/workflows/test-management-ui-for-pr.yaml b/.github/workflows/test-management-ui-for-pr.yaml index 7bd5d62b4a20..260a163b5590 100644 --- a/.github/workflows/test-management-ui-for-pr.yaml +++ b/.github/workflows/test-management-ui-for-pr.yaml @@ -71,12 +71,3 @@ jobs: name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }} path: | /tmp/short-suite - - summary-selenium: - needs: - - selenium - runs-on: ubuntu-latest - steps: - - name: SUMMARY - run: | - echo "SUCCESS" diff --git a/.github/workflows/test-management-ui.yaml b/.github/workflows/test-management-ui.yaml index 2ef7f0ec9d2c..602d9dae95a9 100644 --- a/.github/workflows/test-management-ui.yaml +++ b/.github/workflows/test-management-ui.yaml @@ -84,12 +84,3 @@ jobs: path: | /tmp/full-suite /tmp/short-suite - - summary-selenium: - needs: - - selenium - runs-on: ubuntu-latest - steps: - - name: SUMMARY - run: | - echo "SUCCESS" From ef8b4fc76700ed7d0d4a21f33831ac12da8a1843 Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:24:07 +0000 Subject: [PATCH 5/6] Make Selenium image configurable In certain environments, we may want to customise the docker image e.g. to use a proxy to avoid docker hub rate limiting. The default behaviour remains unchanged. The `if` logic was broken because `uname -a` returns the entire uname, including OS, Kernel version, machine type and what not. The string always starts with the OS i.e. Linux or Darwin, therefore, the matching for `arm*` was always false; therefore, it was always defaulting to the `else` image, which happens to be multi-arch. However, it was using `seleniarm`, which is a community driven effort, not the official Selenium account. In the official OSS image, version 123.0 is too old. The oldest available is 127.0. This commit bumps to the latest available. We could consider depending on version `4`. Version `4` refers to Selenium version, whilst version 123.0/133.0 refer to the browser version. --- selenium/bin/components/selenium | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/selenium/bin/components/selenium b/selenium/bin/components/selenium index 2563927b4fb9..ad8960960c8b 100644 --- a/selenium/bin/components/selenium +++ b/selenium/bin/components/selenium @@ -1,11 +1,8 @@ #!/usr/bin/env bash -arch=$(uname -a) -if [[ $arch == arm* ]]; then - SELENIUM_DOCKER_IMAGE=selenium/standalone-chrome:123.0 -else - SELENIUM_DOCKER_IMAGE=seleniarm/standalone-chromium:123.0 -fi +# selenium/standalone-chromium is multi-arch +# https://hub.docker.com/r/selenium/standalone-chromium/tags +SELENIUM_DOCKER_IMAGE=${SELENIUM_DOCKER_IMAGE:-selenium/standalone-chromium:133.0} start_selenium() { begin "Starting selenium ..." From a5b8d194b8b5a3031915cedca3239893db4276b5 Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Tue, 25 Feb 2025 16:29:39 +0000 Subject: [PATCH 6/6] Update selenium README [skip ci] --- selenium/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/selenium/README.md b/selenium/README.md index 2723d8a156e0..5c72d3f44c0a 100644 --- a/selenium/README.md +++ b/selenium/README.md @@ -116,6 +116,20 @@ cd deps/rabbitmq_management/selenium RABBITMQ_DOCKER_IMAGE=bazel/packaging/docker-image:rabbitmq suites/authnz-mgt/oauth-with-uaa-with-mgt-prefix.sh ``` +To customise the Selenium docker image, use the env variable `SELENIUM_DOCKER_IMAGE`: + +``` +cd deps/rabbitmq_management/selenium +SELENIUM_DOCKER_IMAGE=tds-rabbitmq-docker-virtual.usw1.packages.broadcom.com/selenium/standalone-chromium:133.0 ./suites/authnz-mgt/basic-auth.sh +``` + +To customise the temporary directory for test configuration and intermediate container configuration, use `CONF_DIR_PREFIX`. This +variable defaults to `/tmp`. + +``` +cd deps/rabbitmq_management/selenium +CONF_DIR_PREFIX="$PWD/temp" ./suites/authnz-mgt/basic-auth.sh +``` ## Run tests interactively using your local chrome browser