Skip to content

Commit dfe06f2

Browse files
committed
fix(ci): submit Gremlin Console smoke via driver
1 parent 5a33dc7 commit dfe06f2

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

hugegraph-server/hugegraph-dist/src/assembly/travis/run-gremlin-console-smoke-test.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,27 @@ cat >> "$REMOTE_CONFIG" <<EOF
5555
5656
username: admin
5757
password: pa
58-
aliases:
59-
g: __g_DEFAULT-hugegraph
6058
EOF
6159

6260
cat > "$SMOKE_SCRIPT" <<EOF
63-
:remote connect tinkerpop.server conf/remote.yaml
64-
:> def count = g.V().count().next(); if (count < 0L) throw new IllegalStateException("Unexpected vertex count: " + count); "${SMOKE_MARKER}-" + count
65-
println(result[0].object)
61+
import org.apache.tinkerpop.gremlin.driver.Cluster
62+
63+
def cluster = Cluster.open('conf/remote.yaml')
64+
def client = cluster.connect().alias(['g': '__g_DEFAULT-hugegraph'])
65+
try {
66+
def remoteScript = '''
67+
def count = g.V().count().next()
68+
if (count < 0L) {
69+
throw new IllegalStateException('Unexpected vertex count: ' + count)
70+
}
71+
'${SMOKE_MARKER}-' + count
72+
'''
73+
def results = client.submit(remoteScript).all().get()
74+
println(results[0].object)
75+
} finally {
76+
client.close()
77+
cluster.close()
78+
}
6679
EOF
6780

6881
(

0 commit comments

Comments
 (0)