Skip to content

Commit

Permalink
Unify skips; test also on Babbage in addition to Alonzo
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoura committed Jun 25, 2022
1 parent 4371248 commit 3662635
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 35 deletions.
6 changes: 6 additions & 0 deletions cardano_node_tests/tests/common.py
Expand Up @@ -18,6 +18,12 @@
f"and TX era '{VERSIONS.transaction_era_name}'"
)

SAME_ERAS = (
VERSIONS.cluster_era >= VERSIONS.DEFAULT_CLUSTER_ERA
and VERSIONS.transaction_era == VERSIONS.cluster_era
)
ERAS_SKIP_MSG = "meant to run with default era or higher, where cluster era == Tx era"


class PytestTest(NamedTuple):
test_function: str
Expand Down
5 changes: 1 addition & 4 deletions cardano_node_tests/tests/test_cli.py
Expand Up @@ -170,10 +170,7 @@ def test_pretty_utxo(
assert utxo_out == expected_out

@allure.link(helpers.get_vcs_link())
@pytest.mark.skipif(
VERSIONS.transaction_era != VERSIONS.DEFAULT_TX_ERA,
reason="different TX eras doesn't affect this test",
)
@pytest.mark.skipif(not common.SAME_ERAS, reason=common.ERAS_SKIP_MSG)
@pytest.mark.testnets
def test_tx_view(self, cluster: clusterlib.ClusterLib):
"""Check that the output of `transaction view` is as expected."""
Expand Down
6 changes: 1 addition & 5 deletions cardano_node_tests/tests/test_configuration.py
Expand Up @@ -16,7 +16,6 @@
from cardano_node_tests.utils import helpers
from cardano_node_tests.utils import locking
from cardano_node_tests.utils import temptools
from cardano_node_tests.utils.versions import VERSIONS

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -114,10 +113,7 @@ def check_epoch_length(cluster_obj: clusterlib.ClusterLib) -> None:


@pytest.mark.order(5)
@pytest.mark.skipif(
VERSIONS.transaction_era != VERSIONS.DEFAULT_TX_ERA,
reason="different TX eras doesn't affect this test, pointless to run",
)
@pytest.mark.skipif(not common.SAME_ERAS, reason=common.ERAS_SKIP_MSG)
@pytest.mark.long
class TestBasic:
"""Basic tests for node configuration."""
Expand Down
9 changes: 1 addition & 8 deletions cardano_node_tests/tests/test_kes.py
Expand Up @@ -41,14 +41,7 @@
NUM_OF_EPOCHS += 1


pytestmark = pytest.mark.skipif(
not (
VERSIONS.cluster_era
== VERSIONS.transaction_era
== (VERSIONS.LAST_KNOWN_ERA or VERSIONS.DEFAULT_CLUSTER_ERA)
),
reason="meant to run only with the latest or default cluster era and transaction era",
)
pytestmark = pytest.mark.skipif(not common.SAME_ERAS, reason=common.ERAS_SKIP_MSG)


@pytest.fixture
Expand Down
6 changes: 1 addition & 5 deletions cardano_node_tests/tests/test_ledger_state.py
Expand Up @@ -14,7 +14,6 @@
from cardano_node_tests.utils import cluster_nodes
from cardano_node_tests.utils import clusterlib_utils
from cardano_node_tests.utils import helpers
from cardano_node_tests.utils.versions import VERSIONS

LOGGER = logging.getLogger(__name__)

Expand All @@ -33,11 +32,8 @@ class TestLedgerState:
"""Basic tests for ledger state."""

@allure.link(helpers.get_vcs_link())
@pytest.mark.skipif(
VERSIONS.transaction_era != VERSIONS.DEFAULT_TX_ERA,
reason="different TX eras doesn't affect this test, pointless to run",
)
@pytest.mark.order(-1)
@pytest.mark.skipif(not common.SAME_ERAS, reason=common.ERAS_SKIP_MSG)
@pytest.mark.testnets
@pytest.mark.smoke
def test_stake_snapshot(self, cluster: clusterlib.ClusterLib): # noqa: C901
Expand Down
6 changes: 2 additions & 4 deletions cardano_node_tests/tests/test_metrics.py
Expand Up @@ -6,6 +6,7 @@
import requests
from cardano_clusterlib import clusterlib

from cardano_node_tests.tests import common
from cardano_node_tests.utils import cluster_nodes
from cardano_node_tests.utils import helpers
from cardano_node_tests.utils import model_ekg
Expand Down Expand Up @@ -125,10 +126,7 @@ def test_available_metrics(
assert metrics_keys == self.EXPECTED_METRICS, "Metrics differ"


@pytest.mark.skipif(
VERSIONS.transaction_era != VERSIONS.DEFAULT_TX_ERA,
reason="different TX eras doesn't affect this test, pointless to run",
)
@pytest.mark.skipif(not common.SAME_ERAS, reason=common.ERAS_SKIP_MSG)
class TestEKG:
"""EKG metrics tests."""

Expand Down
5 changes: 1 addition & 4 deletions cardano_node_tests/tests/test_native_tokens.py
Expand Up @@ -2125,12 +2125,9 @@ def test_minting_amount_above_the_allowed(
assert "the number exceeds the max bound" in str(excinfo.value)


@pytest.mark.skipif(not common.SAME_ERAS, reason=common.ERAS_SKIP_MSG)
@pytest.mark.testnets
@pytest.mark.smoke
@pytest.mark.skipif(
VERSIONS.transaction_era != VERSIONS.DEFAULT_TX_ERA,
reason="runs only with default TX era",
)
class TestCLITxOutSyntax:
"""Tests of syntax for specifying muti-asset values and txouts."""

Expand Down
6 changes: 1 addition & 5 deletions cardano_node_tests/tests/test_protocol.py
Expand Up @@ -8,7 +8,6 @@

from cardano_node_tests.tests import common
from cardano_node_tests.utils import helpers
from cardano_node_tests.utils.versions import VERSIONS

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -43,12 +42,9 @@
)


@pytest.mark.skipif(not common.SAME_ERAS, reason=common.ERAS_SKIP_MSG)
@pytest.mark.testnets
@pytest.mark.smoke
@pytest.mark.skipif(
VERSIONS.transaction_era != VERSIONS.DEFAULT_TX_ERA,
reason="different TX eras doesn't affect this test, pointless to run",
)
class TestProtocol:
"""Basic tests for protocol."""

Expand Down

0 comments on commit 3662635

Please sign in to comment.