This is an automated email from the ASF dual-hosted git repository.

Aias00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 0789ec3c23 Fixes #6818: Harden storage Compose scripts (#7151)
0789ec3c23 is described below

commit 0789ec3c23a2a07f9b843c71f307204112724cb0
Author: BobSong <[email protected]>
AuthorDate: Sat Sep 26 21:00:59 2026 +0800

    Fixes #6818: Harden storage Compose scripts (#7151)
    
    * fix(e2e): harden storage compose scripts (#6818)
    
    * fix(e2e): preserve storage failure diagnostics (#6818)
    
    * fix(e2e): stabilize storage compose checks (#6818)
    
    * fix(e2e): allocate enough memory for OpenGauss (#6818)
    
    * fix(e2e): use OpenGauss Lite in storage tests (#6818)
    
    * fix(e2e): authenticate OpenGauss health probe (#6818)
    
    * fix(e2e): resolve OpenGauss probe executable (#6818)
    
    * fix(e2e): pass OpenGauss probe password to gsql (#6818)
    
    ---------
    
    Co-authored-by: BobSong-dev <[email protected]>
    Co-authored-by: aias00 <[email protected]>
---
 .github/scripts/resolve-ci-modules.sh              | 22 ++++++++++-
 .../compose/storage/shenyu-storage-opengauss.yml   |  6 +--
 .../compose/storage/shenyu-storage-postgres.yml    |  2 +-
 .../compose/script/e2e-h2-compose.sh               | 36 +++++++++++------
 .../compose/script/e2e-mysql-compose.sh            | 39 ++++++++++++------
 .../compose/script/e2e-opengauss-compose.sh        | 40 +++++++++++++------
 .../compose/script/e2e-postgres-compose.sh         | 39 ++++++++++++------
 .../compose/script/e2e-storage-compose.sh          | 46 ++++++++++++++--------
 8 files changed, 156 insertions(+), 74 deletions(-)

diff --git a/.github/scripts/resolve-ci-modules.sh 
b/.github/scripts/resolve-ci-modules.sh
index 5c505bc9b0..9b41d5ff4e 100644
--- a/.github/scripts/resolve-ci-modules.sh
+++ b/.github/scripts/resolve-ci-modules.sh
@@ -41,9 +41,24 @@ add_module() {
   modules+=("${module}")
 }
 
+is_root_reactor_module() {
+  local module="$1"
+  local candidate="${module}"
+
+  while [[ "${candidate}" == */* ]]; do
+    if grep -Fq "<module>${candidate}</module>" pom.xml; then
+      return 0
+    fi
+    candidate="${candidate%/*}"
+  done
+
+  grep -Fq "<module>${candidate}</module>" pom.xml
+}
+
 find_module() {
   local path="$1"
   local dir
+  local module
 
   if [[ -d "${path}" ]]; then
     dir="${path}"
@@ -53,7 +68,10 @@ find_module() {
 
   while [[ "${dir}" != "." && "${dir}" != "/" ]]; do
     if [[ -f "${dir}/pom.xml" ]]; then
-      printf '%s\n' "${dir#./}"
+      module="${dir#./}"
+      if is_root_reactor_module "${module}"; then
+        printf '%s\n' "${module}"
+      fi
       return
     fi
     dir="$(dirname "${dir}")"
@@ -95,6 +113,8 @@ while IFS= read -r file; do
     module="$(find_module "${file}")"
     if [[ -n "${module:-}" ]]; then
       add_module "${module}"
+    else
+      full_build_required=true
     fi
   fi
 done < <(printf '%s' "${changed_files_json}" | jq -r '.[]')
diff --git 
a/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-opengauss.yml 
b/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-opengauss.yml
index 62c2318c13..d0c3b66228 100644
--- a/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-opengauss.yml
+++ b/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-opengauss.yml
@@ -18,7 +18,7 @@ version: '3.9'
 
 services:
   shenyu-opengauss:
-    image: enmotech/opengauss:5.0.0
+    image: enmotech/opengauss-lite:5.0.1
     container_name: shenyu-opengauss
     environment:
       - GS_PASSWORD=ShenYuE2E@123
@@ -26,7 +26,7 @@ services:
     ports:
       - "30432:5432"
     volumes:
-      - 
/tmp/shenyu-e2e/opengauss/schema/create-table.sql:/docker-entrypoint-initdb.d
+      - 
/tmp/shenyu-e2e/opengauss/schema/create-table.sql:/docker-entrypoint-initdb.d/create-table.sql
     deploy:
       resources:
         limits:
@@ -36,7 +36,7 @@ services:
           cpus: '0.5'
           memory: 512M
     healthcheck:
-      test: [ "CMD-SHELL", "gsql -U gaussdb -h127.0.0.1 -p5432 -dshenyu 
-WShenYuE2E@123 -c \"SELECT 1\"" ]
+      test: [ "CMD-SHELL", "LD_LIBRARY_PATH=/usr/local/opengauss/lib 
/usr/local/opengauss/bin/gsql -U gaussdb --password $$GS_PASSWORD -h 127.0.0.1 
-p 5432 -d shenyu -c \"SELECT 1\"" ]
       interval: 10s
       timeout: 5s
       retries: 3
diff --git 
a/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-postgres.yml 
b/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-postgres.yml
index 357a7d884b..29e3e87aca 100644
--- a/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-postgres.yml
+++ b/shenyu-e2e/shenyu-e2e-case/compose/storage/shenyu-storage-postgres.yml
@@ -27,7 +27,7 @@ services:
     ports:
       - "30432:5432"
     volumes:
-      - 
/tmp/shenyu-e2e/postgres/schema/create-table.sql:/docker-entrypoint-initdb.d
+      - 
/tmp/shenyu-e2e/postgres/schema/create-table.sql:/docker-entrypoint-initdb.d/create-table.sql
     healthcheck:
       test: [ "CMD-SHELL", "psql -U shenyue2e -h127.0.0.1 -p5432 -dshenyu -c 
\"SELECT 1\"" ]
       interval: 10s
diff --git 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-h2-compose.sh
 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-h2-compose.sh
index 191a68fc3b..6aabed43b1 100644
--- 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-h2-compose.sh
+++ 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-h2-compose.sh
@@ -16,24 +16,34 @@
 # limitations under the License.
 #
 
+set -euo pipefail
+
 # init kubernetes for h2
 SHENYU_TESTCASE_DIR=$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")
 curPath=$(readlink -f "$(dirname "$0")")
 PRGDIR=$(dirname "$curPath")
-docker compose -f "$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-h2.yml 
up -d --quiet-pull
-sleep 30s
+COMPOSE_FILE="$SHENYU_TESTCASE_DIR/compose/storage/shenyu-storage-h2.yml"
 
-# execute healthcheck.sh
-chmod +x "${curPath}"/healthcheck.sh
-sh "${curPath}"/healthcheck.sh h2 http://localhost:31095/actuator/health 
http://localhost:31195/actuator/health
+# Start services and wait for their healthchecks.
+docker network create -d bridge shenyu || true
+trap 'docker compose -f "$COMPOSE_FILE" down || true' EXIT
+dump_logs() {
+  echo "shenyu-admin log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-admin || true
+  echo "shenyu-bootstrap log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-bootstrap || true
+}
+if ! docker compose -f "$COMPOSE_FILE" up -d --quiet-pull --wait 
--wait-timeout 300; then
+  dump_logs
+  exit 1
+fi
 ## run e2e-test
-sleep 60s
 
-./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-case/shenyu-e2e-case-storage 
-am test
+if ! ./mvnw -B -f ./shenyu-e2e/pom.xml -pl 
shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
+  dump_logs
+  exit 1
+fi
 
-echo "shenyu-admin log:"
-echo "------------------"
-docker compose -f "$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-h2.yml 
logs shenyu-admin
-echo "shenyu-bootstrap log:"
-echo "------------------"
-docker compose -f "$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-h2.yml 
logs shenyu-bootstrap
+dump_logs
diff --git 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
index ec4af5917f..c1f95f9526 100644
--- 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
+++ 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
@@ -16,25 +16,38 @@
 # limitations under the License.
 #
 
+set -euo pipefail
+
 # init kubernetes for h2
 SHENYU_TESTCASE_DIR=$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")
 bash "${SHENYU_TESTCASE_DIR}"/k8s/script/storage/storage_init_mysql.sh
 curPath=$(readlink -f "$(dirname "$0")")
 PRGDIR=$(dirname "$curPath")
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-mysql.yml up -d 
--quiet-pull
-sleep 30s
+COMPOSE_FILE="$SHENYU_TESTCASE_DIR/compose/storage/shenyu-storage-mysql.yml"
 
-# execute healthcheck.sh
-chmod +x "${curPath}"/healthcheck.sh
-sh "${curPath}"/healthcheck.sh h2 http://localhost:31095/actuator/health 
http://localhost:31195/actuator/health
+# Start services and wait for their healthchecks.
+docker network create -d bridge shenyu || true
+trap 'docker compose -f "$COMPOSE_FILE" down || true' EXIT
+dump_logs() {
+  echo "shenyu-mysql log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-mysql || true
+  echo "shenyu-admin log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-admin || true
+  echo "shenyu-bootstrap log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-bootstrap || true
+}
+if ! docker compose -f "$COMPOSE_FILE" up -d --quiet-pull --wait 
--wait-timeout 300; then
+  dump_logs
+  exit 1
+fi
 ## run e2e-test
-sleep 60s
 
-./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-case/shenyu-e2e-case-storage 
-am test
+if ! ./mvnw -B -f ./shenyu-e2e/pom.xml -pl 
shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
+  dump_logs
+  exit 1
+fi
 
-echo "shenyu-admin log:"
-echo "------------------"
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-mysql.yml logs 
shenyu-admin
-echo "shenyu-bootstrap log:"
-echo "------------------"
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-mysql.yml logs 
shenyu-bootstrap
+dump_logs
diff --git 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-opengauss-compose.sh
 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-opengauss-compose.sh
index e9447c1185..32d9c1a9ca 100644
--- 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-opengauss-compose.sh
+++ 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-opengauss-compose.sh
@@ -16,25 +16,39 @@
 # limitations under the License.
 #
 
+set -euo pipefail
+
 # init kubernetes for h2
 SHENYU_TESTCASE_DIR=$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")
 bash "${SHENYU_TESTCASE_DIR}"/k8s/script/storage/storage_init_opengauss.sh
 curPath=$(readlink -f "$(dirname "$0")")
 PRGDIR=$(dirname "$curPath")
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-opengauss.yml up -d 
--quiet-pull
-sleep 30s
+COMPOSE_FILE="$SHENYU_TESTCASE_DIR/compose/storage/shenyu-storage-opengauss.yml"
 
-# execute healthcheck.sh
-chmod +x "${curPath}"/healthcheck.sh
-sh "${curPath}"/healthcheck.sh h2 http://localhost:31095/actuator/health 
http://localhost:31195/actuator/health
+# Start services and wait for their healthchecks.
+docker network create -d bridge shenyu || true
+trap 'docker compose -f "$COMPOSE_FILE" down || true' EXIT
+dump_logs() {
+  echo "shenyu-opengauss log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-opengauss || true
+  docker inspect --format '{{range .State.Health.Log}}{{println .ExitCode 
.Output}}{{end}}' shenyu-opengauss || true
+  echo "shenyu-admin log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-admin || true
+  echo "shenyu-bootstrap log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-bootstrap || true
+}
+if ! docker compose -f "$COMPOSE_FILE" up -d --quiet-pull --wait 
--wait-timeout 300; then
+  dump_logs
+  exit 1
+fi
 ## run e2e-test
-sleep 60s
 
-./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-case/shenyu-e2e-case-storage 
-am test
+if ! ./mvnw -B -f ./shenyu-e2e/pom.xml -pl 
shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
+  dump_logs
+  exit 1
+fi
 
-echo "shenyu-admin log:"
-echo "------------------"
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-opengauss.yml logs 
shenyu-admin
-echo "shenyu-bootstrap log:"
-echo "------------------"
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-opengauss.yml logs 
shenyu-bootstrap
+dump_logs
diff --git 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-postgres-compose.sh
 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-postgres-compose.sh
index 38c7047f03..a5fbdb49c9 100644
--- 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-postgres-compose.sh
+++ 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-postgres-compose.sh
@@ -16,25 +16,38 @@
 # limitations under the License.
 #
 
+set -euo pipefail
+
 # init kubernetes for h2
 SHENYU_TESTCASE_DIR=$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")
 bash "${SHENYU_TESTCASE_DIR}"/k8s/script/storage/storage_init_postgres.sh
 curPath=$(readlink -f "$(dirname "$0")")
 PRGDIR=$(dirname "$curPath")
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-postgres.yml up -d 
--quiet-pull
-sleep 30s
+COMPOSE_FILE="$SHENYU_TESTCASE_DIR/compose/storage/shenyu-storage-postgres.yml"
 
-# execute healthcheck.sh
-chmod +x "${curPath}"/healthcheck.sh
-sh "${curPath}"/healthcheck.sh h2 http://localhost:31095/actuator/health 
http://localhost:31195/actuator/health
+# Start services and wait for their healthchecks.
+docker network create -d bridge shenyu || true
+trap 'docker compose -f "$COMPOSE_FILE" down || true' EXIT
+dump_logs() {
+  echo "shenyu-postgres log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-postgres || true
+  echo "shenyu-admin log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-admin || true
+  echo "shenyu-bootstrap log:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs shenyu-bootstrap || true
+}
+if ! docker compose -f "$COMPOSE_FILE" up -d --quiet-pull --wait 
--wait-timeout 300; then
+  dump_logs
+  exit 1
+fi
 ## run e2e-test
-sleep 60s
 
-./mvnw -B -f ./shenyu-e2e/pom.xml -pl shenyu-e2e-case/shenyu-e2e-case-storage 
-am test
+if ! ./mvnw -B -f ./shenyu-e2e/pom.xml -pl 
shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
+  dump_logs
+  exit 1
+fi
 
-echo "shenyu-admin log:"
-echo "------------------"
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-postgres.yml logs 
shenyu-admin
-echo "shenyu-bootstrap log:"
-echo "------------------"
-docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-postgres.yml logs 
shenyu-bootstrap
+dump_logs
diff --git 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-storage-compose.sh
 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-storage-compose.sh
index 4c14544270..517a4f7736 100644
--- 
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-storage-compose.sh
+++ 
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-storage-compose.sh
@@ -16,12 +16,27 @@
 # limitations under the License.
 #
 
+set -euo pipefail
+
 # init kubernetes for h2
 SHENYU_TESTCASE_DIR=$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")
 curPath=$(readlink -f "$(dirname "$0")")
 PRGDIR=$(dirname "$curPath")
 
-docker network create -d bridge shenyu
+docker network create -d bridge shenyu || true
+
+COMPOSE_FILE=""
+cleanup() {
+  if [ -n "$COMPOSE_FILE" ]; then
+    docker compose -f "$COMPOSE_FILE" down || true
+  fi
+}
+dump_logs() {
+  echo "compose service logs:"
+  echo "------------------"
+  docker compose -f "$COMPOSE_FILE" logs || true
+}
+trap cleanup EXIT
 
 STORAGE_ARRAY=("h2" "mysql" "opengauss" "postgres")
 for storage in "${STORAGE_ARRAY[@]}"; do
@@ -29,21 +44,18 @@ for storage in "${STORAGE_ARRAY[@]}"; do
     bash 
"${SHENYU_TESTCASE_DIR}"/k8s/script/storage/storage_init_"${storage}".sh
   fi
 
-  docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-"${storage}".yml up -d 
--quiet-pull
-  sleep 30s
-  
-  # execute healthcheck.sh
-  chmod +x "${curPath}"/healthcheck.sh
-  sh "${curPath}"/healthcheck.sh "${storage}" 
http://localhost:31095/actuator/health http://localhost:31195/actuator/health
+  
COMPOSE_FILE="$SHENYU_TESTCASE_DIR/compose/storage/shenyu-storage-$storage.yml"
+  if ! docker compose -f "$COMPOSE_FILE" up -d --quiet-pull --wait 
--wait-timeout 300; then
+    dump_logs
+    exit 1
+  fi
   ## run e2e-test
-  sleep 60s
-  
-  ./mvnw -B -f ./shenyu-e2e/pom.xml -pl 
shenyu-e2e-case/shenyu-e2e-case-storage -am test
-  
-  echo "shenyu-admin log:"
-  echo "------------------"
-  docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-"${storage}".yml logs 
shenyu-admin
-  echo "shenyu-bootstrap log:"
-  echo "------------------"
-  docker compose -f 
"$SHENYU_TESTCASE_DIR"/compose/storage/shenyu-storage-"${storage}".yml logs 
shenyu-bootstrap
+  if ! ./mvnw -B -f ./shenyu-e2e/pom.xml -pl 
shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
+    dump_logs
+    exit 1
+  fi
+
+  dump_logs
+  docker compose -f "$COMPOSE_FILE" down || true
+  COMPOSE_FILE=""
 done

Reply via email to