Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions .github/regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ df -h .

retval=0

DEFAULT_CLUSTER_ERA="conway"

REPODIR="$(readlink -m "${0%/*}/..")"
cd "$REPODIR"

Expand Down Expand Up @@ -55,35 +53,23 @@ 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.
if [ -z "${MAX_TESTS_PER_CLUSTER:-}" ] && [[ "${UTXO_BACKEND:-}" = "disk"* ]]; then
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
Expand Down
6 changes: 3 additions & 3 deletions cardano_node_tests/tests/test_tx_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions cardano_node_tests/tests/test_tx_negative.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
18 changes: 14 additions & 4 deletions cardano_node_tests/utils/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading