From e83a3b5b95954ee138f98fa7cb6dc06a1023d8fe Mon Sep 17 00:00:00 2001 From: tomsht01 Date: Tue, 10 Dec 2024 17:19:32 +0200 Subject: [PATCH] fix: return 'results.xml' if tests fail for 'labgrid_test' --- labgrid/run/run.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/labgrid/run/run.py b/labgrid/run/run.py index aed99901..fcbb4ba5 100644 --- a/labgrid/run/run.py +++ b/labgrid/run/run.py @@ -322,15 +322,15 @@ def run( stderr.write(f"{line}{linesep}") # Copy the files back from the target - if code == 0: - for unresolved in get: - resolved = unresolved.resolve(temp) - # FIXME: Check if file exists with `@ape//ape:test` instead of assuming any error is due to a missing file - try: - transfer.get(resolved.remote, resolved.local) - except ExecutionError as e: - if not resolved.optional: - raise e + + for unresolved in get: + resolved = unresolved.resolve(temp) + # FIXME: Check if file exists with `@ape//ape:test` instead of assuming any error is due to a missing file + try: + transfer.get(resolved.remote, resolved.local) + except ExecutionError as e: + if not resolved.optional and code == 0: + raise e return code -- GitLab