Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Add support for Nethermind's `nethtest` command to `consume direct` ([#1250](https://github.com/ethereum/execution-spec-tests/pull/1250)).
- ✨ Allow filtering of test cases by fork via pytest marks (via, e.g., `-m "Cancun or Prague"`) ([#1304](https://github.com/ethereum/execution-spec-tests/pull/1304)).
- 🐞 Improve index generation of ethereum/tests fixtures: Allow generation at any directory level and include `generatedTestHash` in the index file for the `fixture_hash` ([#1303](https://github.com/ethereum/execution-spec-tests/pull/1303)).
- 🐞 Fix `--fork/from/until` for transition forks when using `fill` [#1311](https://github.com/ethereum/execution-spec-tests/pull/1311).
Comment thread
spencer-tb marked this conversation as resolved.

### 📋 Misc

- Bump the version of `execution-specs` used by the framework to the package [`ethereum-execution==1.17.0rc6.dev1`](https://pypi.org/project/ethereum-execution/1.17.0rc6.dev1/); bump the version used for test fixture generation for forks < Prague to current `execution-specs` master, [fa847a0](https://github.com/ethereum/execution-specs/commit/fa847a0e48309debee8edc510ceddb2fd5db2f2e) ([#1310](https://github.com/ethereum/execution-spec-tests/pull/1310)).
- 🔀 Bump the version of `execution-specs` used by the framework to the package [`ethereum-execution==1.17.0rc6.dev1`](https://pypi.org/project/ethereum-execution/1.17.0rc6.dev1/); bump the version used for test fixture generation for forks < Prague to current `execution-specs` master, [fa847a0](https://github.com/ethereum/execution-specs/commit/fa847a0e48309debee8edc510ceddb2fd5db2f2e) ([#1310](https://github.com/ethereum/execution-spec-tests/pull/1310)).

### 🧪 Test Cases

Expand Down
23 changes: 10 additions & 13 deletions src/pytest_plugins/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,14 @@ def get_fork_option(config, option_name: str, parameter_name: str) -> Set[Fork]:
config_str = config.getoption(option_name)
if not config_str:
return set()

forks_str = config_str.split(",")
for i in range(len(forks_str)):
forks_str[i] = forks_str[i].strip().capitalize()
if forks_str[i] == "Merge":
forks_str[i] = "Paris"
forks_str = [s.strip() for s in config_str.split(",")]
# Alias for "Merge"
forks_str = [("Paris" if s.lower() == "merge" else s) for s in forks_str]

resulting_forks = set()

for fork in get_forks():
for fork in config.all_forks_with_transitions:
if fork.name() in forks_str:
resulting_forks.add(fork)

Expand Down Expand Up @@ -490,18 +489,16 @@ def get_fork_option(config, option_name: str, parameter_name: str) -> Set[Fork]:
pytest.exit("Invalid command-line options.", returncode=pytest.ExitCode.USAGE_ERROR)

if single_fork:
forks_from = single_fork
forks_until = single_fork
selected_fork_set = single_fork
else:
if not forks_from:
forks_from = get_forks_with_no_parents(forks)
if not forks_until:
forks_until = get_last_descendants(set(get_deployed_forks()), forks_from)

selected_fork_set = get_from_until_fork_set(forks, forks_from, forks_until)
for fork in list(selected_fork_set):
transition_fork_set = transition_fork_to(fork)
selected_fork_set |= transition_fork_set
selected_fork_set = get_from_until_fork_set(forks, forks_from, forks_until)
for fork in list(selected_fork_set):
transition_fork_set = transition_fork_to(fork)
selected_fork_set |= transition_fork_set

config.selected_fork_set = selected_fork_set # type: ignore

Expand Down
8 changes: 8 additions & 0 deletions src/pytest_plugins/forks/tests/test_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ def test_case(state_test):
{"passed": 2, "failed": 0, "skipped": 0, "errors": 0},
id="valid_at_transition_to,subsequent_forks=True,until",
),
pytest.param(
generate_test(
valid_at_transition_to='"Cancun"',
),
["--fork=ShanghaiToCancunAtTime15k"],
{"passed": 1, "failed": 0, "skipped": 0, "errors": 0},
id="valid_at_transition_to,--fork=transition_fork_only",
),
],
)
def test_fork_markers(pytester, test_function: str, outcomes: dict, pytest_args: List[str]):
Expand Down