From nobody Fri Oct 25 19:24:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152447174240290.36504637375617; Mon, 23 Apr 2018 01:22:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D98590C7A; Mon, 23 Apr 2018 08:22:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B0E03ACF; Mon, 23 Apr 2018 08:22:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2E2944CAA1; Mon, 23 Apr 2018 08:15:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3N8Fp0j012995 for ; Mon, 23 Apr 2018 04:15:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id D018A6E6FF; Mon, 23 Apr 2018 08:15:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C88DC17596 for ; Mon, 23 Apr 2018 08:15:43 +0000 (UTC) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CAC63312C02A for ; Mon, 23 Apr 2018 08:14:19 +0000 (UTC) Received: by mail-wr0-f175.google.com with SMTP id w3-v6so38575807wrg.2 for ; Mon, 23 Apr 2018 01:14:19 -0700 (PDT) Received: from donizetti.lan (dynamic-adsl-78-12-189-60.clienti.tiscali.it. [78.12.189.60]) by smtp.gmail.com with ESMTPSA id x17sm6468901edx.53.2018.04.23.01.14.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Apr 2018 01:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=KB8dlOjz/RgBBaXjJA72AWk0Ux2vXzim9N2M4jfGgms=; b=bJ/0fx5Jz4WODu1RRqwfsbUQoz2RLcZ7K2UdV18tCWbiFHLQzdBQ26XD6O6NmWqi46 gCBX7CTA9MgvTQJ/dFSFRGHGDHKbKOdDoMCCLyzBgqqxD57assJeRv3nlbNUuXhO51RV zVFhbEDfd8xjsgKrnEJPVhvMosEkaufKH9WvDkzohoPbrEQuPBUUxsaceHSVyXrATjer lx8sJqOhScT0FG1TrOjIvUUyS2nMBqQ9g09R0o4TMA1hL6emC7v4iugnLf0/NQnAKaoj lVu2zI6GEiXddYLQce2SL062qGsGNFzPEjra9fViIXyeB5K/cF0te0dY/g6OzHPFO8Ju 8bjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=KB8dlOjz/RgBBaXjJA72AWk0Ux2vXzim9N2M4jfGgms=; b=knW5+WfYIRjIMumjd4wxqA441/bTwCXL3A/mf3gl/b6BbJJJFoB3ruCqPw7x0Gx5pn UAy5rkm99TfI1bF1IF6k9pCd56o5cPB44OQ+yJXto1O9c61Rxw3twZkZq34lC/M3I8In 4BD6zf1jaH93/o/qyHzA8Xl69NTFIBSqFmDaREagRzh6zWCmfND9I6iCssxb0PdNVCtb fMgn6Hf8A3NFYQUTEN64nksYGIW+7/y/AjwefnMX2TP4Abu0xiIpixhZuolS0sgSYT9E 2l9JySGNJ940eb4JEfL6tBKhsJBQf3n90GG5nXDRAXzfaDyCUFpqIOO95jooQq59BFzP Y+7A== X-Gm-Message-State: ALQs6tCCVRYmFxrrAbLDqQ6VRpfOMki8t1oSytRy7y9MRva7tIUSGfWt WdRVNnau9Ag7Ef/Q4+se/Zh7aJlP X-Google-Smtp-Source: AIpwx49vV25ZkVb5nc3mB4Kg+Ocua85uwXRsIIOWTLxjFVAoCoNS7XYu+8WASQ6j/52I0PZ09BPiKg== X-Received: by 10.80.243.24 with SMTP id p24mr21606384edm.144.1524471258152; Mon, 23 Apr 2018 01:14:18 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 23 Apr 2018 10:14:14 +0200 Message-Id: <20180423081415.15099-4-pbonzini@redhat.com> In-Reply-To: <20180423081415.15099-1-pbonzini@redhat.com> References: <20180423081415.15099-1-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 23 Apr 2018 08:14:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 23 Apr 2018 08:14:20 +0000 (UTC) for IP:'209.85.128.175' DOMAIN:'mail-wr0-f175.google.com' HELO:'mail-wr0-f175.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.35 (DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.128.175 mail-wr0-f175.google.com 209.85.128.175 mail-wr0-f175.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 3/4] testing: add rendering of Results X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 23 Apr 2018 08:22:21 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- mods/testing.py | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/mods/testing.py b/mods/testing.py index 24d6ff0..8dc4d0a 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -228,22 +228,6 @@ class TestingModule(PatchewModule): ret[tn]["name"] =3D tn return ret =20 - def prepare_testing_report(self, obj): - for pn, p in obj.get_properties().items(): - if not pn.startswith("testing.report."): - continue - tn =3D pn[len("testing.report."):] - failed =3D not p["passed"] - log_url =3D self.reverse_testing_log(obj, tn, html=3DFalse) - html_log_url =3D self.reverse_testing_log(obj, tn, html=3DTrue) - passed_str =3D "failed" if failed else "passed" - html =3D format_html('Test {} {}', - tn, html_log_url, log_url, passed_str) - obj.extra_status.append({ - "kind": "alert" if failed else "good", - "html": html, - }) - def _build_reset_ops(self, obj): if isinstance(obj, Message): typearg =3D "type=3Dmessage" @@ -292,12 +276,12 @@ class TestingModule(PatchewModule): data =3D p.copy() del data['passed'] results.append(Result(name=3D'testing.' + tn, obj=3Dobj, statu= s=3Dpassed_str, - log=3Dlog, log_url=3Dlog_url, request=3D= request, data=3Ddata)) + log=3Dlog, log_url=3Dlog_url, request=3D= request, data=3Ddata, + renderer=3Dself)) =20 def prepare_message_hook(self, request, message, detailed): if not message.is_series_head: return - self.prepare_testing_report(message) if message.project.maintained_by(request.user) \ and message.get_property("testing.started"): message.extra_ops +=3D self._build_reset_ops(message) @@ -321,6 +305,17 @@ class TestingModule(PatchewModule): "char": "T", }) =20 + def render_result(self, result): + if result.status !=3D 'success' and result.status !=3D 'failure': + return None + pn =3D result.name + tn =3D pn[len("testing."):] + failed =3D result.status =3D=3D 'failure' + html_log_url =3D result.log_url + '&html=3D1' + passed_str =3D "failed" if failed else "passed" + return format_html('Test {} {}', + tn, html_log_url, result.log_url, passed_str) + def check_active_testers(self, project): at =3D [] for k, v in project.get_properties().items(): @@ -347,7 +342,6 @@ class TestingModule(PatchewModule): "content_html": self.build_config_html(= request, = project)}) self.check_active_testers(project) - self.prepare_testing_report(project) =20 if project.maintained_by(request.user) \ and project.get_property("testing.started"): --=20 2.17.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel