From 292081676b6aefaa68b2a1914a18787c4c4f522d Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Mon, 8 Jun 2026 12:03:31 +0530 Subject: [PATCH 1/2] ci(test): exit 77 when tools missing to distinguish skip from pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All three startup test scripts previously exited 0 when required tools (lsof, curl, java) were not found. This is indistinguishable from a passing test run — CI shows green even though no tests ran. Change skip exits to 77 (conventional skip code) and update the CI workflow steps to treat exit 77 as a visible skip notice rather than a failure. Flagged as non-blocking follow-up in reviews of #3044 and #3047. Related to: #3043 --- .github/workflows/pd-store-ci.yml | 16 ++++++++++++++++ .github/workflows/server-ci.yml | 8 ++++++++ .../assembly/travis/test-start-hugegraph-pd.sh | 2 +- .../travis/test-start-hugegraph-store.sh | 4 ++-- .../src/assembly/travis/test-start-hugegraph.sh | 2 +- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pd-store-ci.yml b/.github/workflows/pd-store-ci.yml index 29ac9c3ac8..edbe84dcaa 100644 --- a/.github/workflows/pd-store-ci.yml +++ b/.github/workflows/pd-store-ci.yml @@ -111,7 +111,15 @@ jobs: run: | VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) PD_DIR=hugegraph-pd/apache-hugegraph-pd-$VERSION/ + set +e $TRAVIS_DIR/test-start-hugegraph-pd.sh $PD_DIR + EXIT=$? + set -e + if [ $EXIT -eq 77 ]; then + echo "::notice::PD startup tests skipped — required tools not available" + exit 0 + fi + exit $EXIT - name: Prepare env and service run: | @@ -173,7 +181,15 @@ jobs: run: | VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) STORE_DIR=hugegraph-store/apache-hugegraph-store-$VERSION/ + set +e $TRAVIS_DIR/test-start-hugegraph-store.sh $STORE_DIR + EXIT=$? + set -e + if [ $EXIT -eq 77 ]; then + echo "::notice::Store startup tests skipped — required tools not available" + exit 0 + fi + exit $EXIT - name: Prepare env and service run: | diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 20619797cc..5fe01a9d84 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -76,7 +76,15 @@ jobs: mvn package -Dmaven.test.skip=true -pl hugegraph-server/hugegraph-dist -am -ntp VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/ + set +e $TRAVIS_DIR/test-start-hugegraph.sh $SERVER_DIR + EXIT=$? + set -e + if [ $EXIT -eq 77 ]; then + echo "::notice::Startup tests skipped — required tools not available" + exit 0 + fi + exit $EXIT - name: Run unit test run: | diff --git a/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-pd.sh b/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-pd.sh index db3428b13c..260e7f5711 100755 --- a/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-pd.sh +++ b/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-pd.sh @@ -132,7 +132,7 @@ fi for tool in lsof curl java; do if ! command -v "$tool" >/dev/null 2>&1; then echo "SKIP: required tool '$tool' not found — skipping test suite" - exit 0 + exit 77 fi done diff --git a/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-store.sh b/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-store.sh index 7da9323767..7e11da28dd 100755 --- a/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-store.sh +++ b/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph-store.sh @@ -113,7 +113,7 @@ fi for tool in lsof curl java; do if ! command -v "$tool" >/dev/null 2>&1; then echo "SKIP: required tool '$tool' not found — skipping test suite" - exit 0 + exit 77 fi done @@ -122,7 +122,7 @@ LIMIT_N=$(ulimit -n) if [[ "$LIMIT_N" != "unlimited" ]]; then if (( LIMIT_N < 1024 )); then echo "SKIP: ulimit -n is $LIMIT_N — store requires >= 1024. Run: ulimit -n 1024" - exit 0 + exit 77 fi fi diff --git a/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph.sh b/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph.sh index d2dd492fc9..353cab6518 100755 --- a/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph.sh +++ b/hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-hugegraph.sh @@ -148,7 +148,7 @@ fi for tool in lsof crontab curl java; do if ! command -v "$tool" >/dev/null 2>&1; then echo "SKIP: required tool '$tool' not found — skipping test suite" - exit 0 + exit 77 fi done From 1c3cec2f72eec45725c22b09741d7cebffd4dbb2 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Tue, 9 Jun 2026 10:52:57 +0530 Subject: [PATCH 2/2] ci(test): use preflight/guard pattern to show skipped steps as grey Replace the exit-77 + set+e wrapper with a preflight step that writes can_run and skip_reason to GITHUB_OUTPUT. The test step is guarded by if: steps..outputs.can_run == 'true', so it shows as grey Skipped (not green Success) when prerequisites are missing. The Store preflight distinguishes 'missing tool: ' from 'ulimit -n is (store requires >= 1024)' with separate skip_reason values as requested in review. Addresses blocking review feedback from imbajin on #3055. Related to: #3043 --- .github/workflows/pd-store-ci.yml | 58 ++++++++++++++++++++++--------- .github/workflows/server-ci.yml | 28 ++++++++++----- 2 files changed, 61 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pd-store-ci.yml b/.github/workflows/pd-store-ci.yml index edbe84dcaa..62006794c7 100644 --- a/.github/workflows/pd-store-ci.yml +++ b/.github/workflows/pd-store-ci.yml @@ -107,19 +107,29 @@ jobs: run: | mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp --fail-at-end + - name: Check startup test prerequisites (PD) + id: pd-preflight + run: | + for tool in lsof curl java; do + if ! command -v "$tool" >/dev/null 2>&1; then + echo "can_run=false" >> "$GITHUB_OUTPUT" + echo "skip_reason=missing tool: $tool" >> "$GITHUB_OUTPUT" + exit 0 + fi + done + echo "can_run=true" >> "$GITHUB_OUTPUT" + - name: Run start-hugegraph-pd.sh foreground mode tests + if: steps.pd-preflight.outputs.can_run == 'true' run: | VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) PD_DIR=hugegraph-pd/apache-hugegraph-pd-$VERSION/ - set +e $TRAVIS_DIR/test-start-hugegraph-pd.sh $PD_DIR - EXIT=$? - set -e - if [ $EXIT -eq 77 ]; then - echo "::notice::PD startup tests skipped — required tools not available" - exit 0 - fi - exit $EXIT + + - name: Startup tests skipped (missing prerequisites) + if: steps.pd-preflight.outputs.can_run == 'false' + run: | + echo "::notice::PD startup tests skipped — ${{ steps.pd-preflight.outputs.skip_reason }}" - name: Prepare env and service run: | @@ -177,19 +187,35 @@ jobs: run: | mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp --fail-at-end + - name: Check startup test prerequisites (Store) + id: store-preflight + run: | + for tool in lsof curl java; do + if ! command -v "$tool" >/dev/null 2>&1; then + echo "can_run=false" >> "$GITHUB_OUTPUT" + echo "skip_reason=missing tool: $tool" >> "$GITHUB_OUTPUT" + exit 0 + fi + done + LIMIT_N=$(ulimit -n) + if [[ "$LIMIT_N" != "unlimited" ]] && (( LIMIT_N < 1024 )); then + echo "can_run=false" >> "$GITHUB_OUTPUT" + echo "skip_reason=ulimit -n is $LIMIT_N (store requires >= 1024)" >> "$GITHUB_OUTPUT" + exit 0 + fi + echo "can_run=true" >> "$GITHUB_OUTPUT" + - name: Run start-hugegraph-store.sh foreground mode tests + if: steps.store-preflight.outputs.can_run == 'true' run: | VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) STORE_DIR=hugegraph-store/apache-hugegraph-store-$VERSION/ - set +e $TRAVIS_DIR/test-start-hugegraph-store.sh $STORE_DIR - EXIT=$? - set -e - if [ $EXIT -eq 77 ]; then - echo "::notice::Store startup tests skipped — required tools not available" - exit 0 - fi - exit $EXIT + + - name: Startup tests skipped (missing prerequisites) + if: steps.store-preflight.outputs.can_run == 'false' + run: | + echo "::notice::Store startup tests skipped — ${{ steps.store-preflight.outputs.skip_reason }}" - name: Prepare env and service run: | diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 5fe01a9d84..2eb313c979 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -70,21 +70,31 @@ jobs: run: | mvn clean compile -U -Dmaven.javadoc.skip=true -ntp - - name: Run start-hugegraph.sh foreground mode tests + - name: Check startup test prerequisites + id: server-preflight if: ${{ env.BACKEND == 'rocksdb' }} + run: | + for tool in lsof crontab curl java; do + if ! command -v "$tool" >/dev/null 2>&1; then + echo "can_run=false" >> "$GITHUB_OUTPUT" + echo "skip_reason=missing tool: $tool" >> "$GITHUB_OUTPUT" + exit 0 + fi + done + echo "can_run=true" >> "$GITHUB_OUTPUT" + + - name: Run start-hugegraph.sh foreground mode tests + if: ${{ env.BACKEND == 'rocksdb' && steps.server-preflight.outputs.can_run == 'true' }} run: | mvn package -Dmaven.test.skip=true -pl hugegraph-server/hugegraph-dist -am -ntp VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/ - set +e $TRAVIS_DIR/test-start-hugegraph.sh $SERVER_DIR - EXIT=$? - set -e - if [ $EXIT -eq 77 ]; then - echo "::notice::Startup tests skipped — required tools not available" - exit 0 - fi - exit $EXIT + + - name: Startup tests skipped (missing prerequisites) + if: ${{ env.BACKEND == 'rocksdb' && steps.server-preflight.outputs.can_run == 'false' }} + run: | + echo "::notice::Server startup tests skipped — ${{ steps.server-preflight.outputs.skip_reason }}" - name: Run unit test run: |