Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix governance tests when running on long running testnets #2781

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions cardano_node_tests/tests/tests_conway/test_committee.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ class TestCommittee:
@pytest.mark.smoke
def test_register_hot_key_no_cc_member(
self,
cluster_use_committee: governance_utils.GovClusterT,
payment_addr_comm: clusterlib.AddressRecord,
cluster: clusterlib.ClusterLib,
pool_user: clusterlib.PoolUser,
use_build_cmd: bool,
submit_method: str,
):
"""Try to submit a Hot Credential Authorization certificate without being a CC member.

Expect failure.
"""
cluster, __ = cluster_use_committee
temp_template = common.get_test_id(cluster)

cc_auth_record = governance_utils.get_cc_member_auth_record(
Expand All @@ -124,15 +123,15 @@ def test_register_hot_key_no_cc_member(

tx_files_auth = clusterlib.TxFiles(
certificate_files=[cc_auth_record.auth_cert],
signing_key_files=[payment_addr_comm.skey_file, cc_auth_record.cold_key_pair.skey_file],
signing_key_files=[pool_user.payment.skey_file, cc_auth_record.cold_key_pair.skey_file],
)

# Try to submit a Hot Credential Authorization certificate without being a CC member
with pytest.raises((clusterlib.CLIError, submit_api.SubmitApiError)) as excinfo:
clusterlib_utils.build_and_submit_tx(
cluster_obj=cluster,
name_template=f"{temp_template}_auth",
src_address=payment_addr_comm.address,
src_address=pool_user.payment.address,
submit_method=submit_method,
use_build_cmd=use_build_cmd,
tx_files=tx_files_auth,
Expand Down
1 change: 0 additions & 1 deletion cardano_node_tests/tests/tests_conway/test_guardrails.py
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,6 @@ def cost_models(cluster_with_constitution: ClusterWithConstitutionRecord):
class TestGovernanceGuardrails:
@allure.link(helpers.get_vcs_link())
@pytest.mark.long
@pytest.mark.testnets
def test_guardrails(
self,
cluster_with_constitution: ClusterWithConstitutionRecord,
Expand Down
5 changes: 5 additions & 0 deletions cardano_node_tests/utils/governance_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ def get_default_governance(
cluster_manager: cluster_management.ClusterManager,
cluster_obj: clusterlib.ClusterLib,
) -> governance_utils.GovernanceRecords:
"""Get default governance data for CC members, DReps and SPOs."""
if cluster_nodes.get_cluster_type().type == cluster_nodes.ClusterType.TESTNET:
err = "Default governance is not available on testnets"
raise ValueError(err)

cluster_env = cluster_nodes.get_cluster_env()
gov_data_dir = cluster_env.state_dir / GOV_DATA_DIR
gov_data_store = gov_data_dir / GOV_DATA_STORE
Expand Down
Loading