Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hugegraph test with apache release 1.2 #5

Merged
merged 62 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9ec8904
deploy server
liuxiaocs7 Nov 30, 2023
a59fd19
deploy toolchain
liuxiaocs7 Nov 30, 2023
56aad4d
update requirements
liuxiaocs7 Nov 30, 2023
de60cb6
update toolchain conf
liuxiaocs7 Nov 30, 2023
c89be76
fix param_direction_valueOut
liuxiaocs7 Nov 30, 2023
b121c38
fix TestAllShortestPath
liuxiaocs7 Nov 30, 2023
53ca7a7
fix TestCrosspoints
liuxiaocs7 Nov 30, 2023
e0af77f
fix TestCustomizedCrosspoints
liuxiaocs7 Nov 30, 2023
d0d8ef0
code format
liuxiaocs7 Nov 30, 2023
ca997d4
update TestCustomizedPaths
liuxiaocs7 Nov 30, 2023
0e9a8d7
fix TestEdgeShard
liuxiaocs7 Nov 30, 2023
2b87e7d
update TestEdges
liuxiaocs7 Nov 30, 2023
b470391
update TestFusiformSimilarity
liuxiaocs7 Nov 30, 2023
bff7bc8
update TestShardEdge
liuxiaocs7 Nov 30, 2023
4eda57b
update TestShardVertex
liuxiaocs7 Nov 30, 2023
c8baa7f
fix TestKNeighbor
liuxiaocs7 Nov 30, 2023
7c30224
update TestKOut
liuxiaocs7 Nov 30, 2023
98e6262
update TestMultiNodeShortestPath
liuxiaocs7 Nov 30, 2023
e3a9411
fix TestPaths
liuxiaocs7 Nov 30, 2023
b4ec3a1
fix TestRays
liuxiaocs7 Nov 30, 2023
27dc312
fix TestRing
liuxiaocs7 Nov 30, 2023
08d0858
fix TestShortestPath
liuxiaocs7 Nov 30, 2023
8975122
update
liuxiaocs7 Nov 30, 2023
b667ea3
fix TestVertexShard
liuxiaocs7 Nov 30, 2023
59b3f3e
update
liuxiaocs7 Nov 30, 2023
d2fffb2
update olap test
liuxiaocs7 Nov 30, 2023
6018fbb
update auth module
liuxiaocs7 Nov 30, 2023
b783c6a
fix server basic operation
liuxiaocs7 Nov 30, 2023
74d4a7d
fix loader test
liuxiaocs7 Nov 30, 2023
9716de1
update ci
liuxiaocs7 Dec 4, 2023
ce110dd
fix auth access
liuxiaocs7 Dec 4, 2023
ccfae67
fix auth group
liuxiaocs7 Dec 4, 2023
86c2eee
fix auth target
liuxiaocs7 Dec 4, 2023
ddcf201
fix auth all
liuxiaocs7 Dec 4, 2023
2079e65
format
liuxiaocs7 Dec 4, 2023
9e265a5
fix hubble test
liuxiaocs7 Dec 5, 2023
3e72e8e
format
liuxiaocs7 Dec 5, 2023
4d4f322
format
liuxiaocs7 Dec 5, 2023
8e7fb06
update ttl test
liuxiaocs7 Dec 5, 2023
a575393
update tools test
liuxiaocs7 Dec 5, 2023
bc01171
update ci no auth
liuxiaocs7 Dec 5, 2023
976e590
update
liuxiaocs7 Dec 5, 2023
ccfeb90
fix
liuxiaocs7 Dec 5, 2023
85e69e1
add node env
liuxiaocs7 Dec 5, 2023
45afecd
fix test kout
liuxiaocs7 Dec 5, 2023
4a64f41
fix test property
liuxiaocs7 Dec 5, 2023
2ccde05
compile
liuxiaocs7 Dec 5, 2023
441e69c
update
liuxiaocs7 Dec 5, 2023
d0ea1bf
toolchain id
liuxiaocs7 Dec 5, 2023
e85eb51
fix
liuxiaocs7 Dec 5, 2023
bf5bb04
fix
liuxiaocs7 Dec 5, 2023
e046642
test
liuxiaocs7 Dec 5, 2023
4b95aeb
update
liuxiaocs7 Dec 5, 2023
4a2324c
update
liuxiaocs7 Dec 5, 2023
6f4f675
stage
liuxiaocs7 Dec 5, 2023
caec3c0
update master commit id
liuxiaocs7 Dec 5, 2023
dc24e91
add readme
liuxiaocs7 Dec 5, 2023
59d9356
Update src/config/basic_config.py
liuxiaocs7 Dec 6, 2023
d445f69
Update src/config/basic_config.py
liuxiaocs7 Dec 6, 2023
18e506a
fix code dir
liuxiaocs7 Dec 6, 2023
7d5b952
fix prefix
liuxiaocs7 Dec 6, 2023
dc46fd0
remove unused code
liuxiaocs7 Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code_stst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
code_statistics:
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
steps:
- id: stat_cmd
run: |
Expand Down
151 changes: 77 additions & 74 deletions .github/workflows/rocksdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,93 +12,44 @@ on:
# 手动触发
workflow_dispatch:


