Skip to content

Commit

Permalink
Ldbc test cases. (#3537)
Browse files Browse the repository at this point in the history
* Add ldbc test/

* Add all cases.

* Fix some test cases.

* Fix ldbc cases.

* Fix pytest.

Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
  • Loading branch information
2 people authored and Sophie-Xie committed Jan 15, 2022
1 parent 6039368 commit 4cf260b
Show file tree
Hide file tree
Showing 10 changed files with 1,107 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ jobs:
make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} tck
working-directory: tests/
timeout-minutes: 60
- name: LDBC
run: |
make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} ldbc
working-directory: tests/
timeout-minutes: 60
- name: Down cluster
run: |
make RM_DIR=false down
Expand Down
7 changes: 5 additions & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This source code is licensed under Apache 2.0 License.

.PHONY: fmt check check-and-diff init init-all clean test tck fail up down test-all
.PHONY: fmt check check-and-diff init init-all clean test tck fail up down test-all ldbc

PYPI_MIRROR = https://mirrors.aliyun.com/pypi/simple/
# PYPI_MIRROR = http://pypi.mirrors.ustc.edu.cn/simple --trusted-host pypi.mirrors.ustc.edu.cn
Expand Down Expand Up @@ -95,7 +95,10 @@ slow-query: currdir
tck: jobs slow-query
$(test_j) tck/steps/test_tck.py

test-all: test tck
ldbc: currdir
$(test_j) tck/steps/test_ldbc.py

test-all: test tck ldbc

fail: currdir
python3 -m pytest \
Expand Down
5 changes: 3 additions & 2 deletions tests/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,9 @@ def load_csv_data(
# wait heartbeat_interval_secs + 1 seconds for schema synchronization
time.sleep(2)

for fd in config["files"]:
_load_data_from_file(sess, data_dir, fd)
if config["files"] is not None:
for fd in config["files"]:
_load_data_from_file(sess, data_dir, fd)

return space_desc

Expand Down
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ def load_nba_int_vid_data():
yield load_csv_data_once("nba_int_vid")


@pytest.fixture(scope="session")
def load_ldbc_v0_3_3():
yield load_csv_data_once("ldbc_v0_3_3")


@pytest.fixture(scope="session")
def load_student_data():
yield load_csv_data_once("student")
Expand Down
41 changes: 41 additions & 0 deletions tests/data/ldbc_v0_3_3/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
space:
name: ldbc_v0_3_3
partitionNum: 8
replicaFactor: 1
vidType: FIXED_STRING(32)
charset: utf8
collate: utf8_bin
schema: |
CREATE TAG IF NOT EXISTS `Place`(`name` string,`url` string,`type` string);
CREATE TAG IF NOT EXISTS `City`(`name` string,`url` string,`type` string);
CREATE TAG IF NOT EXISTS `Country`(`name` string,`url` string,`type` string);
CREATE TAG IF NOT EXISTS `Continent`(`name` string,`url` string,`type` string);
CREATE TAG IF NOT EXISTS `Message`(`creationDate` string,`locationIP` string,`browserUsed` string,`content` string,`length` int);
CREATE TAG IF NOT EXISTS `Comment`(`creationDate` string,`locationIP` string,`browserUsed` string,`content` string,`length` int);
CREATE TAG IF NOT EXISTS `Post`(`imageFile` string,`creationDate` string,`locationIP` string,`browserUsed` string,`language` string,`content` string,`length` int);
CREATE TAG IF NOT EXISTS `Organisation`(`type` string,`name` string,`url` string);
CREATE TAG IF NOT EXISTS `University`(`type` string,`name` string,`url` string);
CREATE TAG IF NOT EXISTS `Company`(`type` string,`name` string,`url` string);
CREATE TAG IF NOT EXISTS `Person`(`firstName` string,`lastName` string,`gender` string,`birthday` string,`creationDate` string,`locationIP` string,`browserUsed` string, `email` string, `speaks` string);
CREATE TAG IF NOT EXISTS `TagClass`(`name` string,`url` string);
CREATE TAG IF NOT EXISTS `Forum`(`title` string,`creationDate` string);
CREATE TAG IF NOT EXISTS `Tag`(`name` string,`url` string);
CREATE EDGE IF NOT EXISTS `IS_PART_OF`();
CREATE EDGE IF NOT EXISTS `LIKES`(`creationDate` string);
CREATE EDGE IF NOT EXISTS `HAS_CREATOR`();
CREATE EDGE IF NOT EXISTS `HAS_INTEREST`();
CREATE EDGE IF NOT EXISTS `IS_SUBCLASS_OF`();
CREATE EDGE IF NOT EXISTS `IS_LOCATED_IN`();
CREATE EDGE IF NOT EXISTS `HAS_MODERATOR`();
CREATE EDGE IF NOT EXISTS `HAS_TAG`();
CREATE EDGE IF NOT EXISTS `WORK_AT`(`workFrom` int);
CREATE EDGE IF NOT EXISTS `REPLY_OF`();
CREATE EDGE IF NOT EXISTS `STUDY_AT`(`classYear` int);
CREATE EDGE IF NOT EXISTS `CONTAINER_OF`();
CREATE EDGE IF NOT EXISTS `HAS_MEMBER`(`joinDate` string);
CREATE EDGE IF NOT EXISTS `KNOWS`(`creationDate` string);
CREATE EDGE IF NOT EXISTS `HAS_TYPE`();
CREATE TAG INDEX message_create_date ON `Message`(`creationDate`(20));
CREATE TAG INDEX person_first_name ON `Person`(`firstName`(20));
files:

3 changes: 3 additions & 0 deletions tests/tck/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def preload_space(
load_nba_data,
load_nba_int_vid_data,
load_student_data,
load_ldbc_v0_3_3,
session,
graph_spaces,
):
Expand All @@ -185,6 +186,8 @@ def preload_space(
graph_spaces["space_desc"] = load_nba_int_vid_data
elif space == "student":
graph_spaces["space_desc"] = load_student_data
elif space == "ldbc_v0_3_3":
graph_spaces["ldbc_v0_3_3"] = load_ldbc_v0_3_3
else:
raise ValueError(f"Invalid space name given: {space}")
resp_ok(session, f'USE {space};', True)
Expand Down
Loading

0 comments on commit 4cf260b

Please sign in to comment.