From nobody Sat Apr 20 06:45:55 2024 Delivered-To: importer2@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; 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 1542348851458752.007003638763; Thu, 15 Nov 2018 22:14:11 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A9C488E6E; Fri, 16 Nov 2018 06:14:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06BE8510F1; Fri, 16 Nov 2018 06:14:10 +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 E87D61808855; Fri, 16 Nov 2018 06:14:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAG69skT019838 for ; Fri, 16 Nov 2018 01:09:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9C2EB101962E; Fri, 16 Nov 2018 06:09:54 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-143.pek2.redhat.com [10.72.12.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFD611001F53 for ; Fri, 16 Nov 2018 06:09:53 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 16 Nov 2018 14:09:47 +0800 Message-Id: <20181116060948.25592-2-famz@redhat.com> In-Reply-To: <20181116060948.25592-1-famz@redhat.com> References: <20181116060948.25592-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/2] models: Add project name to Message __str__ 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 16 Nov 2018 06:14:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng Reviewed-by tags etc. from replies now trigge retesting and in turn resendi= ng --- api/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/models.py b/api/models.py index b42be53..ea3b654 100644 --- a/api/models.py +++ b/api/models.py @@ -718,7 +718,7 @@ class Message(models.Model): return MessageResult(message=3Dself, **kwargs) =20 def __str__(self): - return self.subject + return self.project.name + "/" + self.subject =20 class Meta: unique_together =3D ('project', 'message_id',) --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 06:45:55 2024 Delivered-To: importer2@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; 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 1542352521045460.6810551453109; Thu, 15 Nov 2018 23:15:21 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61BC03001E7E; Fri, 16 Nov 2018 07:15:19 +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 537374BF; Fri, 16 Nov 2018 07:15:19 +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 45F244BB74; Fri, 16 Nov 2018 07:15:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAG69uk3019844 for ; Fri, 16 Nov 2018 01:09:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 73471101962E; Fri, 16 Nov 2018 06:09:56 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-143.pek2.redhat.com [10.72.12.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 317011001F53 for ; Fri, 16 Nov 2018 06:09:54 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 16 Nov 2018 14:09:48 +0800 Message-Id: <20181116060948.25592-3-famz@redhat.com> In-Reply-To: <20181116060948.25592-1-famz@redhat.com> References: <20181116060948.25592-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/2] testing: Fix bugs that new reviewed-by tags trigger retest 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 16 Nov 2018 07:15:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" New rev-by tags should only initiate a git apply, but the testing results are still valid, we don't want to rerun all tests and especially get the same error reports a second time. Signed-off-by: Fam Zheng Reviewed-by tags etc. from replies now trigge retesting and in turn resendi= ng --- mods/testing.py | 17 +++++---- tests/data/0025-foo-patch-review.mbox.gz | Bin 0 -> 1417 bytes tests/data/0026-bar-patch-standalone.mbox.gz | Bin 0 -> 1558 bytes tests/data/0027-foo-patch-based-on.mbox.gz | Bin 0 -> 1421 bytes tests/patchewtest.py | 5 ++- tests/test_testing.py | 38 +++++++++++++------ 6 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 tests/data/0025-foo-patch-review.mbox.gz create mode 100644 tests/data/0026-bar-patch-standalone.mbox.gz create mode 100644 tests/data/0027-foo-patch-based-on.mbox.gz diff --git a/mods/testing.py b/mods/testing.py index b3e4b07..66e86b1 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -119,19 +119,16 @@ class TestingModule(PatchewModule): register_handler("ResultUpdate", self.on_result_update) =20 def on_set_property(self, evt, obj, name, value, old_value): - if ((isinstance(obj, Message) and obj.is_series_head) \ - or isinstance(obj, Project)) \ - and name in ("git.tag", "git.repo") \ - and old_value is None \ - and obj.get_property("git.tag") and obj.get_property("git.repo= "): - self.clear_and_start_testing(obj) - elif isinstance(obj, Project) and name =3D=3D "git.head" \ + if isinstance(obj, Project) and name =3D=3D "git.head" \ and old_value !=3D value: self.clear_and_start_testing(obj) elif isinstance(obj, Project) and name.startswith("testing.tests."= ) \ and old_value !=3D value: self.project_recalc_pending_tests(obj) =20 + def get_msg_base_tags(self, msg): + return [t for t in msg.tags if t.lower().startswith("based-on:")] + def on_result_update(self, evt, obj, old_status, result): if result.name.startswith("testing.") and result.status !=3D old_s= tatus: if 'tester' in result.data: @@ -141,14 +138,18 @@ class TestingModule(PatchewModule): status__in=3D(Result.PENDING, Result.RUNNING)).= exists(): obj.set_property("testing.done", True) obj.set_property("testing.tested-head", result.data["head"= ]) + if isinstance(obj, Message): + obj.set_property("testing.tested-base", + self.get_msg_base_tags(obj)) =20 if result.name !=3D "git": return if isinstance(obj, Message) \ and obj.is_series_head \ - and old_status !=3D Result.SUCCESS \ and result.status =3D=3D result.SUCCESS \ and result.data.get("tag") and result.data.get("repo"): + tested_base =3D obj.get_property("testing.tested-base") + if tested_base is None or tested_base !=3D self.get_msg_base_t= ags(obj): self.clear_and_start_testing(obj) =20 def filter_testing_results(self, queryset, *args, **kwargs): diff --git a/tests/data/0025-foo-patch-review.mbox.gz b/tests/data/0025-foo= -patch-review.mbox.gz new file mode 100644 index 0000000000000000000000000000000000000000..32171bb3179ce3fdd04c3acb150= 62b72beca9311 GIT binary patch literal 1417 zcmV;41$O!$iwFq4Iqq8k128Z$H7#auZ!K_PbYo~Oa%FaDWp^%ZVsCf=3DrB-WK;z$tv zEWe`8e1bF6q4OXKQD=3DPs>aHkjaMq)T!wI1wy-OaGP88nDRDZj+%TVE%$T^njsrbU2&n#ugIMw7(1CFr zdOU)70^eDflQDZ_Gct@mWDjb z*cb$h#w>*zfIs6b$_P)KR|{SNO5OzYq13f?;=3D^+EKClSM#R(&mG!759`F?)Z?{GuE z4H5Ps!1aeSE;6A!ze74%o<^kSWq|_+zrO3&7eO45z@W50RLhSKWm1D0j1~~i6)7MJ zHj zpxREubW{}xwJ3#Zuhp+@p^SZR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SLuLK(b{*893d2W; zX0jj5JfrJsg+ZJxo2&I9dLJS0!Y0l#b^v~UUd{sjBc^aTfw~t$=3DZF1!vlEb#E zHVkrd+$HYmp=3DRk&!RI=3DDV91NSD)zZZ7Sakn%L+c`K1woV?B|r_sJ|t>uT#-Off(~y zwe;J5k))&6k)oI##j^IKo&J;|ZPt=3DDrKHV-8j_3pbKO7Q&>wFkPji;#kNKLzQQ)V9 zHVD-;IrbjcNEFN%hD?ziZO#n_{C-|5sJptX*UQ@~qIoq;8!ip=3DysxObtypi@LSs=3D2 zolH!-ju*jAz%W4@MJ9=3DfzO_N57BcU^CT+IxpbOe8^w4E_?oAjuL(2ArfnunZLUmI& zW$X}>5|wN?{Z8Dn$H~#71KqQ3yT!&H#;3}L1xXCc>O$L-j6Dj0bHFVJ|5*Uva!x5zwJs`>J01Rut{k}i z=3DOsr2xa}SGk530M^fH(a8QkZHvAB=3D@#@QVnOpHMrSfIOr>6iF^m`v zK4(5iq;tXAJfX|26a2St(QPQ6}EqNQ;?D!tZ|v_PkMeYxf5 zU1?`u{9Gi?$_!pK`%3J8DxQ2@=3DLV*q=3DW&`NRvkSDHvWbH778l>J!ow+mfw23L$1PsmOt?rY87&ax!S$-2lNM5tJ+hP+$nc|>h&4Qs~%rkIB?~5 z?i7HVJ43Z?wV^g_aC`kb`uxVQ6}or>u8UW<(`$)K53awdI*RA@(foGP>5%pj8XRA` z9e~T$IpB(uEA5WnsfYznj=3DFKz&=3D%gwSDsCC;uc;p%`rkrLT!;G7yl9onH!JE@bTAk zL?VPpb4B_ODAXjpjCshw4^Y>INK>4GxtQrmT&YzhX~f54AY{S|@akgSP+TRB9L<0k z_K2yrjDI4As?K~I2#TTW!bxc@)oQiHie?js-L3*P3eBce3wg|dq9sU3u_kNM|7tD~ I%D)Z(0Cyt-umAu6 literal 0 HcmV?d00001 diff --git a/tests/data/0027-foo-patch-based-on.mbox.gz b/tests/data/0027-f= oo-patch-based-on.mbox.gz new file mode 100644 index 0000000000000000000000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=3DhXhItOHx@+m`gm;hO% zi*sy*S&kVKJsf8CTCd!ZOKj^Hz5Odr3r_?>(NKTA(#;Uzh~cT~El#P*h0=3D7>a3|^Tb;_;FnIa zhW!s&igZ}4QZ7LpWnqNkE&=3DSyACwXGD37OW$?MAvlriDzEf`<6_@1$8x-0T$fbkZT zE|>eiB9{7ri*fQ>YOQJ2&axzvWYbCBdX=3Dh_L+QbXReOGT-wpSU+~fUJH6pow6l%}6 zI?Bf%aWbHT-_80&<;4`PB5)A>&VT~k4{W2^G#W;u34XUX(4XGeO{y>7fbZj{-|4p0 zM;C7YF)XyV+vCO8eWyd(#~5&O?RNmKTNi*UPH)VCJ}{6AUJWgK&@h+T$yc5glK6R$ b7ZMRxD#uGdeoZA~+jsv5U0&>@2o3-M@@};e literal 0 HcmV?d00001 diff --git a/tests/patchewtest.py b/tests/patchewtest.py index d41793e..fc6de3e 100644 --- a/tests/patchewtest.py +++ b/tests/patchewtest.py @@ -101,7 +101,10 @@ class PatchewTestCase(django.test.LiveServerTestCase): self.check_cli(["import", self.get_data_path(mbox)], rc) =20 def do_apply(self): - self.cli(["apply", "--applier-mode"]) + while True: + r, out, err =3D self.cli(["apply", "--applier-mode"]) + if r !=3D 0: + break for s in Message.objects.series_heads(): self.assertNotEqual(s.git_result.status, Result.PENDING) =20 diff --git a/tests/test_testing.py b/tests/test_testing.py index 6e960f1..6f2808c 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -260,20 +260,36 @@ class TesterTest(PatchewTestCase): self.assertNotIn("Project: DENY\n", out) self.cli_logout() =20 - def test_tester_single(self): - self.cli_login() - out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", - "--no-wait", "-N", "1"]) - self.assertIn("Project: QEMU\n", out) - out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", - "--no-wait", "-N", "1"]) - self.assertIn("Project: UMEQ\n", out) - out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", - "--no-wait", "-N", "1"]) - self.assertIn("Project: ALLOW\n", out) + def verify_tests(self, projects): + if projects: + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,= DENY", + "--no-wait", "-N", str(len(projects= ))]) + for p in projects: + self.assertIn("Project: %s" % p, out) out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", "--no-wait", "-N", "1"]) self.assertIn("Nothing to test", out) + + def test_tester_single(self): + self.cli_login() + + self.verify_tests(["QEMU", "UMEQ", "ALLOW"]) + self.do_apply() + self.verify_tests(["QEMU", "UMEQ", "ALLOW"]) + # Getting a new reviewed-by shouldn't trigger re-test + self.cli_import('0025-foo-patch-review.mbox.gz') + self.do_apply() + self.verify_tests([]) + + # Import a new series to rebase onto + self.cli_import('0026-bar-patch-standalone.mbox.gz') + self.do_apply() + self.verify_tests(["QEMU", "UMEQ", "ALLOW"]) + + self.cli_import('0027-foo-patch-based-on.mbox.gz') + self.do_apply() + self.verify_tests(["QEMU", "UMEQ", "ALLOW"]) + self.cli_logout() =20 def test_tester_project(self): --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel