From patchwork Thu Oct 6 22:18:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 4562 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B90B723DEC for ; Thu, 6 Oct 2011 22:18:15 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 96FFAA18DF1 for ; Thu, 6 Oct 2011 22:18:15 +0000 (UTC) Received: by eya25 with SMTP id 25so248867eya.11 for ; Thu, 06 Oct 2011 15:18:15 -0700 (PDT) Received: by 10.223.58.138 with SMTP id g10mr6204642fah.20.1317939495105; Thu, 06 Oct 2011 15:18:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.23.170 with SMTP id n10cs146170laf; Thu, 6 Oct 2011 15:18:14 -0700 (PDT) Received: by 10.227.201.130 with SMTP id fa2mr1663458wbb.13.1317939494336; Thu, 06 Oct 2011 15:18:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id fv20si5122522wbb.116.2011.10.06.15.18.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Oct 2011 15:18:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RBwGb-000553-K2 for ; Thu, 06 Oct 2011 22:18:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 8D56EE0409 for ; Thu, 6 Oct 2011 22:18:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-test X-Launchpad-Branch: ~linaro-validation/lava-test/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 99 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-test/trunk] Rev 99: Fix tests not parsing when failed Message-Id: <20111006221813.31264.11791.launchpad@ackee.canonical.com> Date: Thu, 06 Oct 2011 22:18:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14085"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: e430122f40fa1bf4a62045ac8bcb2d5aa681b174 Merge authors: Paul Larson (pwlars) Related merge proposals: https://code.launchpad.net/~pwlars/lava-test/fix-no-parsing/+merge/78325 proposed by: Paul Larson (pwlars) review: Resubmit - Paul Larson (pwlars) review: Disapprove - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 99 [merge] fixes bug: https://launchpad.net/bugs/869552 committer: Paul Larson branch nick: lava-test timestamp: Thu 2011-10-06 17:14:55 -0500 message: Fix tests not parsing when failed modified: lava_test/commands.py lava_test/core/runners.py lava_test/core/tests.py tests/test_lavatest_test.py --- lp:lava-test https://code.launchpad.net/~linaro-validation/lava-test/trunk You are subscribed to branch lp:lava-test. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-test/trunk/+edit-subscription === modified file 'lava_test/commands.py' --- lava_test/commands.py 2011-09-12 09:19:10 +0000 +++ lava_test/commands.py 2011-10-05 21:57:34 +0000 @@ -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' --- lava_test/core/runners.py 2011-09-27 20:07:52 +0000 +++ lava_test/core/runners.py 2011-10-05 21:57:34 +0000 @@ -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' --- lava_test/core/tests.py 2011-09-27 20:07:52 +0000 +++ lava_test/core/tests.py 2011-10-05 21:57:34 +0000 @@ -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' --- tests/test_lavatest_test.py 2011-09-12 09:19:10 +0000 +++ tests/test_lavatest_test.py 2011-10-06 22:13:51 +0000 @@ -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)