=== modified file 'lava_test/commands.py'
@@ -225,7 +225,7 @@
if not test.is_installed:
raise LavaCommandError("The specified test is not installed")
try:
- artifacts = test.run(self)
+ artifacts, run_fail = test.run(self)
except subprocess.CalledProcessError as ex:
if ex.returncode is None:
raise LavaCommandError("Command %r was aborted" % ex.cmd)
@@ -245,6 +245,9 @@
if not self.args.skip_attachments:
artifacts.attach_standard_files_to_bundle()
artifacts.save_bundle_as(self.args.output)
+ if run_fail:
+ raise LavaCommandError(
+ 'Some of test steps returned non-zero exit code')
class parse(TestAffectingCommand):
=== modified file 'lava_test/core/runners.py'
@@ -50,7 +50,7 @@
if observer: observer.about_to_run_shell_command(cmd)
returncode = extcmd.call(cmd, shell=True)
if observer: observer.did_run_shell_command(cmd, returncode)
- if (returncode != 00): run_failed = True
+ if (returncode != 0): run_failed = True
finally:
stdout.close()
stderr.close()
=== modified file 'lava_test/core/tests.py'
@@ -127,10 +127,8 @@
"Invoking %r.run_and_store_artifacts(...)",
self.runner, observer)
run_fail = self.runner.run(artifacts, observer)
- if run_fail:
- raise RuntimeError('Some of test steps returned non-zero exit code')
-
- return artifacts
+
+ return artifacts, run_fail
def parse(self, artifacts):
if self.parser:
=== modified file 'tests/test_lavatest_test.py'
@@ -44,7 +44,7 @@
self.assertFalse(test.is_installed)
test.install()
self.assertTrue(test.is_installed)
- artifacts = test.run()
+ artifacts, fail_run = test.run()
std_out = open(artifacts.stdout_pathname).read()
self.assertTrue("foo" in std_out)