From patchwork Mon Apr 8 01:03:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumaran X-Patchwork-Id: 15958 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3EFDF27752 for ; Mon, 8 Apr 2013 01:03:30 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id 11sf6894303vbf.5 for ; Sun, 07 Apr 2013 18:03:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :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:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=yqmhgEwoVsuYIo3UPMdxEeko+XDndaNxEzrXFayfXfw=; b=bWjgCpmCxguzT6rQyK3Ab+yOSgsTLhfQAI2AmSyjX/uwQ7cAhX6Zo4WYcA0ynWkXmQ gNmr9IBs5M1PNWIYtmrqYdSsafXbg1DeR7Ud5ugvaw3hEZfVe2odJwPhdpuuP/wByqfE roI0Ry3h/RhXfTHka8/FZfEhB3k4CDS82SBeMJ3uW5gnkOzl5vzHb0sChXoYJXLAYtCq rxGWYlbhUWw/PeOksLVqvYllVg8ciqy5be4MYX1xvy05wqaGamyS+e80l9C739zXtHNm E2yA0C8dbyoPRBMBiXwdP2axeVJPF9fJyFF7imn4pLHz/6+5LMdqK546id6r1bAtNvjP 07WQ== X-Received: by 10.224.207.2 with SMTP id fw2mr4765570qab.6.1365382996515; Sun, 07 Apr 2013 18:03:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.51 with SMTP id 19ls2317329qej.38.gmail; Sun, 07 Apr 2013 18:03:16 -0700 (PDT) X-Received: by 10.58.65.2 with SMTP id t2mr14395872ves.28.1365382995961; Sun, 07 Apr 2013 18:03:15 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id da5si8556851vdc.154.2013.04.07.18.03.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 07 Apr 2013 18:03:15 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id w15so3383766vbf.18 for ; Sun, 07 Apr 2013 18:03:15 -0700 (PDT) X-Received: by 10.52.21.212 with SMTP id x20mr12084944vde.106.1365382995684; Sun, 07 Apr 2013 18:03:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp26040vez; Sun, 7 Apr 2013 18:03:15 -0700 (PDT) X-Received: by 10.194.143.50 with SMTP id sb18mr28070883wjb.44.1365382994666; Sun, 07 Apr 2013 18:03:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id dq3si4072688wib.59.2013.04.07.18.03.13 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 07 Apr 2013 18:03: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; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UP0UL-0002Ez-Bf for ; Mon, 08 Apr 2013 01:03:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 444B3E000F for ; Mon, 8 Apr 2013 01:03:13 +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: 576 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 576: Evolve bundle stream format to 1.6 which adds testdef_metadata. Message-Id: <20130408010313.27296.46794.launchpad@ackee.canonical.com> Date: Mon, 08 Apr 2013 01:03:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16550"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: ecfd36ab22d9124071ce58251c0e1ac552587008 X-Gm-Message-State: ALoCoQntwqHYoawcdbpjmqliCGCqw00hWhCdNbqD4eZdV+MEMD8RvJdWQ0L3Pr3PTkEnOl46OiYU X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Senthil Kumaran S (stylesen) Related merge proposals: https://code.launchpad.net/~stylesen/lava-dispatcher/evolve-bundle-stream-1.6/+merge/150519 proposed by: Senthil Kumaran S (stylesen) review: Approve - Antonio Terceiro (terceiro) review: Needs Fixing - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 576 [merge] committer: Senthil Kumaran branch nick: trunk timestamp: Mon 2013-04-08 00:04:33 +0530 message: Evolve bundle stream format to 1.6 which adds testdef_metadata. modified: lava_dispatcher/actions/launch_control.py lava_dispatcher/actions/lava_test_shell.py lava_dispatcher/lava_test_shell.py lava_dispatcher/test_data.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/launch_control.py' --- lava_dispatcher/actions/launch_control.py 2013-01-23 22:37:05 +0000 +++ lava_dispatcher/actions/launch_control.py 2013-01-30 10:30:37 +0000 @@ -209,7 +209,7 @@ if not all_bundles: main_bundle = { "test_runs": [], - "format": "Dashboard Bundle Format 1.5" + "format": "Dashboard Bundle Format 1.6" } else: main_bundle = all_bundles.pop(0) === modified file 'lava_dispatcher/actions/lava_test_shell.py' --- lava_dispatcher/actions/lava_test_shell.py 2013-02-11 02:31:22 +0000 +++ lava_dispatcher/actions/lava_test_shell.py 2013-04-07 10:53:18 +0000 @@ -204,9 +204,9 @@ def _get_testdef_info(testdef): metadata = {'os': '', 'devices': '', 'environment': ''} - metadata['version'] = str(testdef['metadata'].get('version')) - metadata['description'] = str(testdef['metadata'].get('description')) - metadata['format'] = str(testdef['metadata'].get('format')) + metadata['description'] = testdef['metadata'].get('description', None) + metadata['format'] = testdef['metadata'].get('format', None) + metadata['version'] = testdef['metadata'].get('version', None) # Convert list to comma separated string. if testdef['metadata'].get('os'): @@ -404,7 +404,7 @@ f.write(self.uuid) with open('%s/testdef_metadata' % hostdir, 'w') as f: - f.write(yaml.dump(self.testdef_metadata)) + f.write(yaml.safe_dump(self.testdef_metadata)) if 'install' in self.testdef: self._create_repos(hostdir) @@ -439,8 +439,8 @@ testdef_metadata = {} testdef_metadata.update({'url': info['branch_url']}) testdef_metadata.update({'location': info['branch_vcs'].upper()}) - testdef_metadata.update({'repo_rev': info['branch_revision']}) testdef_metadata.update(_get_testdef_info(testdef)) + testdef_metadata.update({'version': info['branch_revision']}) URLTestDefinition.__init__(self, context, idx, testdef, testdef_metadata) === modified file 'lava_dispatcher/lava_test_shell.py' --- lava_dispatcher/lava_test_shell.py 2013-02-11 02:31:22 +0000 +++ lava_dispatcher/lava_test_shell.py 2013-04-05 09:27:07 +0000 @@ -284,6 +284,25 @@ return attachments +def _get_run_testdef_metadata(test_run_dir): + testdef_metadata = { + 'version': None, + 'description': None, + 'format': None, + 'location': None, + 'url': None, + 'os': None, + 'devices': None, + 'environment': None + } + + metadata = _read_content(os.path.join(test_run_dir, 'testdef_metadata')) + if metadata is not '': + testdef_metadata = yaml.safe_load(metadata) + + return testdef_metadata + + def _get_test_run(test_run_dir, hwcontext, build, pkginfo, testdefs_by_uuid): now = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ') @@ -292,11 +311,9 @@ uuid = _read_content(os.path.join(test_run_dir, 'analyzer_assigned_uuid')) attachments = _get_run_attachments(test_run_dir, testdef, stdout) attributes = _attributes_from_dir(os.path.join(test_run_dir, 'attributes')) - # XXX testdef_metadata = _read_content(os.path.join(test_run_dir, - # XXX 'testdef_metadata')) testdef = yaml.safe_load(testdef) - # XXX testdef_metadata = yaml.safe_load(testdef_metadata) + if uuid in testdefs_by_uuid: sw_sources = testdefs_by_uuid[uuid]._sw_sources else: @@ -314,8 +331,8 @@ 'hardware_context': hwcontext, 'attachments': attachments, 'attributes': attributes, - # XXX 'testdef_metadata': testdef_metadata, - } + 'testdef_metadata': _get_run_testdef_metadata(test_run_dir) + } def _read_content(filepath, ignore_missing=False): @@ -354,4 +371,4 @@ except: logging.exception('error processing results for: %s' % test_run_name) - return {'test_runs': testruns, 'format': 'Dashboard Bundle Format 1.5'} + return {'test_runs': testruns, 'format': 'Dashboard Bundle Format 1.6'} === modified file 'lava_dispatcher/test_data.py' --- lava_dispatcher/test_data.py 2013-01-30 05:33:55 +0000 +++ lava_dispatcher/test_data.py 2013-03-25 19:41:18 +0000 @@ -34,8 +34,7 @@ def __init__(self, test_id='lava'): self.job_status = 'pass' self.metadata = {} - self._test_run = { 'test_results':[], 'attachments':[], 'tags':[], } - # XXX 'testdef_metadata':{} } + self._test_run = { 'test_results':[], 'attachments':[], 'tags':[] } self._test_run['test_id'] = test_id self._assign_date() self._assign_uuid()