feat(testing): stabilize simulation suite and fix gemini caching
This commit is contained in:
@@ -20,12 +20,12 @@ class BaseSimulation:
|
||||
|
||||
def setup(self, project_name="SimProject"):
|
||||
print(f"\n[BaseSim] Connecting to GUI...")
|
||||
if not self.client.wait_for_server(timeout=10):
|
||||
if not self.client.wait_for_server(timeout=5):
|
||||
raise RuntimeError("Could not connect to GUI. Ensure it is running with --enable-test-hooks")
|
||||
|
||||
print("[BaseSim] Resetting session...")
|
||||
self.client.click("btn_reset")
|
||||
time.sleep(1)
|
||||
time.sleep(0.5)
|
||||
|
||||
git_dir = os.path.abspath(".")
|
||||
self.project_path = os.path.abspath(f"tests/temp_{project_name.lower()}.toml")
|
||||
@@ -37,7 +37,9 @@ class BaseSimulation:
|
||||
|
||||
# Standard test settings
|
||||
self.client.set_value("auto_add_history", True)
|
||||
time.sleep(0.5)
|
||||
self.client.set_value("current_provider", "gemini")
|
||||
self.client.set_value("current_model", "gemini-2.5-flash-lite")
|
||||
time.sleep(0.2)
|
||||
|
||||
def teardown(self):
|
||||
if self.project_path and os.path.exists(self.project_path):
|
||||
@@ -49,7 +51,7 @@ class BaseSimulation:
|
||||
def get_value(self, tag):
|
||||
return self.client.get_value(tag)
|
||||
|
||||
def wait_for_event(self, event_type, timeout=10):
|
||||
def wait_for_event(self, event_type, timeout=5):
|
||||
return self.client.wait_for_event(event_type, timeout)
|
||||
|
||||
def assert_panel_visible(self, panel_tag, msg=None):
|
||||
@@ -59,7 +61,7 @@ class BaseSimulation:
|
||||
# Actually, let's just check if get_indicator_state or similar works for generic tags.
|
||||
pass
|
||||
|
||||
def wait_for_element(self, tag, timeout=5):
|
||||
def wait_for_element(self, tag, timeout=2):
|
||||
start = time.time()
|
||||
while time.time() - start < timeout:
|
||||
try:
|
||||
@@ -67,7 +69,7 @@ class BaseSimulation:
|
||||
self.client.get_value(tag)
|
||||
return True
|
||||
except:
|
||||
time.sleep(0.2)
|
||||
time.sleep(0.1)
|
||||
return False
|
||||
|
||||
def run_sim(sim_class):
|
||||
|
||||
Reference in New Issue
Block a user