From patchwork Thu May 10 21:29:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 8524 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 EAF7323E00 for ; Thu, 10 May 2012 21:29:15 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 9BA6DA18220 for ; Thu, 10 May 2012 21:29:15 +0000 (UTC) Received: by yhpp61 with SMTP id p61so2496745yhp.11 for ; Thu, 10 May 2012 14:29:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=YXMSwPtkEdSRRQbu5mriwWDHFN27nBl1xVccamnj6h0=; b=a721PmQWyzq5agYsWPE3xzfm144txCCAXxOjtijT7FcHOjkX2ZlyC1Y2V116C6BKG6 FDvot2p0ZPaDQbuX/6BR/e2HsWw4/jr/apYJ+I7blZsd6KCjH9x16geSABIoCaJZJsat PLm5K5OFVNveZhdnilO789pu+wjoe9exDEXSAArFNGyd3MqaCNByXnYRLUgSYyRKcv1p STGmtdG2T7wxTkk7ScuOL6Lko9mQpJvolDMyhUhrgius8I+j2iu+A+8ycCzTAXArJfUy X7mmjWze5mOSqAN0NA6TcrIHZhRTK3+GqDGSzHgB4cWn74yZUiR/z+NTjLrRk0izeOhj WixQ== Received: by 10.50.160.225 with SMTP id xn1mr358970igb.3.1336685354897; Thu, 10 May 2012 14:29:14 -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.231.73.147 with SMTP id q19csp128224ibj; Thu, 10 May 2012 14:29:13 -0700 (PDT) Received: by 10.216.208.149 with SMTP id q21mr23499weo.39.1336685353303; Thu, 10 May 2012 14:29:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id e5si5971109wef.92.2012.05.10.14.29.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 May 2012 14:29:13 -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 1SSav9-0004QY-Vi for ; Thu, 10 May 2012 21:29:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E4F6BE1446 for ; Thu, 10 May 2012 21:29:11 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 286 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 286: runs all the commands run by the lava_test_install action with a helper that catches errors and r... Message-Id: <20120510212911.16080.50024.launchpad@ackee.canonical.com> Date: Thu, 10 May 2012 21:29:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15213"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: d4ed9e61810029dedd9c26b3bfc7ba40ec1286a1 X-Gm-Message-State: ALoCoQmqbYIzDNbxpY7CVzy9xDhWEu+LjasyS/oySwVdLramSAFSsXCYRRic1LFB19rhSyVt47eE Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dispatcher/lava-test-install-resilience/+merge/105278 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Le Chi Thu (le-chi-thu) ------------------------------------------------------------ revno: 286 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Fri 2012-05-11 09:27:49 +1200 message: runs all the commands run by the lava_test_install action with a helper that catches errors and reports results into the lava testrun modified: lava_dispatcher/actions/lava-test.py --- lp:lava-dispatcher https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk You are subscribed to branch lp:lava-dispatcher. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription === modified file 'lava_dispatcher/actions/lava-test.py' --- lava_dispatcher/actions/lava-test.py 2012-05-07 05:27:30 +0000 +++ lava_dispatcher/actions/lava-test.py 2012-05-09 22:24:31 +0000 @@ -20,11 +20,10 @@ # along # with this program; if not, see . -from datetime import datetime import logging from lava_dispatcher.actions import BaseAction -from lava_dispatcher.client.base import OperationFailed, CriticalError +from lava_dispatcher.client.base import OperationFailed from lava_dispatcher.utils import generate_bundle_file_name @@ -116,6 +115,15 @@ 'additionalProperties': False, } + def run_command_with_test_result(self, session, command, test_result_name, timeout): + try: + session.run(command, timeout=timeout) + except OperationFailed as e: + logging.error("running %r failed" % command) + self.context.test_data.add_result(test_result_name, 'fail', str(e)) + else: + self.context.test_data.add_result(test_result_name, 'pass') + def run(self, tests, install_python=None, register=None, timeout=2400): logging.info( "Executing lava_test_install (%s) command" % ",".join(tests)) @@ -133,15 +141,20 @@ if install_python: for module in install_python: - session.run("pip install -e " + module) + self.run_command_with_test_result( + session, "pip install -e " + module, + 'lava_test_install python (%s)' % module, timeout=60) if register: for test_def_url in register: - session.run('lava-test register-test ' + test_def_url, - timeout=60) + self.run_command_with_test_result( + session, 'lava-test register-test ' + test_def_url, + 'lava_test_install register (%s)' % test_def_url, timeout=60) for test in tests: - session.run('lava-test install %s' % test, timeout=timeout) + self.run_command_with_test_result( + session, 'lava-test install %s' % test, + 'lava_test_install (%s)' % test, timeout=timeout) session.run('rm -rf lava-test', timeout=60)