File tree 8 files changed +14
-35
lines changed
8 files changed +14
-35
lines changed Original file line number Diff line number Diff line change 18
18
f"and TX era '{ VERSIONS .transaction_era_name } '"
19
19
)
20
20
21
+ SAME_ERAS = (
22
+ VERSIONS .cluster_era >= VERSIONS .DEFAULT_CLUSTER_ERA
23
+ and VERSIONS .transaction_era == VERSIONS .cluster_era
24
+ )
25
+ ERAS_SKIP_MSG = "meant to run with default era or higher, where cluster era == Tx era"
26
+
21
27
22
28
class PytestTest (NamedTuple ):
23
29
test_function : str
Original file line number Diff line number Diff line change @@ -170,10 +170,7 @@ def test_pretty_utxo(
170
170
assert utxo_out == expected_out
171
171
172
172
@allure .link (helpers .get_vcs_link ())
173
- @pytest .mark .skipif (
174
- VERSIONS .transaction_era != VERSIONS .DEFAULT_TX_ERA ,
175
- reason = "different TX eras doesn't affect this test" ,
176
- )
173
+ @pytest .mark .skipif (not common .SAME_ERAS , reason = common .ERAS_SKIP_MSG )
177
174
@pytest .mark .testnets
178
175
def test_tx_view (self , cluster : clusterlib .ClusterLib ):
179
176
"""Check that the output of `transaction view` is as expected."""
Original file line number Diff line number Diff line change 16
16
from cardano_node_tests .utils import helpers
17
17
from cardano_node_tests .utils import locking
18
18
from cardano_node_tests .utils import temptools
19
- from cardano_node_tests .utils .versions import VERSIONS
20
19
21
20
LOGGER = logging .getLogger (__name__ )
22
21
@@ -114,10 +113,7 @@ def check_epoch_length(cluster_obj: clusterlib.ClusterLib) -> None:
114
113
115
114
116
115
@pytest .mark .order (5 )
117
- @pytest .mark .skipif (
118
- VERSIONS .transaction_era != VERSIONS .DEFAULT_TX_ERA ,
119
- reason = "different TX eras doesn't affect this test, pointless to run" ,
120
- )
116
+ @pytest .mark .skipif (not common .SAME_ERAS , reason = common .ERAS_SKIP_MSG )
121
117
@pytest .mark .long
122
118
class TestBasic :
123
119
"""Basic tests for node configuration."""
Original file line number Diff line number Diff line change 41
41
NUM_OF_EPOCHS += 1
42
42
43
43
44
- pytestmark = pytest .mark .skipif (
45
- not (
46
- VERSIONS .cluster_era
47
- == VERSIONS .transaction_era
48
- == (VERSIONS .LAST_KNOWN_ERA or VERSIONS .DEFAULT_CLUSTER_ERA )
49
- ),
50
- reason = "meant to run only with the latest or default cluster era and transaction era" ,
51
- )
44
+ pytestmark = pytest .mark .skipif (not common .SAME_ERAS , reason = common .ERAS_SKIP_MSG )
52
45
53
46
54
47
@pytest .fixture
Original file line number Diff line number Diff line change 14
14
from cardano_node_tests .utils import cluster_nodes
15
15
from cardano_node_tests .utils import clusterlib_utils
16
16
from cardano_node_tests .utils import helpers
17
- from cardano_node_tests .utils .versions import VERSIONS
18
17
19
18
LOGGER = logging .getLogger (__name__ )
20
19
@@ -33,11 +32,8 @@ class TestLedgerState:
33
32
"""Basic tests for ledger state."""
34
33
35
34
@allure .link (helpers .get_vcs_link ())
36
- @pytest .mark .skipif (
37
- VERSIONS .transaction_era != VERSIONS .DEFAULT_TX_ERA ,
38
- reason = "different TX eras doesn't affect this test, pointless to run" ,
39
- )
40
35
@pytest .mark .order (- 1 )
36
+ @pytest .mark .skipif (not common .SAME_ERAS , reason = common .ERAS_SKIP_MSG )
41
37
@pytest .mark .testnets
42
38
@pytest .mark .smoke
43
39
def test_stake_snapshot (self , cluster : clusterlib .ClusterLib ): # noqa: C901
Original file line number Diff line number Diff line change 6
6
import requests
7
7
from cardano_clusterlib import clusterlib
8
8
9
+ from cardano_node_tests .tests import common
9
10
from cardano_node_tests .utils import cluster_nodes
10
11
from cardano_node_tests .utils import helpers
11
12
from cardano_node_tests .utils import model_ekg
@@ -125,10 +126,7 @@ def test_available_metrics(
125
126
assert metrics_keys == self .EXPECTED_METRICS , "Metrics differ"
126
127
127
128
128
- @pytest .mark .skipif (
129
- VERSIONS .transaction_era != VERSIONS .DEFAULT_TX_ERA ,
130
- reason = "different TX eras doesn't affect this test, pointless to run" ,
131
- )
129
+ @pytest .mark .skipif (not common .SAME_ERAS , reason = common .ERAS_SKIP_MSG )
132
130
class TestEKG :
133
131
"""EKG metrics tests."""
134
132
Original file line number Diff line number Diff line change @@ -2125,12 +2125,9 @@ def test_minting_amount_above_the_allowed(
2125
2125
assert "the number exceeds the max bound" in str (excinfo .value )
2126
2126
2127
2127
2128
+ @pytest .mark .skipif (not common .SAME_ERAS , reason = common .ERAS_SKIP_MSG )
2128
2129
@pytest .mark .testnets
2129
2130
@pytest .mark .smoke
2130
- @pytest .mark .skipif (
2131
- VERSIONS .transaction_era != VERSIONS .DEFAULT_TX_ERA ,
2132
- reason = "runs only with default TX era" ,
2133
- )
2134
2131
class TestCLITxOutSyntax :
2135
2132
"""Tests of syntax for specifying muti-asset values and txouts."""
2136
2133
Original file line number Diff line number Diff line change 8
8
9
9
from cardano_node_tests .tests import common
10
10
from cardano_node_tests .utils import helpers
11
- from cardano_node_tests .utils .versions import VERSIONS
12
11
13
12
LOGGER = logging .getLogger (__name__ )
14
13
43
42
)
44
43
45
44
45
+ @pytest .mark .skipif (not common .SAME_ERAS , reason = common .ERAS_SKIP_MSG )
46
46
@pytest .mark .testnets
47
47
@pytest .mark .smoke
48
- @pytest .mark .skipif (
49
- VERSIONS .transaction_era != VERSIONS .DEFAULT_TX_ERA ,
50
- reason = "different TX eras doesn't affect this test, pointless to run" ,
51
- )
52
48
class TestProtocol :
53
49
"""Basic tests for protocol."""
54
50
You can’t perform that action at this time.
0 commit comments