From nobody Tue Feb 10 11:23:57 2026 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; 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 1532664020040662.1971931696037; Thu, 26 Jul 2018 21:00:20 -0700 (PDT) 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 739193082143; Fri, 27 Jul 2018 04:00:11 +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 5FD0E600C4; Fri, 27 Jul 2018 04:00:11 +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 4CEAE4BB78; Fri, 27 Jul 2018 04:00:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6R40ACs018729 for ; Fri, 27 Jul 2018 00:00:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 194E6111C4BE; Fri, 27 Jul 2018 04:00:10 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-150.pek2.redhat.com [10.72.12.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93797111C4AB; Fri, 27 Jul 2018 04:00:07 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:32 +0800 Message-Id: <20180727035934.32555-10-famz@redhat.com> In-Reply-To: <20180727035934.32555-1-famz@redhat.com> References: <20180727035934.32555-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH v2 09/11] tests: Fix "testing" 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.42]); Fri, 27 Jul 2018 04:00:11 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" These tests have been in a lower level before and relied on SetProperty handlers in testing mod to initialize testing data. So they unfortunately missed the bug introduced during the conversion from "git.*" properties to Results: now that git mod doesn't set Message's git.repo and git.tag property, the testings are never prepared! Switch to use a more end-to-end approach with do_apply(). Signed-off-by: Fam Zheng --- tests/test_testing.py | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/tests/test_testing.py b/tests/test_testing.py index 7ca4625..c1a1c94 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -28,8 +28,6 @@ class TestingTestCase(PatchewTestCase, metaclass=3Dabc.AB= CMeta): def setUp(self): self.create_superuser() self.p =3D self.add_project("QEMU", "qemu-devel@nongnu.org") - self.p.git =3D "dummy repo" - self.p.save() =20 self.PROJECT_BASE =3D '%sprojects/%d/' % (self.REST_BASE, self.p.i= d) =20 @@ -153,14 +151,10 @@ class MessageTestingTest(TestingTestCase): super(MessageTestingTest, self).setUp() =20 self.cli_login() - self.cli_import('0001-simple-patch.mbox.gz') + self.cli_import('0013-foo-patch.mbox.gz') + self.do_apply() self.cli_logout() - self.msg =3D Message.objects.all()[0] - self.msg.save() - self.msg.set_property("git.repo", "dummy repo") - self.msg.set_property("git.tag", "dummy tag") - self.msg.set_property("git.base", "dummy base") =20 def do_testing_done(self, **kwargs): self._do_testing_done(self.msg, **kwargs) @@ -175,16 +169,6 @@ class MessageTestingTest(TestingTestCase): self.PROJECT_BASE, self.msg.message= _id, test_name)) =20 def test_testing_ready(self): - # Set property through series_heads elements must be handled the s= ame - self.msg.set_property("git.repo", None) - self.msg.set_property("git.tag", None) - self.assertEqual(self.msg.results.filter(name=3D'testing.a').first= ().status, - Result.PENDING) - msg =3D Message.objects.series_heads()[0] - self.assertEqual(self.msg.message_id, msg.message_id) - msg.set_property("git.repo", "dummy repo") - msg.set_property("git.tag", "dummy tag") - msg.set_property("git.base", "dummy base") self.assertEqual(self.msg.results.filter(name=3D'testing.a').first= ().status, Result.PENDING) =20 @@ -212,31 +196,22 @@ class TesterTest(PatchewTestCase): def setUp(self): self.create_superuser() =20 + self.repo =3D self.create_git_repo("repo") self.p1 =3D self.add_project("QEMU", "qemu-devel@nongnu.org") create_test(self.p1, "a") self.p2 =3D self.add_project("UMEQ", "qemu-devel@nongnu.org") create_test(self.p2, "b") =20 self.cli_login() - self.cli_import('0001-simple-patch.mbox.gz') + self.cli_import('0013-foo-patch.mbox.gz') self.cli_logout() =20 - self.repo =3D os.path.join(self.get_tmpdir(), "repo") - os.mkdir(self.repo) - subprocess.check_output(["git", "init"], cwd=3Dself.repo) - for f in ["foo", "bar"]: - self.add_file_and_commit(f) self.update_head(self.p1) self.update_head(self.p2) base =3D subprocess.check_output(["git", "rev-parse", "HEAD~1"], cwd=3Dself.repo).decode() subprocess.check_output(["git", "tag", "test"], cwd=3Dself.repo) =20 - for msg in Message.objects.all(): - msg.set_property("git.repo", self.repo) - msg.set_property("git.tag", "test") - msg.set_property("git.base", base) - def add_file_and_commit(self, f): subprocess.check_output(["touch", f], cwd=3Dself.repo) subprocess.check_output(["git", "add", f], cwd=3Dself.repo) --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel