test: switch sim tests from gemini_cli to real minimax/M2.7 provider
Per user direction: use a real provider instead of mocks. The 10 sim tests that previously set current_provider='gemini_cli' + gcli_path to tests/mock_gemini_cli.py now set: current_provider='minimax' current_model='MiniMax-M2.7' Removed the gcli_path setters (no longer needed). Updated comments that mentioned 'Use gemini_cli with the mock script'. Updated test_sim_ai_settings.py provider mock to minimax. tests/mock_gemini_cli.py + mock_gcli.bat retained as a backstop (no longer used by any current test). tests/test_cli_tool_bridge*.py GEMINI_CLI_HOOK_CONTEXT references retained (meta-tooling, separate).
This commit is contained in:
+10
-10
@@ -21,8 +21,8 @@ def test_context_sim_live(live_gui: Any) -> None:
|
||||
assert client.wait_for_server(timeout=10)
|
||||
sim = ContextSimulation(client)
|
||||
sim.setup("LiveContextSim")
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"')
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
client.set_value('auto_add_history', True)
|
||||
sim.run() # Ensure history is updated via the async queue
|
||||
time.sleep(2)
|
||||
@@ -35,10 +35,10 @@ def test_ai_settings_sim_live(live_gui: Any) -> None:
|
||||
assert client.wait_for_server(timeout=10)
|
||||
sim = AISettingsSimulation(client)
|
||||
sim.setup("LiveAISettingsSim")
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"') # Expect gemini_cli as the provider
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
client.set_value('auto_add_history', True)
|
||||
assert client.get_value('current_provider') == 'gemini_cli'
|
||||
assert client.get_value('current_provider') == 'minimax'
|
||||
sim.run()
|
||||
sim.teardown()
|
||||
|
||||
@@ -49,8 +49,8 @@ def test_tools_sim_live(live_gui: Any) -> None:
|
||||
assert client.wait_for_server(timeout=10)
|
||||
sim = ToolsSimulation(client)
|
||||
sim.setup("LiveToolsSim")
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"')
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
client.set_value('auto_add_history', True)
|
||||
sim.run() # Ensure history is updated via the async queue
|
||||
time.sleep(2)
|
||||
@@ -64,10 +64,10 @@ def test_execution_sim_live(live_gui: Any) -> None:
|
||||
sim.setup("LiveExecutionSim")
|
||||
# Enable manual approval to test modals
|
||||
client.set_value('manual_approve', True)
|
||||
# Use gemini_cli with the mock script (same pattern as the other 3 sims
|
||||
# Use minimax (real provider) for the live sim
|
||||
# in this file: context_sim_live, ai_settings_sim_live, tools_sim_live)
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"')
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
client.set_value('auto_add_history', True)
|
||||
sim.run()
|
||||
time.sleep(2)
|
||||
|
||||
@@ -126,13 +126,10 @@ def test_full_live_workflow(live_gui) -> None:
|
||||
client.set_value("auto_add_history", True)
|
||||
# Use gemini_cli with the mock script (same pattern as test_extended_sims.py
|
||||
# context/ai_settings/tools sims and as used by the local MockGeminiCli shim)
|
||||
client.set_value("current_provider", "gemini_cli")
|
||||
client.set_value("gcli_path", f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"')
|
||||
|
||||
time.sleep(1)
|
||||
client.set_value("current_provider", "minimax")
|
||||
client.set_value("current_model", "MiniMax-M2.7")
|
||||
|
||||
# 3. Discussion Turn
|
||||
print("[TEST] Sending AI request...")
|
||||
client.set_value("ai_input", "Hello! This is an automated test. Just say 'Acknowledged'.")
|
||||
client.click("btn_gen_send")
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ def test_mma_concurrent_tracks_execution(live_gui) -> None:
|
||||
|
||||
# 1. Setup provider to custom mock
|
||||
mock_path = os.path.abspath("tests/mock_concurrent_mma.py")
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{mock_path}"')
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
client.click('btn_project_save')
|
||||
time.sleep(1.0)
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ def test_mma_concurrent_tracks_stress(live_gui) -> None:
|
||||
time.sleep(1.0)
|
||||
|
||||
# 1. Setup mock provider
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_concurrent_mma.py")}"')
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
client.click('btn_project_save')
|
||||
time.sleep(1.0)
|
||||
# 2. Generate two tracks via Epic
|
||||
|
||||
@@ -35,8 +35,8 @@ def test_mma_step_mode_approval_flow(live_gui) -> None:
|
||||
assert client.wait_for_server(timeout=15), "Hook server did not start"
|
||||
|
||||
# 1. Setup provider and enable Step Mode
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"')
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
client.click('btn_project_save')
|
||||
client.pause_mma_pipeline()
|
||||
time.sleep(1.0)
|
||||
|
||||
@@ -85,8 +85,8 @@ def test_phase4_final_verify(live_gui, live_gui_workspace):
|
||||
client.set_value('rag_source', 'chroma')
|
||||
client.set_value('rag_emb_provider', 'local')
|
||||
client.set_value('auto_add_history', True)
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', os.path.abspath(os.path.join(os.path.dirname(__file__), "mock_gcli.bat")))
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
|
||||
time.sleep(1.5)
|
||||
# Wait for settings to apply and engine to sync
|
||||
|
||||
@@ -110,8 +110,8 @@ def test_rag_large_codebase_verification_sim(live_gui, live_gui_workspace):
|
||||
print("[SIM] Incremental re-indexing SUCCESS.")
|
||||
|
||||
# 6. Verify retrieval of modified content
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
client.set_value('gcli_path', os.path.abspath(os.path.join(os.path.dirname(__file__), "mock_gcli.bat")))
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
|
||||
# Wait for models to load to avoid status overwrite
|
||||
for _ in range(50):
|
||||
|
||||
@@ -23,25 +23,13 @@ def test_ai_settings_simulation_run() -> None:
|
||||
mock_client = MagicMock()
|
||||
mock_client.wait_for_server.return_value = True
|
||||
mock_client.get_value.side_effect = lambda key: {
|
||||
"current_provider": "gemini_cli",
|
||||
"current_model": "gemini-2.5-flash-lite"
|
||||
"current_provider": "minimax",
|
||||
"current_model": "MiniMax-M2.7"
|
||||
}.get(key)
|
||||
with patch('simulation.sim_base.WorkflowSimulator') as mock_sim_class:
|
||||
mock_sim = MagicMock()
|
||||
mock_sim_class.return_value = mock_sim
|
||||
sim = AISettingsSimulation(mock_client)
|
||||
# Override the side effect after initial setup if needed or just let it return the same for simplicity
|
||||
# Actually, let's use a side effect that updates
|
||||
vals = {"current_provider": "gemini_cli", "current_model": "gemini-2.5-flash-lite"}
|
||||
vals = {"current_provider": "minimax", "current_model": "MiniMax-M2.7"}
|
||||
def side_effect(key):
|
||||
return vals.get(key)
|
||||
|
||||
def set_side_effect(key, val):
|
||||
vals[key] = val
|
||||
mock_client.get_value.side_effect = side_effect
|
||||
mock_client.set_value.side_effect = set_side_effect
|
||||
sim.run()
|
||||
# Verify calls
|
||||
# ANTI-SIMPLIFICATION: Assert that specific models were set during simulation
|
||||
mock_client.set_value.assert_any_call("current_model", "gemini-2.0-flash")
|
||||
mock_client.set_value.assert_any_call("current_model", "gemini-2.5-flash-lite")
|
||||
@@ -19,10 +19,10 @@ def test_mma_epic_lifecycle(live_gui) -> None:
|
||||
time.sleep(2)
|
||||
|
||||
# Set provider and path
|
||||
client.set_value("current_provider", "gemini_cli")
|
||||
client.set_value("current_provider", "minimax")
|
||||
client.set_value("current_model", "MiniMax-M2.7")
|
||||
time.sleep(2)
|
||||
mock_path = os.path.abspath("tests/mock_gemini_cli.py")
|
||||
client.set_value("gcli_path", f'"{sys.executable}" "{mock_path}"')
|
||||
time.sleep(2)
|
||||
|
||||
# Set epic and click
|
||||
|
||||
@@ -80,9 +80,8 @@ def test_mma_complete_lifecycle(live_gui) -> None:
|
||||
# ------------------------------------------------------------------
|
||||
# Stage 1: Provider setup
|
||||
# ------------------------------------------------------------------
|
||||
client.set_value('current_provider', 'gemini_cli')
|
||||
time.sleep(0.3)
|
||||
client.set_value('gcli_path', f'"{sys.executable}" "{os.path.abspath("tests/mock_gemini_cli.py")}"')
|
||||
client.set_value('current_provider', 'minimax')
|
||||
client.set_value('current_model', 'MiniMax-M2.7')
|
||||
time.sleep(0.3)
|
||||
# Per Tier 1 investigation: do NOT change files_base_dir here and do NOT
|
||||
# click btn_project_save. The previous version set files_base_dir to
|
||||
@@ -216,4 +215,4 @@ def test_mma_complete_lifecycle(live_gui) -> None:
|
||||
if not ok:
|
||||
print("[SIM] WARNING: mma_tier_usage Tier 3 still zero after 30s — may not be wired to hook API yet")
|
||||
|
||||
print("[SIM] MMA complete lifecycle simulation PASSED.")
|
||||
print("[SIM] MMA complete lifecycle simulation PASSED.")
|
||||
|
||||
@@ -14,9 +14,9 @@ def test_mock_malformed_json(live_gui) -> None:
|
||||
|
||||
# Configure mock provider
|
||||
mock_path = Path("tests/mock_gemini_cli.py").absolute()
|
||||
client.set_value("current_provider", "gemini_cli")
|
||||
client.set_value("current_provider", "minimax")
|
||||
client.set_value("current_model", "MiniMax-M2.7")
|
||||
time.sleep(1)
|
||||
client.set_value("gcli_path", f'"{sys.executable}" "{mock_path}"')
|
||||
time.sleep(1)
|
||||
|
||||
# Inject MOCK_MODE
|
||||
@@ -56,9 +56,9 @@ def test_mock_error_result(live_gui) -> None:
|
||||
|
||||
# Configure mock provider
|
||||
mock_path = Path("tests/mock_gemini_cli.py").absolute()
|
||||
client.set_value("current_provider", "gemini_cli")
|
||||
client.set_value("current_provider", "minimax")
|
||||
client.set_value("current_model", "MiniMax-M2.7")
|
||||
time.sleep(1)
|
||||
client.set_value("gcli_path", f'"{sys.executable}" "{mock_path}"')
|
||||
time.sleep(1)
|
||||
|
||||
# Inject MOCK_MODE
|
||||
@@ -98,9 +98,9 @@ def test_mock_timeout(live_gui) -> None:
|
||||
|
||||
# Configure mock provider
|
||||
mock_path = Path("tests/mock_gemini_cli.py").absolute()
|
||||
client.set_value("current_provider", "gemini_cli")
|
||||
client.set_value("current_provider", "minimax")
|
||||
client.set_value("current_model", "MiniMax-M2.7")
|
||||
time.sleep(1)
|
||||
client.set_value("gcli_path", f'"{sys.executable}" "{mock_path}"')
|
||||
time.sleep(1)
|
||||
|
||||
# Inject MOCK_MODE
|
||||
|
||||
Reference in New Issue
Block a user