Simplified thread continuations
Fixed and improved tests
This commit is contained in:
@@ -33,13 +33,30 @@ class CrossToolComprehensiveTest(BaseSimulatorTest):
|
||||
try:
|
||||
# Check both main server and log monitor for comprehensive logs
|
||||
cmd_server = ["docker", "logs", "--since", since_time, self.container_name]
|
||||
cmd_monitor = ["docker", "logs", "--since", since_time, "gemini-mcp-log-monitor"]
|
||||
cmd_monitor = ["docker", "logs", "--since", since_time, "zen-mcp-log-monitor"]
|
||||
|
||||
result_server = subprocess.run(cmd_server, capture_output=True, text=True)
|
||||
result_monitor = subprocess.run(cmd_monitor, capture_output=True, text=True)
|
||||
|
||||
# Combine logs from both containers
|
||||
combined_logs = result_server.stdout + "\n" + result_monitor.stdout
|
||||
# Get the internal log files which have more detailed logging
|
||||
server_log_result = subprocess.run(
|
||||
["docker", "exec", self.container_name, "cat", "/tmp/mcp_server.log"], capture_output=True, text=True
|
||||
)
|
||||
|
||||
activity_log_result = subprocess.run(
|
||||
["docker", "exec", self.container_name, "cat", "/tmp/mcp_activity.log"], capture_output=True, text=True
|
||||
)
|
||||
|
||||
# Combine all logs
|
||||
combined_logs = (
|
||||
result_server.stdout
|
||||
+ "\n"
|
||||
+ result_monitor.stdout
|
||||
+ "\n"
|
||||
+ server_log_result.stdout
|
||||
+ "\n"
|
||||
+ activity_log_result.stdout
|
||||
)
|
||||
return combined_logs
|
||||
except Exception as e:
|
||||
self.logger.error(f"Failed to get docker logs: {e}")
|
||||
@@ -260,15 +277,15 @@ def secure_login(user, pwd):
|
||||
improved_file_mentioned = any("auth_improved.py" in line for line in logs.split("\n"))
|
||||
|
||||
# Print comprehensive diagnostics
|
||||
self.logger.info(f" 📊 Tools used: {len(tools_used)} ({', '.join(tools_used)})")
|
||||
self.logger.info(f" 📊 Continuation IDs created: {len(continuation_ids_created)}")
|
||||
self.logger.info(f" 📊 Conversation logs found: {len(conversation_logs)}")
|
||||
self.logger.info(f" 📊 File embedding logs found: {len(embedding_logs)}")
|
||||
self.logger.info(f" 📊 Continuation logs found: {len(continuation_logs)}")
|
||||
self.logger.info(f" 📊 Cross-tool activity logs: {len(cross_tool_logs)}")
|
||||
self.logger.info(f" 📊 Auth file mentioned: {auth_file_mentioned}")
|
||||
self.logger.info(f" 📊 Config file mentioned: {config_file_mentioned}")
|
||||
self.logger.info(f" 📊 Improved file mentioned: {improved_file_mentioned}")
|
||||
self.logger.info(f" Tools used: {len(tools_used)} ({', '.join(tools_used)})")
|
||||
self.logger.info(f" Continuation IDs created: {len(continuation_ids_created)}")
|
||||
self.logger.info(f" Conversation logs found: {len(conversation_logs)}")
|
||||
self.logger.info(f" File embedding logs found: {len(embedding_logs)}")
|
||||
self.logger.info(f" Continuation logs found: {len(continuation_logs)}")
|
||||
self.logger.info(f" Cross-tool activity logs: {len(cross_tool_logs)}")
|
||||
self.logger.info(f" Auth file mentioned: {auth_file_mentioned}")
|
||||
self.logger.info(f" Config file mentioned: {config_file_mentioned}")
|
||||
self.logger.info(f" Improved file mentioned: {improved_file_mentioned}")
|
||||
|
||||
if self.verbose:
|
||||
self.logger.debug(" 📋 Sample tool activity logs:")
|
||||
@@ -296,9 +313,9 @@ def secure_login(user, pwd):
|
||||
passed_criteria = sum(success_criteria)
|
||||
total_criteria = len(success_criteria)
|
||||
|
||||
self.logger.info(f" 📊 Success criteria met: {passed_criteria}/{total_criteria}")
|
||||
self.logger.info(f" Success criteria met: {passed_criteria}/{total_criteria}")
|
||||
|
||||
if passed_criteria >= 6: # At least 6 out of 8 criteria
|
||||
if passed_criteria == total_criteria: # All criteria must pass
|
||||
self.logger.info(" ✅ Comprehensive cross-tool test: PASSED")
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user