diff --git a/.github/regression.sh b/.github/regression.sh index 4394e7c25..2e3902e94 100755 --- a/.github/regression.sh +++ b/.github/regression.sh @@ -13,8 +13,6 @@ df -h . retval=0 -DEFAULT_CLUSTER_ERA="conway" - REPODIR="$(readlink -m "${0%/*}/..")" cd "$REPODIR" @@ -55,22 +53,12 @@ if [ -n "${CLUSTERS_COUNT:-}" ]; then export CLUSTERS_COUNT fi -CLUSTER_ERA="${CLUSTER_ERA:-"$DEFAULT_CLUSTER_ERA"}" -if [ "$CLUSTER_ERA" = "conway 10" ]; then - CLUSTER_ERA="conway" -elif [ "$CLUSTER_ERA" = "conway 11" ]; then - CLUSTER_ERA="conway" +if [ "${CLUSTER_ERA:-}" = "conway 10" ]; then + export CLUSTER_ERA="conway" +elif [ "${CLUSTER_ERA:-}" = "conway 11" ]; then + export CLUSTER_ERA="conway" export PROTOCOL_VERSION=11 fi -export CLUSTER_ERA - -TX_ERA="${TX_ERA:-}" -if [ "$TX_ERA" = "conway" ] || [ "$CLUSTER_ERA" = "conway" ]; then - unset TX_ERA - export COMMAND_ERA="conway" -elif [ "$TX_ERA" = "default" ]; then - export TX_ERA="" -fi # Decrease the number of tests per cluster if we are using the "disk" (LMDB) UTxO backend to avoid # having too many concurrent readers. @@ -78,12 +66,10 @@ if [ -z "${MAX_TESTS_PER_CLUSTER:-}" ] && [[ "${UTXO_BACKEND:-}" = "disk"* ]]; t export MAX_TESTS_PER_CLUSTER=5 fi -if [ -n "${BOOTSTRAP_DIR:-}" ]; then - : # don't touch `TESTNET_VARIANT` when running on testnet +if [ -n "${TESTNET_VARIANT:-}" ]; then + export TESTNET_VARIANT elif [ "${CI_BYRON_CLUSTER:-"false"}" != "false" ]; then - export TESTNET_VARIANT="${TESTNET_VARIANT:-"${CLUSTER_ERA}_slow"}" -else - export TESTNET_VARIANT="${TESTNET_VARIANT:-"${CLUSTER_ERA}_fast"}" + export TESTNET_VARIANT="${CLUSTER_ERA:-conway}_slow" fi if [ "${ALLOW_UNSTABLE_ERROR_MESSAGES:-"false"}" == "false" ]; then diff --git a/cardano_node_tests/tests/test_tx_basic.py b/cardano_node_tests/tests/test_tx_basic.py index edbe50d51..417c0c656 100644 --- a/cardano_node_tests/tests/test_tx_basic.py +++ b/cardano_node_tests/tests/test_tx_basic.py @@ -1249,7 +1249,7 @@ def test_far_future_ttl( @pytest.mark.parametrize( "cluster_default_tx_era", (True, False), - ids=("explicit_tx_era", "implicit_tx_era"), + ids=("explicit_tx_era", "latest_tx_era"), indirect=True, ) @pytest.mark.smoke @@ -1264,8 +1264,8 @@ def test_default_tx_era( ): """Test default Tx era. - * check that default Tx era is implicit - * check that default Tx era can be specified explicitly + * check that default Tx era is implicit as `latest` + * check that default Tx era can be specified explicitly by its name """ temp_template = common.get_test_id(cluster) diff --git a/cardano_node_tests/tests/test_tx_negative.py b/cardano_node_tests/tests/test_tx_negative.py index d2e19cc40..e5b7753a7 100644 --- a/cardano_node_tests/tests/test_tx_negative.py +++ b/cardano_node_tests/tests/test_tx_negative.py @@ -36,14 +36,15 @@ class TestNegative: @pytest.fixture(scope="class") def skip_on_last_era(self) -> None: - if VERSIONS.cluster_era == VERSIONS.LAST_KNOWN_ERA: + last_known_era_name = VERSIONS.MAP[VERSIONS.LAST_KNOWN_PROTOCOL_VERSION] + if VERSIONS.cluster_era_name == last_known_era_name: pytest.skip( f"doesn't run with the latest cluster era ({VERSIONS.cluster_era_name})", ) @pytest.fixture(scope="class") def skip_unknown_last_era(self) -> None: - last_known_era_name = VERSIONS.MAP[VERSIONS.LAST_KNOWN_ERA] + last_known_era_name = VERSIONS.MAP[VERSIONS.LAST_KNOWN_PROTOCOL_VERSION] if not clusterlib_utils.cli_has(last_known_era_name): pytest.skip(f"`{last_known_era_name} transaction build-raw` command is not available") diff --git a/cardano_node_tests/utils/versions.py b/cardano_node_tests/utils/versions.py index 3e2f51d7a..a0ec7db2a 100644 --- a/cardano_node_tests/utils/versions.py +++ b/cardano_node_tests/utils/versions.py @@ -11,26 +11,36 @@ class Versions: """Cluster era, transaction era, node version info.""" + # Era names for latest corresponding (or current mainnet) protocol version BYRON: tp.Final[int] = 1 SHELLEY: tp.Final[int] = 2 ALLEGRA: tp.Final[int] = 3 MARY: tp.Final[int] = 4 ALONZO: tp.Final[int] = 6 BABBAGE: tp.Final[int] = 8 - CONWAY: tp.Final[int] = 9 + CONWAY: tp.Final[int] = 10 + DIJKSTRA: tp.Final[int] = 12 - DEFAULT_CLUSTER_ERA: tp.Final[int] = 9 - DEFAULT_TX_ERA: tp.Final[int] = 9 - LAST_KNOWN_ERA: tp.Final[int] = 9 + DEFAULT_CLUSTER_ERA: tp.Final[int] = CONWAY + DEFAULT_TX_ERA: tp.Final[int] = DEFAULT_CLUSTER_ERA + # Latest protocol version supported by the node + LAST_KNOWN_PROTOCOL_VERSION: tp.Final[int] = 11 + # Map protocol versions to era names MAP: tp.ClassVar[dict[int, str]] = { + 0: "byron", 1: "byron", 2: "shelley", 3: "allegra", 4: "mary", + 5: "alonzo", 6: "alonzo", + 7: "babbage", 8: "babbage", 9: "conway", + 10: "conway", + 11: "conway", + 12: "dijkstra", } def __init__(self) -> None: