From nobody Mon Sep 16 20:08:51 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; 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 1540949961013353.9535278491219; Tue, 30 Oct 2018 18:39:21 -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 B821630820DC; Wed, 31 Oct 2018 01:39:19 +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 A775B5D75C; Wed, 31 Oct 2018 01:39: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 9B5811808841; Wed, 31 Oct 2018 01:39:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9V1OdS7011240 for ; Tue, 30 Oct 2018 21:24:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 429CE5D969; Wed, 31 Oct 2018 01:24:39 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-37.pek2.redhat.com [10.72.12.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4741A61B88 for ; Wed, 31 Oct 2018 01:24:38 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 31 Oct 2018 09:24:28 +0800 Message-Id: <20181031012429.25415-3-famz@redhat.com> In-Reply-To: <20181031012429.25415-1-famz@redhat.com> References: <20181031012429.25415-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/3] testing: Recalculate pending tests after disabling tests 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.47]); Wed, 31 Oct 2018 01:39:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- mods/testing.py | 6 ++++++ tests/test_testing.py | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mods/testing.py b/mods/testing.py index 2d0ed0f..44e8822 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -453,6 +453,12 @@ class TestingGetView(APILoginRequiredView): # Shouldn't happen, but let's protect against it if not t: continue + if not t.get("enabled"): + if isinstance(r, MessageResult): + _instance.recalc_pending_tests(r.message) + else: + _instance.recalc_pending_tests(r.project) + continue reqs =3D t.get("requirements", "") for req in [x.strip() for x in reqs.split(",") if x]: if req not in capabilities: diff --git a/tests/test_testing.py b/tests/test_testing.py index c9452a4..6e960f1 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -348,6 +348,25 @@ class TestingResetTest(PatchewTestCase): "testing.c": Result.PENDING}) self.assertFalse(msg.get_property("testing.done")) =20 +class TestingDisableTest(PatchewTestCase): + + def setUp(self): + self.create_superuser() + + self.repo =3D self.create_git_repo("repo") + + self.p1 =3D self.add_project("QEMU", "qemu-devel@nongnu.org") + create_test(self.p1, "a") + + def test_disable_test(self): + self.cli_login() + self.cli_import('0013-foo-patch.mbox.gz') + self.do_apply() + self.p1.set_property("testing.tests.a.enabled", False) + out, err =3D self.check_cli(["tester", "-p", "QEMU", "--no-wait"]) + self.assertNotIn("Project: QEMU\n", out) + self.cli_logout() + # do not run tests on the abstract class del TestingTestCase =20 --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel