From 8db0dc5402e5d2b5de6fe181b5d6ac4178aab54c Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 11 Jul 2024 14:59:18 +0200 Subject: [PATCH] Move the least important checks to the end of test --- .../tests/tests_conway/test_info.py | 34 +++++++++---------- .../tests/tests_conway/test_pparam_update.py | 12 +++---- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cardano_node_tests/tests/tests_conway/test_info.py b/cardano_node_tests/tests/tests_conway/test_info.py index 78fa1854a..10c0fd3dc 100644 --- a/cardano_node_tests/tests/tests_conway/test_info.py +++ b/cardano_node_tests/tests/tests_conway/test_info.py @@ -233,23 +233,6 @@ def test_info( ], "Ratification is delayed unexpectedly" reqc.cip038_05.success() - # Check action view - governance_utils.check_action_view(cluster_obj=cluster, action_data=info_action) - - # Check vote view - reqc.cli022.start(url=helpers.get_vcs_link()) - if votes_cc: - governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_cc[0]) - governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_drep[0]) - governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_spo[0]) - reqc.cli022.success() - - # Check dbsync - dbsync_utils.check_votes( - votes=governance_utils.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo), - txhash=vote_txid, - ) - # Check deposit is returned reqc.cip034ex.start(url=helpers.get_vcs_link()) @@ -267,3 +250,20 @@ def test_info( deposit_returned == init_return_account_balance + action_deposit_amt ), "Incorrect return account balance" reqc.cip034ex.success() + + # Check action view + governance_utils.check_action_view(cluster_obj=cluster, action_data=info_action) + + # Check vote view + reqc.cli022.start(url=helpers.get_vcs_link()) + if votes_cc: + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_cc[0]) + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_drep[0]) + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_spo[0]) + reqc.cli022.success() + + # Check dbsync + dbsync_utils.check_votes( + votes=governance_utils.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo), + txhash=vote_txid, + ) diff --git a/cardano_node_tests/tests/tests_conway/test_pparam_update.py b/cardano_node_tests/tests/tests_conway/test_pparam_update.py index 501dd3276..df91299e3 100644 --- a/cardano_node_tests/tests/tests_conway/test_pparam_update.py +++ b/cardano_node_tests/tests/tests_conway/test_pparam_update.py @@ -1249,12 +1249,6 @@ def _check_state(state: dict): err_str = str(excinfo.value) assert "(GovActionsDoNotExist" in err_str, err_str - # Check vote view - if fin_voted_votes.cc: - governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.cc[0]) - if fin_voted_votes.drep: - governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.drep[0]) - # Check deposit return for both after enactment and expiration _url = helpers.get_vcs_link() [r.start(url=_url) for r in (reqc.cip034ex, reqc.cip034en)] @@ -1276,6 +1270,12 @@ def _check_state(state: dict): ), "Incorrect return account balance" [r.success() for r in (reqc.cip034ex, reqc.cip034en)] + # Check vote view + if fin_voted_votes.cc: + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.cc[0]) + if fin_voted_votes.drep: + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.drep[0]) + if db_errors_final: raise AssertionError("\n".join(db_errors_final)) [r.success() for r in (reqc.cip080, reqc.cip081, reqc.cip082, reqc.cip083)]