diff --git a/tests/mgbench/benchmark.py b/tests/mgbench/benchmark.py index 6e4193ffc..d8d7e002c 100755 --- a/tests/mgbench/benchmark.py +++ b/tests/mgbench/benchmark.py @@ -108,7 +108,12 @@ parser.add_argument("--no-properties-on-edges", action="store_true", help="disab parser.add_argument("--bolt-port", default=7687, help="memgraph bolt port") -parser.add_argument("--datasets-path", default="datasets", help="path to datasets to scan") +parser.add_argument( + "--datasets-path", + default="datasets", + help="path to a single Python file where additional datasets are located" + "NOTE: give the file unique name compared to the core module names", +) parser.add_argument("--test-system-args", default="") parser.add_argument( diff --git a/tests/mgbench/datasets.py b/tests/mgbench/datasets.py index f3a4b6f3c..ebcd84969 100644 --- a/tests/mgbench/datasets.py +++ b/tests/mgbench/datasets.py @@ -574,3 +574,25 @@ class AccessControl(Dataset): {}, ) return query + + +class TestDataset(Dataset): + NAME = "test" + VARIANTS = ["small"] + DEFAULT_VARIANT = "small" + # TODO(gitbuda): ~/Downloads/ doesn't work for some reason, fix! :) + # TODO(gitbuda): If ~ is wrong, client fails just with SIGABRT -> hard to figure out -> enable more details from client. + FILES = { + "small": "/home/buda/Downloads/mgbench/test_dataset_small.cypherl", + } + SIZES = { + "small": {"vertices": 10, "edges": 9}, + } + # TODO(gitbuda): What's the purpose of the INDEX inside the Dataset? + # TODO(gitbuda): It's not possible to also inject local index file, it's much easier to add your local file compare to uploading it somewhere or running local HTTP server (easy with e.g. python, but...) + INDEX_FILES = { + "memgraph": "http://localhost:8080/test_dataset_index.cypherl", + } + + def benchmark__basic__test(self): + return ("MATCH (n:Label {id: 0})-[*]->(m) RETURN n, m;", {}) diff --git a/tests/mgbench/helpers.py b/tests/mgbench/helpers.py index b46e51db4..0aab02f70 100644 --- a/tests/mgbench/helpers.py +++ b/tests/mgbench/helpers.py @@ -27,7 +27,7 @@ def get_binary_path(path, base=""): def download_file(url, path): - if "https://" in url: + if "http://" in url or "https://" in url: ret = subprocess.run( ["wget", "-nv", "--content-disposition", url], stderr=subprocess.PIPE, cwd=path, check=True ) diff --git a/tests/mgbench/runners.py b/tests/mgbench/runners.py index 97b5e6e6d..78cefc8df 100644 --- a/tests/mgbench/runners.py +++ b/tests/mgbench/runners.py @@ -115,6 +115,8 @@ class Memgraph: self._proc_mg = None raise Exception("The database process died prematurely!") wait_for_server(7687) + # TODO(gitbuda): Add better logging + print("Memgraph is running...") ret = self._proc_mg.poll() assert ret is None, "The database process died prematurely " "({})!".format(ret)