Skip to content

Commit ada54e4

Browse files
committed
test fix
1 parent 135422e commit ada54e4

File tree

1 file changed

+12
-40
lines changed

1 file changed

+12
-40
lines changed

tests/pytest/test_openenv_echo_hub.py

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,8 @@
88
from eval_protocol.pytest.openenv_rollout_processor import OpenEnvRolloutProcessor
99
import pytest
1010

11-
12-
# Skip these integration-heavy tests on CI runners by default
13-
pytestmark = pytest.mark.skipif(os.getenv("CI") == "true", reason="Skip OpenEnv integration tests on CI")
14-
15-
# Try to import, but skip if not available
16-
try:
17-
from envs.echo_env import EchoEnv # type: ignore
18-
19-
_HAS_ECHO = True
20-
except ImportError:
21-
_HAS_ECHO = False
22-
EchoEnv = None # type: ignore
23-
pytest.skip("OpenEnv echo_env not installed", allow_module_level=True)
11+
# Import OpenEnv Echo environment
12+
from envs.echo_env import EchoEnv, EchoAction # type: ignore
2413

2514

2615
def echo_dataset_to_rows(data: List[Dict[str, Any]]) -> List[EvaluationRow]:
@@ -45,23 +34,10 @@ def action_parser(response_text: str):
4534
"""
4635
Convert raw model response to EchoAction.
4736
"""
48-
try:
49-
from envs.echo_env import EchoAction # type: ignore
50-
except Exception:
51-
pytest.skip("OpenEnv (openenv.envs.echo_env) is not installed; skipping Echo hub test.")
52-
raise
5337
text = response_text.strip() if isinstance(response_text, str) else ""
5438
return EchoAction(message=text or "hello")
5539

5640

57-
# try:
58-
# from envs.echo_env import EchoEnv # type: ignore
59-
60-
# _HAS_ECHO = True
61-
# except Exception:
62-
# _HAS_ECHO = False
63-
64-
6541
# Inline test data
6642
ECHO_INLINE_DATA: List[Dict[str, Any]] = [
6743
{"id": "echo-1", "prompt": "hello"},
@@ -82,20 +58,16 @@ def action_parser(response_text: str):
8258
num_runs=1,
8359
max_concurrent_rollouts=2,
8460
mode="pointwise",
85-
rollout_processor=(
86-
OpenEnvRolloutProcessor(
87-
# Use HF Hub to launch the environment container automatically
88-
env_client_cls=EchoEnv if _HAS_ECHO else None, # type: ignore
89-
hub_repo_id=os.getenv("OPENENV_ECHO_REPO", "openenv/echo-env"),
90-
# Simple prompt+parser above
91-
prompt_builder=prompt_builder,
92-
action_parser=action_parser,
93-
# Keep defaults for timeouts/viewport/etc. (not relevant for echo)
94-
timeout_ms=5000,
95-
num_generations=1,
96-
)
97-
if _HAS_ECHO
98-
else None
61+
rollout_processor=OpenEnvRolloutProcessor(
62+
# Use HF Hub to launch the environment container automatically
63+
env_client_cls=EchoEnv,
64+
hub_repo_id=os.getenv("OPENENV_ECHO_REPO", "openenv/echo-env"),
65+
# Simple prompt+parser above
66+
prompt_builder=prompt_builder,
67+
action_parser=action_parser,
68+
# Keep defaults for timeouts/viewport/etc. (not relevant for echo)
69+
timeout_ms=5000,
70+
num_generations=1,
9971
),
10072
)
10173
def test_openenv_echo_hub(row: EvaluationRow) -> EvaluationRow:

0 commit comments

Comments
 (0)