Skip to content

Commit d86bce6

Browse files
authored
Merge pull request #2781 from IntersectMBO/gov_testnet_tests
Fix governance tests when running on long running testnets
2 parents 145113e + 0f93c64 commit d86bce6

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

cardano_node_tests/tests/tests_conway/test_committee.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,15 @@ class TestCommittee:
105105
@pytest.mark.smoke
106106
def test_register_hot_key_no_cc_member(
107107
self,
108-
cluster_use_committee: governance_utils.GovClusterT,
109-
payment_addr_comm: clusterlib.AddressRecord,
108+
cluster: clusterlib.ClusterLib,
109+
pool_user: clusterlib.PoolUser,
110110
use_build_cmd: bool,
111111
submit_method: str,
112112
):
113113
"""Try to submit a Hot Credential Authorization certificate without being a CC member.
114114
115115
Expect failure.
116116
"""
117-
cluster, __ = cluster_use_committee
118117
temp_template = common.get_test_id(cluster)
119118

120119
cc_auth_record = governance_utils.get_cc_member_auth_record(
@@ -124,15 +123,15 @@ def test_register_hot_key_no_cc_member(
124123

125124
tx_files_auth = clusterlib.TxFiles(
126125
certificate_files=[cc_auth_record.auth_cert],
127-
signing_key_files=[payment_addr_comm.skey_file, cc_auth_record.cold_key_pair.skey_file],
126+
signing_key_files=[pool_user.payment.skey_file, cc_auth_record.cold_key_pair.skey_file],
128127
)
129128

130129
# Try to submit a Hot Credential Authorization certificate without being a CC member
131130
with pytest.raises((clusterlib.CLIError, submit_api.SubmitApiError)) as excinfo:
132131
clusterlib_utils.build_and_submit_tx(
133132
cluster_obj=cluster,
134133
name_template=f"{temp_template}_auth",
135-
src_address=payment_addr_comm.address,
134+
src_address=pool_user.payment.address,
136135
submit_method=submit_method,
137136
use_build_cmd=use_build_cmd,
138137
tx_files=tx_files_auth,

cardano_node_tests/tests/tests_conway/test_guardrails.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,6 @@ def cost_models(cluster_with_constitution: ClusterWithConstitutionRecord):
15671567
class TestGovernanceGuardrails:
15681568
@allure.link(helpers.get_vcs_link())
15691569
@pytest.mark.long
1570-
@pytest.mark.testnets
15711570
def test_guardrails(
15721571
self,
15731572
cluster_with_constitution: ClusterWithConstitutionRecord,

cardano_node_tests/utils/governance_setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ def get_default_governance(
250250
cluster_manager: cluster_management.ClusterManager,
251251
cluster_obj: clusterlib.ClusterLib,
252252
) -> governance_utils.GovernanceRecords:
253+
"""Get default governance data for CC members, DReps and SPOs."""
254+
if cluster_nodes.get_cluster_type().type == cluster_nodes.ClusterType.TESTNET:
255+
err = "Default governance is not available on testnets"
256+
raise ValueError(err)
257+
253258
cluster_env = cluster_nodes.get_cluster_env()
254259
gov_data_dir = cluster_env.state_dir / GOV_DATA_DIR
255260
gov_data_store = gov_data_dir / GOV_DATA_STORE

0 commit comments

Comments
 (0)