Skip to content

Commit 30f905e

Browse files
authored
fix(interactive): Fix flex interactive api test (#4401)
Fix flex interactive api test, also refine the workflow. Fix #4395
1 parent 9605a16 commit 30f905e

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

.github/workflows/flex-interactive.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ jobs:
5252
if: false
5353

5454
- name: Test gsctl
55+
env:
56+
CYPHER_PORT: 7688
57+
COORDINATOR_PORT: 8080
58+
COORDINATOR_ENDPOINT: "http://127.0.0.1:8080"
5559
run: |
5660
# install gsctl
5761
python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl
58-
# launch service: 8080 for coordinator http port; 7687 for cypher port;
59-
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
62+
# launch service: ${COORDINATOR_PORT} for coordinator http port; ${CYPHER_PORT} for cypher port;
63+
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
6064
sleep 20
6165
# test
6266
python3 -m pip install --no-cache-dir pytest pytest-cov pytest-timeout pytest-xdist
@@ -67,8 +71,8 @@ jobs:
6771
$(dirname $(python3 -c "import graphscope.gsctl as gsctl; print(gsctl.__file__)"))/tests/test_interactive.py
6872
6973
# test coordinator
70-
res=`curl http://127.0.0.1:8080/api/v1/service`
71-
echo $res | grep 7688 || exit 1
74+
res=`curl http://127.0.0.1:${COORDINATOR_PORT}/api/v1/service`
75+
echo $res | grep ${CYPHER_PORT} || exit 1
7276
7377
# destroy instance
7478
gsctl instance destroy --type interactive -y

flex/CMakeLists.txt

+11-8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ option(BUILD_ODPS_FRAGMENT_LOADER "Whether to build odps fragment loader" OFF)
1616
option(USE_PTHASH "Whether to use pthash" OFF)
1717
option(OPTIMIZE_FOR_HOST "Whether to optimize on host" ON) # Whether to build optimized code on host
1818
option(USE_STATIC_ARROW "Whether to use static arrow" ON) # Whether to link arrow statically, default is ON
19+
option(BUILD_WITH_OTEL "Whether to build with opentelemetry-cpp" OFF) # Whether to build with opentelemetry-cpp, default is OFF
1920

2021
#print options
2122
message(STATUS "Build test: ${BUILD_TEST}")
@@ -164,14 +165,16 @@ endif ()
164165
find_package(Protobuf REQUIRED)
165166
include_directories(${Protobuf_INCLUDE_DIRS})
166167

167-
find_package(opentelemetry-cpp CONFIG)
168-
if (OPENTELEMETRY_CPP_FOUND)
169-
message(STATUS "opentelemetry-cpp found")
170-
find_package(CURL REQUIRED)
171-
add_definitions(-DHAVE_OPENTELEMETRY_CPP)
172-
else()
173-
message(STATUS "opentelemetry-cpp not found, build without opentelemetry-cpp")
174-
endif ()
168+
if (BUILD_WITH_OTEL)
169+
find_package(opentelemetry-cpp CONFIG)
170+
if (OPENTELEMETRY_CPP_FOUND)
171+
message(STATUS "opentelemetry-cpp found")
172+
find_package(CURL REQUIRED)
173+
add_definitions(-DHAVE_OPENTELEMETRY_CPP)
174+
else()
175+
message(STATUS "opentelemetry-cpp not found, build without opentelemetry-cpp")
176+
endif ()
177+
endif()
175178

176179
# Find Doxygen
177180
if (BUILD_DOC)

python/graphscope/gsctl/tests/test_interactive.py

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# limitations under the License.
1717
#
1818

19+
import os
1920
import warnings
2021

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

220221
class TestE2EInteractive(object):
221222
def setup_class(self):
223+
if "COORDINATOR_ENDPOINT" in os.environ:
224+
COORDINATOR_ENDPOINT = os.environ["COORDINATOR_ENDPOINT"]
222225
self.deployment_info = connect_coordinator(COORDINATOR_ENDPOINT)
223226

224227
def test_deployment_info(self):

0 commit comments

Comments
 (0)