Skip to content

Commit

Permalink
Merge pull request #7 from gratux/main
Browse files Browse the repository at this point in the history
failure detection fixes & clean qemu shutdown
  • Loading branch information
PaideiaDilemma authored Jan 22, 2024
2 parents 2cf139d + c67dfbe commit 162fd1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tortillas/log_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ def analyze(
else TestStatus[config_entry.set_status]
)

if not logs:
continue
# fixme: this is flawed, why is this here?
# when tortillas gets no logs and and aborts, it can't detect incorrect or missing exit codes
# as a result, every test with incorrect exit codes passes
# if not logs:
# continue

if config_entry.mode == "add_as_error":
result.add_errors(logs, status)
Expand Down
8 changes: 6 additions & 2 deletions tortillas/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def run_test(test_queue: list[TestRun]):
# Testing finished

self.success = not any(
test_run.result.status in (TestStatus.FAILED, TestStatus.PANIC)
test_run.result.status in (TestStatus.FAILED, TestStatus.PANIC, TestStatus.TIMEOUT)
for test_run in self.test_runs
)

Expand Down Expand Up @@ -381,8 +381,12 @@ def _run(

# Wait a bit for cleanup and debug output to be flushed
time.sleep(1)
# analyze before exiting the shell, to keep exit codes intact
test.analyze(status)

test.analyze(status)
# exit the shell, so files are written to the qcow2 image
qemu.sweb_input("exit\n")
time.sleep(1)

log.info("Done!")
if callback:
Expand Down

0 comments on commit 162fd1b

Please sign in to comment.