From 185512697b997e83dbb50f9baa390d1fca277123 Mon Sep 17 00:00:00 2001 From: "xiaolei.zl" Date: Tue, 22 Oct 2024 12:03:45 +0800 Subject: [PATCH] fix ci Committed-by: xiaolei.zl from Dev container --- .github/workflows/interactive.yml | 2 +- .../gs_interactive/tests/test_robustness.py | 2 +- flex/tests/hqps/hqps_robust_test.sh | 36 ++++++++++++++++--- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/interactive.yml b/.github/workflows/interactive.yml index fc10b28cf220..1039ce0cd073 100644 --- a/.github/workflows/interactive.yml +++ b/.github/workflows/interactive.yml @@ -175,7 +175,7 @@ jobs: INTERACTIVE_WORKSPACE: /tmp/interactive_workspace run: | cd ${GITHUB_WORKSPACE}/flex/tests/hqps - bash hqps_robust_test.sh ${INTERACTIVE_WORKSPACE} ./interactive_config_test.yaml + bash hqps_robust_test.sh ${INTERACTIVE_WORKSPACE} ./interactive_config_test.yaml ./interactive_config_test_cbo.yaml - name: Sample Query test env: diff --git a/flex/interactive/sdk/python/gs_interactive/tests/test_robustness.py b/flex/interactive/sdk/python/gs_interactive/tests/test_robustness.py index 1dcd59798309..9f40404891aa 100644 --- a/flex/interactive/sdk/python/gs_interactive/tests/test_robustness.py +++ b/flex/interactive/sdk/python/gs_interactive/tests/test_robustness.py @@ -251,7 +251,7 @@ def test_list_jobs(interactive_session, create_vertex_only_modern_graph): resp = interactive_session.list_jobs() assert resp.is_ok() and len(resp.get_value()) > 0 - +@pytest.mark.skipif(os.environ.get("RUN_ON_PROTO", None) != "ON", reason="Only works on proto") def test_call_proc_in_cypher(interactive_session, neo4j_session, create_modern_graph): print("[Test call procedure in cypher]") import_data_to_full_modern_graph(interactive_session, create_modern_graph) diff --git a/flex/tests/hqps/hqps_robust_test.sh b/flex/tests/hqps/hqps_robust_test.sh index b93e3a65f94d..8090d8be8164 100644 --- a/flex/tests/hqps/hqps_robust_test.sh +++ b/flex/tests/hqps/hqps_robust_test.sh @@ -20,14 +20,15 @@ ADMIN_PORT=7777 QUERY_PORT=10000 CYPHER_PORT=7687 -if [ ! $# -eq 2 ]; then - echo "only receives: $# args, need 2" - echo "Usage: $0 " +if [ ! $# -eq 3 ]; then + echo "only receives: $# args, need 3" + echo "Usage: $0 " exit 1 fi INTERACTIVE_WORKSPACE=$1 ENGINE_CONFIG_PATH=$2 +CBO_ENGINE_CONFIG_PATH=$3 if [ ! -d ${INTERACTIVE_WORKSPACE} ]; then echo "INTERACTIVE_WORKSPACE: ${INTERACTIVE_WORKSPACE} not exists" @@ -38,6 +39,11 @@ if [ ! -f ${ENGINE_CONFIG_PATH} ]; then exit 1 fi +if [ ! -f ${CBO_ENGINE_CONFIG_PATH} ]; then + echo "CBO_ENGINE_CONFIG_PATH: ${CBO_ENGINE_CONFIG_PATH} not exists" + exit 1 +fi + RED='\033[0;31m' GREEN='\033[0;32m' NC='\033[0m' # No Color @@ -63,13 +69,19 @@ trap kill_service EXIT # start engine service start_engine_service(){ + # expect one argument + if [ ! $# -eq 1 ]; then + err "start_engine_service need one argument" + exit 1 + fi + local config_path=$1 #check SERVER_BIN exists if [ ! -f ${SERVER_BIN} ]; then err "SERVER_BIN not found" exit 1 fi - cmd="${SERVER_BIN} -c ${ENGINE_CONFIG_PATH} --enable-admin-service true " + cmd="${SERVER_BIN} -c ${config_path} --enable-admin-service true " cmd="${cmd} -w ${INTERACTIVE_WORKSPACE} --start-compiler true &" echo "Start engine service with command: ${cmd}" @@ -91,13 +103,27 @@ run_robust_test(){ popd } +run_additional_robust_test(){ + pushd ${FLEX_HOME}/interactive/sdk/python/gs_interactive + export RUN_ON_PROTO=ON + cmd="python3 -m pytest -s tests/test_robustness.py -k test_call_proc_in_cypher" + echo "Run additional robust test with command: ${cmd}" + eval ${cmd} || (err "Run additional robust test failed"; exit 1) + info "Run additional robust test success" + popd +} + kill_service -start_engine_service +start_engine_service $ENGINE_CONFIG_PATH export INTERACTIVE_ADMIN_ENDPOINT=http://localhost:${ADMIN_PORT} export INTERACTIVE_STORED_PROC_ENDPOINT=http://localhost:${QUERY_PORT} export INTERACTIVE_CYPHER_ENDPOINT=neo4j://localhost:${CYPHER_PORT} export INTERACTIVE_GREMLIN_ENDPOINT=ws://localhost:${GREMLIN_PORT}/gremlin run_robust_test +kill_service +sleep 5 +start_engine_service $CBO_ENGINE_CONFIG_PATH +run_additional_robust_test kill_service \ No newline at end of file