jobs:
# job: openSource and no auth
openSource_no_auth:
name: openSource and no auth
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
steps:

- name: install JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'

- name: cache maven repository
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-maven-

- name: install python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'

- name: cache python dependencies
uses: actions/cache@v2
id: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: checkout python scripts
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt

- name: deploy hugegraph
run: |
python src/deploy_start.py all

- name: decompress dataset.zip
run: |
unzip src/config/dataset.zip
mv dataset src/config/

- name: run test cases
run: |
pytest --html=test.html --capture=tee-sys


# job: openSource and exist auth
openSource_exist_auth:
name: openSource and exist auth
runs-on: ubuntu-16.04
steps:
- name: install JDK 8
uses: actions/setup-java@v2
- name: Use Node.js 16
uses: actions/setup-node@v4
with:
java-version: '8'
distribution: 'adopt'
node-version: '16'

- name: cache maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Get Yarn path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: install python 3.7
uses: actions/setup-python@v2
- name: install python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.10'
architecture: 'x64'

- name: cache python dependencies
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
Expand All @@ -107,7 +58,7 @@ jobs:
${{ runner.os }}-pip-

- name: checkout python scripts
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand All @@ -118,23 +69,75 @@ jobs:

- name: deploy hugegraph
run: |
sed -i -e "s/^is_auth.*$/is_auth = True/g" src/config/basic_config.py
sed -i -e "s/^admin_password.*$/admin_password = {'admin': '123456'}/g" src/config/basic_config.py
sed -i -e "s/^test_password.*$/test_password = {'tester': '123456'}/g" src/config/basic_config.py
python src/deploy_start.py all


- name: decompress dataset.zip
run: |
unzip src/config/dataset.zip
mv dataset src/config/

- name: run test cases
run: |
pytest --html=test.html --capture=tee-sys






# job: openSource and exist auth
# openSource_exist_auth:
# name: openSource and exist auth
# runs-on: ubuntu-latest
# steps:
# - name: install JDK 8
# uses: actions/setup-java@v2
# with:
# java-version: '8'
# distribution: 'adopt'
#
# - name: cache maven repository
# uses: actions/cache@v2
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-
#
# - name: install python 3.7
# uses: actions/setup-python@v2
# with:
# python-version: '3.7'
# architecture: 'x64'
#
# - name: cache python dependencies
# uses: actions/cache@v2
# id: cache-pip
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
#
# - name: checkout python scripts
# uses: actions/checkout@v2
# with:
# fetch-depth: 2
#
# - name: install python dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r ./requirements.txt
#
# - name: deploy hugegraph
# run: |
# sed -i -e "s/^is_auth.*$/is_auth = True/g" src/config/basic_config.py
# sed -i -e "s/^admin_password.*$/admin_password = {'admin': '123456'}/g" src/config/basic_config.py
# sed -i -e "s/^test_password.*$/test_password = {'tester': '123456'}/g" src/config/basic_config.py
# python src/deploy_start.py all
#
#
# - name: decompress dataset.zip
# run: |
# unzip src/config/dataset.zip
# mv dataset src/config/
#
# - name: run test cases
# run: |
# pytest --html=test.html --capture=tee-sys
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# hugegraph-test

CI testing is carried out through this project for hugegraph

```
cd hugegraph-test

pip install -r requirements.txt

cd src
python deploy_start.py all

pytest
```
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
attrs==20.3.0
certifi==2020.12.5
cffi==1.16.0
chardet==4.0.0
cryptography==41.0.5
idna==2.10
importlib-metadata==3.7.3
iniconfig==1.1.1
packaging==20.9
pluggy==0.13.1
py==1.10.0
pycparser==2.21
pyOpenSSL==22.0.0
pyparsing==2.4.7
pytest==6.2.2
pytest==6.2.5
pytest-html==3.1.1
pytest-metadata==1.11.0
requests==2.25.1
Expand Down
68 changes: 50 additions & 18 deletions src/common/deploy_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from src.common.file_basic import is_match_re
from src.common.file_basic import is_exists_path
from src.common.file_basic import alter_properties
from src.config import basic_config as _cfg


def get_code(pwd, git_obj, code_dir):
Expand All @@ -26,11 +27,11 @@ def get_code(pwd, git_obj, code_dir):
url = git_obj['url']
if not is_match_re(pwd, code_dir):
clone_cmd = 'cd %s && git clone %s && cd %s && git checkout %s' % (pwd, url, code_dir, branch)
print('clone code: ' + clone_cmd)
print('clone code cmd: ' + clone_cmd)
os.system(clone_cmd)
else:
pull_cmd = 'cd %s/%s && git checkout %s && git pull' % (pwd, code_dir, branch)
print('pull code: ' + pull_cmd)
print('pull code cmd: ' + pull_cmd)
os.system(pull_cmd)


