Skip to content

Commit

Permalink
fix(interactive): Fix flex interactive api test (#4401)
Browse files Browse the repository at this point in the history
Fix flex interactive api test, also refine the workflow.

Fix #4395
  • Loading branch information
zhanglei1949 authored Jan 2, 2025
1 parent 9605a16 commit 30f905e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/flex-interactive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ jobs:
if: false

- name: Test gsctl
env:
CYPHER_PORT: 7688
COORDINATOR_PORT: 8080
COORDINATOR_ENDPOINT: "http://127.0.0.1:8080"
run: |
# install gsctl
python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl
# launch service: 8080 for coordinator http port; 7687 for cypher port;
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --cypher-port 7688 --interactive-config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml
# launch service: ${COORDINATOR_PORT} for coordinator http port; ${CYPHER_PORT} for cypher port;
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --cypher-port ${CYPHER_PORT} --coordinator-port ${COORDINATOR_PORT} --interactive-config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml
sleep 20
# test
python3 -m pip install --no-cache-dir pytest pytest-cov pytest-timeout pytest-xdist
Expand All @@ -67,8 +71,8 @@ jobs:
$(dirname $(python3 -c "import graphscope.gsctl as gsctl; print(gsctl.__file__)"))/tests/test_interactive.py
# test coordinator
res=`curl http://127.0.0.1:8080/api/v1/service`
echo $res | grep 7688 || exit 1
res=`curl http://127.0.0.1:${COORDINATOR_PORT}/api/v1/service`
echo $res | grep ${CYPHER_PORT} || exit 1
# destroy instance
gsctl instance destroy --type interactive -y
Expand Down
19 changes: 11 additions & 8 deletions flex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ option(BUILD_ODPS_FRAGMENT_LOADER "Whether to build odps fragment loader" OFF)
option(USE_PTHASH "Whether to use pthash" OFF)
option(OPTIMIZE_FOR_HOST "Whether to optimize on host" ON) # Whether to build optimized code on host
option(USE_STATIC_ARROW "Whether to use static arrow" ON) # Whether to link arrow statically, default is ON
option(BUILD_WITH_OTEL "Whether to build with opentelemetry-cpp" OFF) # Whether to build with opentelemetry-cpp, default is OFF

#print options
message(STATUS "Build test: ${BUILD_TEST}")
Expand Down Expand Up @@ -164,14 +165,16 @@ endif ()
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})

find_package(opentelemetry-cpp CONFIG)
if (OPENTELEMETRY_CPP_FOUND)
message(STATUS "opentelemetry-cpp found")
find_package(CURL REQUIRED)
add_definitions(-DHAVE_OPENTELEMETRY_CPP)
else()
message(STATUS "opentelemetry-cpp not found, build without opentelemetry-cpp")
endif ()
if (BUILD_WITH_OTEL)
find_package(opentelemetry-cpp CONFIG)
if (OPENTELEMETRY_CPP_FOUND)
message(STATUS "opentelemetry-cpp found")
find_package(CURL REQUIRED)
add_definitions(-DHAVE_OPENTELEMETRY_CPP)
else()
message(STATUS "opentelemetry-cpp not found, build without opentelemetry-cpp")
endif ()
endif()

# Find Doxygen
if (BUILD_DOC)
Expand Down
3 changes: 3 additions & 0 deletions python/graphscope/gsctl/tests/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# limitations under the License.
#

import os
import warnings

# Disable warnings
Expand Down Expand Up @@ -219,6 +220,8 @@ class ExampleQuery : public CypherReadAppBase<int32_t> {

class TestE2EInteractive(object):
def setup_class(self):
if "COORDINATOR_ENDPOINT" in os.environ:
COORDINATOR_ENDPOINT = os.environ["COORDINATOR_ENDPOINT"]
self.deployment_info = connect_coordinator(COORDINATOR_ENDPOINT)

def test_deployment_info(self):
Expand Down

0 comments on commit 30f905e

Please sign in to comment.