VGalaxies commented on code in PR #3040:
URL: https://github.com/apache/hugegraph/pull/3040#discussion_r3401063077


##########
hugegraph-server/hugegraph-dist/src/assembly/travis/run-gremlin-console-smoke-test.sh:
##########
@@ -0,0 +1,56 @@
+#!/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 <server-dir>}
+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}
+TMP_WORK_DIR=$(mktemp -d "${TMP_DIR}/hugegraph-gremlin-console-smoke.XXXXXX")
+SMOKE_SCRIPT="${TMP_WORK_DIR}/smoke.groovy"
+SMOKE_LOG="${TMP_WORK_DIR}/smoke.log"
+
+cleanup() {
+    rm -rf "$TMP_WORK_DIR"
+}
+trap cleanup EXIT
+
+cat > "$SMOKE_SCRIPT" <<EOF

Review Comment:
   **Medium: Smoke test does not exercise HugeGraph integration**
   
   
`hugegraph-server/hugegraph-dist/src/assembly/travis/run-gremlin-console-smoke-test.sh:43`
   
   **Evidence**
   - The generated script only evaluates `1 + 1`, prints 
`gremlin-console-smoke-ok`, and runs it with `bin/gremlin-console.sh -- -e 
"$SMOKE_SCRIPT"`. It never connects through `conf/remote.yaml` or executes a 
remote traversal; in the Linux job it is also invoked after `run-api-test.sh`, 
which stops the server.
   
   **Impact**
   - CI can pass even if the packaged Gremlin Console cannot connect to 
HugeGraph, the remote config is broken, or Gremlin Server auth/traversal 
compatibility regresses.
   
   **Requested fix**
   - Run the smoke while HugeGraph is running and execute a harmless remote 
operation through the packaged config, for example `:remote connect 
tinkerpop.server conf/remote.yaml` with the CI auth settings and an assertion 
on `g.V().count()` or an equivalent remote expression.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to