Expand All @@ -53,7 +54,7 @@ def compile_package(dir_code_path):
print(cmd)
os.system(cmd)
else:
cmd = 'cd %s && mvn clean package -Dmaven.test.skip=true -q | grep \"tar.gz\"' % dir_code_path
cmd = 'cd %s && mvn clean package -P stage -DskipTests -ntp' % dir_code_path
print(cmd)
os.system(cmd)

Expand All @@ -80,6 +81,19 @@ def set_server_properties(package_dir_path, host, server_port, gremlin_port):
'#port: 8182',
'port: %d' % gremlin_port)

if _cfg.is_auth is True:
graph_conf = package_dir_path + f'/conf/graphs/{_cfg.graph_name}.properties'
alter_properties(graph_conf,
'gremlin.graph=org.apache.hugegraph.HugeFactory'
'gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy')

alter_properties(rest_conf,
'#auth.authenticator=',
'auth.authenticator=org.apache.hugegraph.auth.ConfigAuthenticator')

# alter_properties(gremlin_conf,
# )


def set_hubble_properties(package_dir_path, host, port):
"""
Expand Down Expand Up @@ -126,23 +140,41 @@ def __init__(self, obj):
self.hubble_git = obj.hubble_git

@staticmethod
def server(self):
def server(conf):
"""
:return:
"""
code_dir = 'hugegraph'
code_dir_path = self.code_path + '/' + code_dir
re_dir = '^%s-(\d).(\d{1,2}).(\d)$' % code_dir

is_exists_path(self.code_path)
get_code(self.code_path, self.server_git, code_dir)
code_dir = 'incubator-hugegraph'
server_module = 'hugegraph-server'
build_dir_prefix = 'apache-hugegraph-incubating'
code_dir_path = os.path.join(conf.code_path, code_dir)
server_module_path = os.path.join(code_dir_path, server_module)
re_dir = '^%s-(\d).(\d{1,2}).(\d)$' % build_dir_prefix

is_exists_path(conf.code_path)
get_code(conf.code_path, conf.server_git, code_dir)
compile_package(code_dir_path)
# start graph_server
package_dir_name = is_match_re(code_dir_path, re_dir)
package_dir_path = code_dir_path + '/' + package_dir_name
set_server_properties(package_dir_path, self.graph_host, self.server_port, self.gremlin_port)
# start graph_server
package_dir_name = is_match_re(server_module_path, re_dir)
package_dir_path = os.path.join(server_module_path, package_dir_name)
set_server_properties(package_dir_path, conf.graph_host, conf.server_port, conf.gremlin_port)
start_graph(package_dir_path, 'server')

@staticmethod
def toolchain(conf):
code_dir = 'incubator-hugegraph-toolchain'
code_dir_path = os.path.join(conf.code_path, code_dir)
is_exists_path(conf.code_path)
get_code(conf.code_path, conf.toolchain_git, code_dir)
compile_package(code_dir_path)

# set properties && start hubble
hubble_package_dir_name = os.path.join(code_dir_path,
'apache-hugegraph-toolchain-incubating-1.0.0',
'apache-hugegraph-hubble-incubating-1.0.0')
# set_hubble_properties(hubble_package_dir_name, conf.graph_host, conf.hubble_port)
start_graph(hubble_package_dir_name, 'hubble')

@staticmethod
def hubble(self):
liuxiaocs7 marked this conversation as resolved.
Show resolved Hide resolved
"""
Expand All @@ -169,14 +201,14 @@ def hubble(self):
start_graph(package_dir_path, 'hubble')

@staticmethod
def loader(self):
def loader(conf):
"""
:return:
"""
code_dir = 'hugegraph-loader'
code_dir_path = self.code_path + '/' + code_dir
is_exists_path(self.code_path)
get_code(self.code_path, self.loader_git, code_dir)
code_dir_path = conf.code_path + '/' + code_dir
is_exists_path(conf.code_path)
get_code(conf.code_path, conf.loader_git, code_dir)
compile_package(code_dir_path)

@staticmethod
Expand Down
3 changes: 1 addition & 2 deletions src/common/file_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
import re
import os
import shutil


def alter_properties(file, old_str, new_str):
Expand Down Expand Up @@ -34,8 +35,6 @@ def is_match_re(dir_path, re_rule):
if match_obj is not None:
res = name
break
else:
continue
return res


Expand Down
4 changes: 2 additions & 2 deletions src/common/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from src.common.file_basic import is_match_re
from src.config import basic_config as _cfg

loader_name = is_match_re(_cfg.code_path + '/hugegraph-loader', "^hugegraph-loader-(\d).(\d{1,2}).(\d)$")
loader_path = _cfg.code_path + '/hugegraph-loader' + '/' + loader_name
loader_name = is_match_re(_cfg.code_path + '/incubator-hugegraph-toolchain/apache-hugegraph-toolchain-incubating-1.0.0', "^apache-hugegraph-loader-incubating-(\d).(\d{1,2}).(\d)$")
loader_path = _cfg.code_path + '/incubator-hugegraph-toolchain/apache-hugegraph-toolchain-incubating-1.0.0' + '/' + loader_name
dataset_path = root_path + 'src/config/dataset/'


Expand Down
Loading
Loading