From c6615df52f632fdd6b709394e3985032fa4a9252 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Tue, 31 Mar 2026 17:29:45 +0200 Subject: [PATCH] refactor(issues): migrate repeated certificates issue to ledger repo and update handling - Change the `api_484` blocker to `ledger_4566` blocker for the same issue in `cardano-ledger` - Update test logic in `test_addr_registration.py` to reference `ledger_4566` instead of `api_484` - Enhance `GH.finish_test()` to support forced xfail via `force_blocked` parameter for cases where the issue will not be fixed in certain node version, but rather in next era. --- cardano_node_tests/tests/issues.py | 11 +++++------ .../tests/test_addr_registration.py | 16 ++++++++++++---- cardano_node_tests/utils/blockers.py | 4 ++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index 21844580b..3ed764ab0 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -5,12 +5,6 @@ repo="IntersectMBO/cardano-api", message="Broken `nextEpochEligibleLeadershipSlots`.", ) -api_484 = blockers.GH( - issue=484, - repo="IntersectMBO/cardano-api", - fixed_in="10.7.0", # Unknown yet, will be fixed/changed sometime in the future - message="Repeated certificates stripped from Conway transaction.", -) api_829 = blockers.GH( issue=829, repo="IntersectMBO/cardano-api", @@ -191,6 +185,11 @@ fixed_in="8.12.0", # Unknown yet, will be fixed/changed sometime in the future message="Inconsistent listing of DRep expiry.", ) +ledger_4566 = blockers.GH( + issue=4566, + repo="IntersectMBO/cardano-ledger", + message="Repeated certificates stripped from Conway transaction.", +) ledger_4772 = blockers.GH( issue=4772, repo="IntersectMBO/cardano-ledger", diff --git a/cardano_node_tests/tests/test_addr_registration.py b/cardano_node_tests/tests/test_addr_registration.py index d19ac346d..a6c1db506 100644 --- a/cardano_node_tests/tests/test_addr_registration.py +++ b/cardano_node_tests/tests/test_addr_registration.py @@ -311,8 +311,12 @@ def test_addr_registration_certificate_order( ) except (clusterlib.CLIError, submit_api.SubmitApiError) as exc: str_exc = str(exc) - if "(ValueNotConservedUTxO" in str_exc and VERSIONS.transaction_era >= VERSIONS.CONWAY: - issues.api_484.finish_test() + if "(ValueNotConservedUTxO" in str_exc: + if VERSIONS.transaction_era == VERSIONS.CONWAY: + # The ledger issue 4566 will not be fixed in Conway + issues.ledger_4566.finish_test(force_blocked=True) + if VERSIONS.transaction_era > VERSIONS.CONWAY: + issues.ledger_4566.finish_test() if build_method == clusterlib_utils.BuildMethods.BUILD_EST and ( "The transaction balance is negative" in str_exc or "does not balance in its use of assets" in str_exc @@ -322,8 +326,12 @@ def test_addr_registration_certificate_order( # Check that the stake address is registered stake_addr_info = cluster.g_query.get_stake_addr_info(user_registered.stake.address) - if not stake_addr_info and VERSIONS.transaction_era >= VERSIONS.CONWAY: - issues.api_484.finish_test() + if not stake_addr_info: + if VERSIONS.transaction_era == VERSIONS.CONWAY: + # The ledger issue 4566 will not be fixed in Conway + issues.ledger_4566.finish_test(force_blocked=True) + if VERSIONS.transaction_era > VERSIONS.CONWAY: + issues.ledger_4566.finish_test() assert stake_addr_info, f"Stake address is not registered: {user_registered.stake.address}" # Check that the balance for source address was correctly updated and that key deposit diff --git a/cardano_node_tests/utils/blockers.py b/cardano_node_tests/utils/blockers.py index 11d2e4c4a..f7f14764f 100644 --- a/cardano_node_tests/utils/blockers.py +++ b/cardano_node_tests/utils/blockers.py @@ -82,12 +82,12 @@ def _issue_is_blocked(self) -> bool: """Check if an issue is blocked.""" return self._issue_blocked_in_version(VERSIONS.node) - def finish_test(self) -> None: + def finish_test(self, force_blocked: bool = False) -> None: """Fail or Xfail test with GitHub issue reference.""" reason = f"{self.gh_issue}: {self.message}" log_message = f"{self.gh_issue.url} => {self.message}" - if self.is_blocked(): + if force_blocked or self.is_blocked(): LOGGER.warning(f"XFAIL: {log_message}") pytest.xfail(reason) else: