improve api tests and error output

show only relevant aptly logs if a test fails.
for async tasks, show task output, as it contains the error message.
This commit is contained in:
André Roth
2024-07-16 19:48:04 +02:00
parent 8029305d32
commit 440c3debdc
11 changed files with 278 additions and 175 deletions

View File

@@ -128,6 +128,7 @@ class BaseTest(object):
requiresGPG2 = False
requiresDot = False
sortOutput = False
debugOutput = False
aptlyDir = ".aptly"
aptlyConfigFile = ".aptly.conf"
@@ -177,6 +178,10 @@ class BaseTest(object):
try:
self.run()
self.check()
except Exception as exc:
if self.debugOutput:
print(f"API log:\n{self.debug_output()}")
raise exc
finally:
self.teardown()