Try to add simplest mgbench dataset (#746)
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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;", {})
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user