feat: add stdout into workspace for easier debugging (#1236)

* refactor: use get_truncated_stdout for consistent stdout handling across modules

* lint

* feat: add dump_stdout_type to DSRunnerCoSTEERSettings and use in eval

* fix: avoid circular import by moving DSRunnerEvaluator import inside method
This commit is contained in:
you-n-g
2025-09-10 10:02:49 +08:00
committed by GitHub
parent d4c539912a
commit 0daeb82d63
11 changed files with 43 additions and 30 deletions
@@ -56,7 +56,7 @@ class DataLoaderCoSTEEREvaluator(CoSTEEREvaluator):
test_code = (DIRNAME / "eval_tests" / "data_loader_test.txt").read_text()
implementation.inject_files(**{fname: test_code})
result = implementation.run(env=env, entry=f"python {fname}")
stdout = result.stdout
stdout = result.get_truncated_stdout()
ret_code = result.exit_code
match = re.search(r"(.*?)=== Start of EDA part ===(.*)=== End of EDA part ===(.*)", stdout, re.DOTALL)
stdout_part_1, eda_output, stdout_part_2 = match.groups() if match else (stdout, None, "")