From patchwork Wed Jul 20 23:16:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 2897 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 7AF1823F42 for ; Wed, 20 Jul 2011 23:16:24 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 318B8A187B7 for ; Wed, 20 Jul 2011 23:16:24 +0000 (UTC) Received: by qyk30 with SMTP id 30so520051qyk.11 for ; Wed, 20 Jul 2011 16:16:23 -0700 (PDT) Received: by 10.229.217.3 with SMTP id hk3mr8414892qcb.38.1311203783643; Wed, 20 Jul 2011 16:16:23 -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.229.217.78 with SMTP id hl14cs125838qcb; Wed, 20 Jul 2011 16:16:23 -0700 (PDT) Received: by 10.227.198.80 with SMTP id en16mr8480451wbb.58.1311203782154; Wed, 20 Jul 2011 16:16:22 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id fe2si1399276wbb.7.2011.07.20.16.16.21; Wed, 20 Jul 2011 16:16:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Qjg05-00067W-8i for ; Wed, 20 Jul 2011 23:16:21 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 3C29C2E8067 for ; Wed, 20 Jul 2011 23:16:21 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 247 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 247: * make the bundle used in the BundleDeserializerSuccessTests tests more Message-Id: <20110720231621.16889.82559.launchpad@loganberry.canonical.com> Date: Wed, 20 Jul 2011 23:16:21 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13475"; Instance="initZopeless config overlay" X-Launchpad-Hash: 56acf68ae797a4650df54ee15150f07b0dcc34d3 Merge authors: Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 247 [merge] committer: Michael-Doyle Hudson branch nick: trunk timestamp: Thu 2011-07-21 11:12:57 +1200 message: * make the bundle used in the BundleDeserializerSuccessTests tests more pathological, as seen in bug 813567 * fix the bug on postgres by uniqifying test case ids from the bundle being imported at the python level modified: dashboard_app/helpers.py dashboard_app/tests/other/deserialization.py --- lp:lava-dashboard https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk You are subscribed to branch lp:lava-dashboard. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription === modified file 'dashboard_app/helpers.py' --- dashboard_app/helpers.py 2011-07-04 06:04:22 +0000 +++ dashboard_app/helpers.py 2011-07-20 23:08:27 +0000 @@ -427,13 +427,13 @@ """ Import TestCase """ - id_units = [] + id_units = {} for c_test_result in c_test_results: if "test_case_id" not in c_test_result: continue - id_units.append( - (c_test_result["test_case_id"], - c_test_result.get("units", ""))) + id_units.setdefault( + c_test_result["test_case_id"], c_test_result.get("units", "")) + id_units = id_units.items() cursor = connection.cursor() for i in range(0, len(id_units), 1000): === modified file 'dashboard_app/tests/other/deserialization.py' --- dashboard_app/tests/other/deserialization.py 2011-06-17 01:33:55 +0000 +++ dashboard_app/tests/other/deserialization.py 2011-07-20 23:06:30 +0000 @@ -259,7 +259,7 @@ class BundleDeserializerSuccessTests(TestCaseWithScenarios): - json_text = """ + json_text = ''' { "format": "Dashboard Bundle Format 1.0", "test_runs": [ @@ -268,7 +268,8 @@ "analyzer_assigned_uuid": "1ab86b36-c23d-11df-a81b-002163936223", "analyzer_assigned_date": "2010-12-31T23:59:59Z", "time_check_performed": true, - "test_results": [{ + "test_results": [ + { "test_case_id": "some_test_case_id", "result": "unknown", "measurement": 1000.3, @@ -282,10 +283,16 @@ "attr1": "value1", "attr2": "value2" } - }], + }, + { + "test_case_id": "some_test_case_id", + "result": "unknown" + } + ], "sw_context": { "packages": [ {"name": "pkg1", "version": "1.0"}, + {"name": "pkg1", "version": "1.0"}, {"name": "pkg2", "version": "0.5"} ], "sw_image": { @@ -321,7 +328,7 @@ } ] } - """ + ''' scenarios = [ ('with_evolution', {