Skip to content

Commit 4c10945

Browse files
Merge branch 'master' into test_delegation_2
2 parents 18b89de + 383e27b commit 4c10945

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+429
-381
lines changed

cardano_node_tests/cluster_management/cluster_getter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def instance_dir(self) -> pl.Path:
116116
def ports(self) -> cardonnay_local.InstancePorts:
117117
"""Return port mappings for current cluster instance."""
118118
return cluster_nodes.get_cluster_type().cluster_scripts.get_instance_ports(
119-
self.cluster_instance_num
119+
instance_num=self.cluster_instance_num
120120
)
121121

122122
def _create_startup_files_dir(self, instance_num: int) -> pl.Path:
@@ -935,7 +935,7 @@ def get_cluster_instance( # noqa: C901
935935
self.log(f"c{instance_num}: can run test '{cget_status.current_test}'")
936936
# Set environment variables that are needed when respinning the cluster
937937
# and running tests
938-
cluster_nodes.set_cluster_env(instance_num)
938+
cluster_nodes.set_cluster_env(instance_num=instance_num)
939939

940940
# Remove "prio" status file
941941
if prio:

cardano_node_tests/cluster_management/netstat_tools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def _get_proc_cmdline(pid: int) -> str:
6262

6363
return cmdline
6464

65-
port_nums = cluster_nodes.get_cluster_type().cluster_scripts.get_instance_ports(instance_num)
65+
port_nums = cluster_nodes.get_cluster_type().cluster_scripts.get_instance_ports(
66+
instance_num=instance_num
67+
)
6668
port_strs = [
6769
# Add whitestpace to the end of each port number to avoid matching a port number that is a
6870
# prefix of another port number.

cardano_node_tests/testnet_cleanup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def main() -> int:
5353
if not socket_env:
5454
LOGGER.error("The `CARDANO_NODE_SOCKET_PATH` environment variable is not set.")
5555
return 1
56-
if bool(args.address) ^ bool(args.skey_file):
56+
if bool(args.address) != bool(args.skey_file):
5757
LOGGER.error(
5858
"Both address and skey file must be provided, or neither of them should be provided."
5959
)

cardano_node_tests/tests/delegation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def cluster_and_pool(
9797
if pool_id in stake_pools:
9898
return cluster_obj, pool_id
9999

100-
blocks_before = clusterlib_utils.get_blocks_before(cluster_obj)
100+
blocks_before = clusterlib_utils.get_blocks_before(cluster_obj=cluster_obj)
101101
# Sort pools by how many blocks they produce
102102
pool_ids_s = sorted(blocks_before, key=blocks_before.get, reverse=True) # type: ignore
103103
# Select a pool with reasonable margin

cardano_node_tests/tests/kes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def check_kes_period_info_result( # noqa: C901
8282
KesScenarios.INVALID_COUNTERS,
8383
):
8484
instance_ports = cluster_nodes.get_cluster_type().cluster_scripts.get_instance_ports(
85-
cluster_nodes.get_instance_num()
85+
instance_num=cluster_nodes.get_instance_num()
8686
)
8787
prometheus_port = instance_ports.node_ports[pool_num].prometheus
8888
response = http_client.get_session().get(

cardano_node_tests/tests/test_dbsync_config.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,28 @@ def check_dbsync_state(
7373
f"Invalid column condition format: {condition}"
7474
)
7575
column_condition = condition.value.split(":", 1)[1]
76-
dbsync_utils.check_column_condition(table, column, column_condition)
76+
dbsync_utils.check_column_condition(
77+
table=table, column=column, condition=column_condition
78+
)
7779
else: # Table-level check
7880
assert isinstance(condition, TableCondition), (
7981
f"Invalid table condition format: {condition}"
8082
)
8183
match condition:
8284
case TableCondition.EMPTY:
83-
assert dbsync_utils.table_empty(key), (
85+
assert dbsync_utils.table_empty(table=key), (
8486
f"Expected {key} to be empty, but it is not."
8587
)
8688
case TableCondition.NOT_EMPTY:
87-
assert not dbsync_utils.table_empty(key), (
89+
assert not dbsync_utils.table_empty(table=key), (
8890
f"Expected {key} to have data, but it is empty."
8991
)
9092
case TableCondition.EXISTS:
91-
assert dbsync_utils.table_exists(key), (
93+
assert dbsync_utils.table_exists(table=key), (
9294
f"Expected {key} to exist, but it does not."
9395
)
9496
case TableCondition.NOT_EXISTS:
95-
assert not dbsync_utils.table_exists(key), (
97+
assert not dbsync_utils.table_exists(table=key), (
9698
f"Expected {key} to NOT exist, but it does."
9799
)
98100
case _:

cardano_node_tests/tests/test_kes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def cluster_kes(
8282

8383
def _save_metrics(pool_num: int, temp_template: str) -> None:
8484
instance_ports = cluster_nodes.get_cluster_type().cluster_scripts.get_instance_ports(
85-
cluster_nodes.get_instance_num()
85+
instance_num=cluster_nodes.get_instance_num()
8686
)
8787
port = instance_ports.node_ports[pool_num].prometheus
8888

cardano_node_tests/tests/test_metrics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_available_metrics(
110110
"""Test that list of available metrics == list of expected metrics."""
111111
prometheus_port = (
112112
cluster_nodes.get_cluster_type()
113-
.cluster_scripts.get_instance_ports(cluster_nodes.get_instance_num())
113+
.cluster_scripts.get_instance_ports(instance_num=cluster_nodes.get_instance_num())
114114
.prometheus_pool1
115115
)
116116

@@ -133,9 +133,9 @@ def test_available_metrics(
133133
"""Test that available EKG metrics matches the expected schema."""
134134
ekg_port = (
135135
cluster_nodes.get_cluster_type()
136-
.cluster_scripts.get_instance_ports(cluster_nodes.get_instance_num())
136+
.cluster_scripts.get_instance_ports(instance_num=cluster_nodes.get_instance_num())
137137
.ekg_pool1
138138
)
139139

140140
response = get_ekg_metrics(ekg_port)
141-
model_ekg.Model.validate(response.json())
141+
model_ekg.Model.model_validate(response.json())

cardano_node_tests/tests/test_pools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2627,7 +2627,7 @@ def pools(
26272627
cluster_obj=cluster,
26282628
name_template=f"{temp_template}_delegate_reward_addrs",
26292629
src_address=pool_owners[0].payment.address,
2630-
use_build_cmd=True,
2630+
build_method=clusterlib_utils.BuildMethods.BUILD,
26312631
tx_files=tx_files,
26322632
deposit=deposit_address_amt,
26332633
)

cardano_node_tests/tests/test_reconnect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def test_metrics_reconnect(
242242

243243
prometheus_port = (
244244
cluster_nodes.get_cluster_type()
245-
.cluster_scripts.get_instance_ports(cluster_nodes.get_instance_num())
245+
.cluster_scripts.get_instance_ports(instance_num=cluster_nodes.get_instance_num())
246246
.prometheus_pool2
247247
)
248248

0 commit comments

Comments
 (0)