diff options
author | Reinier van der Leer <pwuts@agpt.co> | 2024-02-18 17:10:14 +0100 |
---|---|---|
committer | Reinier van der Leer <pwuts@agpt.co> | 2024-02-18 17:10:14 +0100 |
commit | 7f71d6d9fd67bb0a591746e32de874cf79abd73b (patch) | |
tree | 129abdf00d3cb38b581f1b84c26d03f4acec32da | |
parent | fix(ci/benchmark): Mitigate VCS conflicts with files in data branch (diff) | |
download | Auto-GPT-7f71d6d9fd67bb0a591746e32de874cf79abd73b.tar.gz Auto-GPT-7f71d6d9fd67bb0a591746e32de874cf79abd73b.tar.bz2 Auto-GPT-7f71d6d9fd67bb0a591746e32de874cf79abd73b.zip |
debug(benchmark): Improve `TestResult` validation error output format
-rw-r--r-- | benchmark/agbenchmark/reports/reports.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/benchmark/agbenchmark/reports/reports.py b/benchmark/agbenchmark/reports/reports.py index 538046028..2068e86f2 100644 --- a/benchmark/agbenchmark/reports/reports.py +++ b/benchmark/agbenchmark/reports/reports.py @@ -92,7 +92,9 @@ def add_test_result_to_report( TestResult( success=call.excinfo is None, run_time=f"{str(round(call.duration, 3))} seconds", - fail_reason=None if call.excinfo is None else str(call.excinfo.value), + fail_reason=( + str(call.excinfo.value) if call.excinfo is not None else None + ), reached_cutoff=user_properties.get("timed_out", False), n_steps=user_properties.get("n_steps"), cost=user_properties.get("agent_task_cost"), @@ -104,10 +106,11 @@ def add_test_result_to_report( * 100 ) except ValidationError: - logger.error( - "Validation failed on TestResult; " - f"call.excinfo = {repr(call.excinfo)} ({call.excinfo})" - ) + if call.excinfo: + logger.error( + "Validation failed on TestResult; " + f"call.excinfo = {repr(call.excinfo)};\n{call.excinfo.getrepr()})" + ) raise prev_test_results: list[bool | None] = get_and_update_success_history( |