diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 266e70feb1..6da445a0f6 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -82,6 +82,13 @@ jobs: run: | $TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR + - name: Run Gremlin Console smoke test + if: ${{ matrix.BACKEND == 'rocksdb' }} + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/ + bash "$TRAVIS_DIR/run-gremlin-console-smoke-test.sh" "$SERVER_DIR" + # TODO: disable raft test in normal PR due to the always timeout problem - name: Run raft test if: ${{ env.RAFT_MODE == 'true' && env.BACKEND == 'rocksdb' }} @@ -156,6 +163,12 @@ jobs: run: | $TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR + - name: Run Gremlin Console smoke test + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/ + bash "$TRAVIS_DIR/run-gremlin-console-smoke-test.sh" "$SERVER_DIR" + - name: Show server log on failure if: failure() run: | diff --git a/hugegraph-server/hugegraph-dist/src/assembly/travis/run-gremlin-console-smoke-test.sh b/hugegraph-server/hugegraph-dist/src/assembly/travis/run-gremlin-console-smoke-test.sh new file mode 100644 index 0000000000..68cfc8fd92 --- /dev/null +++ b/hugegraph-server/hugegraph-dist/src/assembly/travis/run-gremlin-console-smoke-test.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +set -euo pipefail + +SERVER_DIR=${1:?Usage: run-gremlin-console-smoke-test.sh } +SMOKE_MARKER="gremlin-console-smoke-ok" + +if [ ! -d "$SERVER_DIR" ]; then + echo "Server directory does not exist: $SERVER_DIR" + exit 1 +fi + +if [ ! -x "$SERVER_DIR/bin/gremlin-console.sh" ]; then + echo "Gremlin Console script is not executable: $SERVER_DIR/bin/gremlin-console.sh" + exit 1 +fi + +TMP_DIR=${TMPDIR:-/tmp} +SMOKE_SCRIPT=$(mktemp "${TMP_DIR}/hugegraph-gremlin-console-smoke.XXXXXX.groovy") +SMOKE_LOG=$(mktemp "${TMP_DIR}/hugegraph-gremlin-console-smoke.XXXXXX.log") + +cleanup() { + rm -f "$SMOKE_SCRIPT" "$SMOKE_LOG" +} +trap cleanup EXIT + +cat > "$SMOKE_SCRIPT" <