Skip to content

Commit 664e5f5

Browse files
committed
refactor(consume): rename & simplify consume enginex command
1 parent c918454 commit 664e5f5

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

src/cli/pytest_commands/consume.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ def create_executions(self, pytest_args: List[str]) -> List[PytestExecution]:
4949
]
5050

5151

52-
def get_command_paths(command_name: str) -> List[Path]:
52+
def get_command_paths(command_name: str, is_hive: bool) -> List[Path]:
5353
"""Determine the command paths based on the command name and hive flag."""
5454
base_path = Path("src/pytest_plugins/consume")
5555
if command_name == "hive":
5656
commands = ["rlp", "engine"]
5757
command_paths = [
5858
base_path / "simulators" / "hive_tests" / f"test_via_{cmd}.py" for cmd in commands
5959
]
60-
elif command_name in ["engine", "engine-reorg", "engine_reorg"]:
60+
elif command_name in ["engine", "enginex"]:
6161
command_paths = [base_path / "simulators" / "hive_tests" / "test_via_engine.py"]
6262
elif command_name == "rlp":
6363
command_paths = [base_path / "simulators" / "hive_tests" / "test_via_rlp.py"]
@@ -80,7 +80,7 @@ def consume_command(is_hive: bool = False) -> Callable[[Callable[..., Any]], cli
8080
def decorator(func: Callable[..., Any]) -> click.Command:
8181
command_name = func.__name__
8282
command_help = func.__doc__
83-
command_paths = get_command_paths(command_name)
83+
command_paths = get_command_paths(command_name, is_hive)
8484

8585
@consume.command(
8686
name=command_name,
@@ -112,24 +112,14 @@ def rlp() -> None:
112112

113113
@consume_command(is_hive=True)
114114
def engine() -> None:
115-
"""Client consumes via the Engine API."""
115+
"""Client consumes Engine Fixtures via the Engine API."""
116116
pass
117117

118118

119-
@consume.command(
120-
name="engine-reorg",
121-
help="Client consumes via the Engine API with reorg fixtures.",
122-
context_settings={"ignore_unknown_options": True},
123-
)
124-
@common_pytest_options
125-
def engine_reorg(
126-
pytest_args: List[str], help_flag: bool = False, pytest_help_flag: bool = False
127-
) -> None:
128-
"""Client consumes via the Engine API with reorg fixtures."""
129-
command_name = "engine_reorg" # Use underscore for internal logic
130-
command_paths = get_command_paths(command_name)
131-
consume_cmd = ConsumeCommand(command_paths, is_hive=True, command_name=command_name)
132-
consume_cmd.execute(list(pytest_args))
119+
@consume_command(is_hive=True)
120+
def enginex() -> None:
121+
"""Client consumes Engine X Fixtures via the Engine API."""
122+
pass
133123

134124

135125
@consume_command(is_hive=True)
@@ -142,7 +132,7 @@ def hive() -> None:
142132
context_settings={"ignore_unknown_options": True},
143133
)
144134
@common_pytest_options
145-
def cache(pytest_args: List[str], help_flag: bool = False, pytest_help_flag: bool = False) -> None:
135+
def cache(pytest_args: List[str], **kwargs) -> None:
146136
"""Consume command to cache test fixtures."""
147-
cache_cmd = ConsumeCommand([], is_hive=False, command_name="cache")
137+
cache_cmd = ConsumeCommand([], is_hive=False)
148138
cache_cmd.execute(list(pytest_args))

src/cli/pytest_commands/processors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def process_args(self, args: List[str]) -> List[str]:
107107

108108
if self.command_name == "engine":
109109
modified_args.extend(["-p", "pytest_plugins.consume.simulators.engine.conftest"])
110-
elif self.command_name == "engine_reorg":
110+
elif self.command_name == "enginex":
111111
modified_args.extend(["-p", "pytest_plugins.consume.simulators.engine_reorg.conftest"])
112112
elif self.command_name == "rlp":
113113
modified_args.extend(["-p", "pytest_plugins.consume.simulators.rlp.conftest"])

whitelist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ Typechecking
10611061
groupstats
10621062
SharedPreStateGroup
10631063
zkEVMs
1064+
enginex
10641065
qube
10651066
aspell
10661067
codespell

0 commit comments

Comments
 (0)