fixing combined charts issue

pull/5155/head
Silen Naihin 2023-08-01 17:15:15 +01:00
parent d830194d29
commit f8a01ef70a
4 changed files with 9 additions and 12 deletions

View File

@ -54,7 +54,7 @@ def run_agent(
output = process.stdout.readline()
print(output.strip())
except Exception as e:
print("Error reading stdout", e)
continue
# Check if process has ended, has no more output, or exceeded timeout
if process.poll() is not None or (time.time() - start_time > timeout):

View File

@ -19,7 +19,9 @@ def generate_combined_chart() -> None:
reports_data = get_reports_data(str(all_agents_path))
categories = all_agent_categories(reports_data, combined=True)
categories = all_agent_categories(reports_data)
print("Agent categories:", categories)
# Count the number of directories in this directory
num_dirs = len([f for f in combined_charts_folder.iterdir() if f.is_dir()])

View File

@ -31,17 +31,14 @@ def get_reports_data(report_path: str) -> dict[str, Any]:
return reports_data
def get_agent_category(
report: Report, combined: Optional[bool] = None
) -> dict[str, Any]:
def get_agent_category(report: Report) -> dict[str, Any]:
categories: dict[str, Any] = {}
def get_highest_category_difficulty(data: Test) -> None:
for category in data.category:
if category == "interface" or category == "iterate":
continue
if combined:
categories.setdefault(category, 0)
categories.setdefault(category, 0)
if data.metrics.success:
num_dif = STRING_DIFFICULTY_MAP[data.metrics.difficulty]
if num_dif > categories.setdefault(category, 0):
@ -57,13 +54,11 @@ def get_agent_category(
return categories
def all_agent_categories(
reports_data: dict[str, Any], combined: Optional[bool] = None
) -> dict[str, Any]:
def all_agent_categories(reports_data: dict[str, Any]) -> dict[str, Any]:
all_categories: dict[str, Any] = {}
for name, report in reports_data.items():
categories = get_agent_category(report, combined)
categories = get_agent_category(report)
all_categories[name] = categories
return all_categories

@ -1 +1 @@
Subproject commit 646f33a761d8332821aeb4a5dc167b619d907c50
Subproject commit b0318053b6cbe357f2e020fe0f1275a2cb3da767