diff --git a/tests/mgbench/benchmark.py b/tests/mgbench/benchmark.py index 190dac0be..89e677573 100755 --- a/tests/mgbench/benchmark.py +++ b/tests/mgbench/benchmark.py @@ -106,6 +106,8 @@ parser.add_argument( ) parser.add_argument("--no-properties-on-edges", action="store_true", help="disable properties on edges") +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("--test-system-args", default="") @@ -569,7 +571,7 @@ for dataset, queries in benchmarks: args.test_system_args, ) - client = runners.Client(args.client_binary, args.temporary_directory) + client = runners.Client(args.client_binary, args.temporary_directory, args.bolt_port) ret = None usage = None diff --git a/tests/mgbench/datasets.py b/tests/mgbench/datasets.py index 8f1a450ab..f3a4b6f3c 100644 --- a/tests/mgbench/datasets.py +++ b/tests/mgbench/datasets.py @@ -24,6 +24,7 @@ class Dataset: # One of the available variants that should be used as the default variant. DEFAULT_VARIANT = "default" # List of query files that should be used to import the dataset. + DEFAULT_VENDOR = "memgraph" FILES = { "default": "/foo/bar", } @@ -51,6 +52,8 @@ class Dataset: raise ValueError("The variant doesn't have a defined URL or " "file path!") if variant not in self.SIZES: raise ValueError("The variant doesn't have a defined dataset " "size!") + if vendor is None: + vendor = self.DEFAULT_VENDOR if vendor not in self.INDEX_FILES: raise ValueError("Vendor does not have INDEX for dataset!") self._variant = variant @@ -480,6 +483,11 @@ class AccessControl(Dataset): "medium": "https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/dataset/accesscontrol/accesscontrol_medium.setup.cypher.gz", "large": "https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/dataset/accesscontrol/accesscontrol_large.setup.cypher.gz", } + + INDEX_FILES = { + "memgraph": "https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/dataset/accesscontrol/accesscontrol_empty_only_index.setup.cypher.gz", + } + SIZES = { "empty_only_index": { "vertices": 0, @@ -528,7 +536,7 @@ class AccessControl(Dataset): random_value = random.randint(first_uuid, last_uuid) return random_value - def __init__(self, variant=None): + def __init__(self, variant=None, vendor=None): super().__init__(variant) self.next_value_idx = self.get_size()["vertices"] + 1 diff --git a/tests/mgbench/runners.py b/tests/mgbench/runners.py index 9d2491547..97b5e6e6d 100644 --- a/tests/mgbench/runners.py +++ b/tests/mgbench/runners.py @@ -371,9 +371,12 @@ class Neo4j: class Client: - def __init__(self, client_binary, temporary_directory): + def __init__(self, client_binary, temporary_directory, bolt_port: int, username: str = "", password: str = ""): self._client_binary = client_binary self._directory = tempfile.TemporaryDirectory(dir=temporary_directory) + self._username = username + self._password = password + self._bolt_port = bolt_port def _get_args(self, **kwargs): return _convert_args_to_flags(self._client_binary, **kwargs)