From nobody Fri Apr 26 10:19:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) client-ip=206.53.239.180; envelope-from=patchew-devel-bounce@freelists.org; helo=turing.freelists.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) smtp.mailfrom=patchew-devel-bounce@freelists.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from turing.freelists.org (turing.freelists.org [206.53.239.180]) by mx.zohomail.com with SMTPS id 1520412388658822.0853031348196; Wed, 7 Mar 2018 00:46:28 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0ED8226596; Wed, 7 Mar 2018 03:46:21 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ik5UVFyJO3SN; Wed, 7 Mar 2018 03:46:21 -0500 (EST) Received: from turing.freelists.org (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id AD7E9260D3; Wed, 7 Mar 2018 03:46:20 -0500 (EST) Received: with ECARTIS (v1.0.0; list patchew-devel); Wed, 07 Mar 2018 03:46:20 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 815E726596 for ; Wed, 7 Mar 2018 03:46:20 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EM0hTr9GpU8R for ; Wed, 7 Mar 2018 03:46:20 -0500 (EST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 68DE1260D3 for ; Wed, 7 Mar 2018 03:46:20 -0500 (EST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2665DEAEA7 for ; Wed, 7 Mar 2018 08:46:20 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F2021C716; Wed, 7 Mar 2018 08:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412381; bh=cAfqp2ER+8dD8LE5O5F7zjPR54u5S30SaL4WtwFxm/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=WwcuydV0NLZ+VB2LCrMscoaZa2dMlwWxNuP+c0E+9OrQ9nIxuC6hQcGd5y8Cbxs77 s3lEi7hPvgabbizHzWj7/x0OF6AWoxHnVufkMb0WzBsio82atkEGSYmslOeOtYKE+N bMRfAjCks0nfzxnQSjakmKJA5Mdb9mVG/ot7WMig= X-Virus-Scanned: Debian amavisd-new at turing.freelists.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412380; bh=cAfqp2ER+8dD8LE5O5F7zjPR54u5S30SaL4WtwFxm/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=UF2SMfuUBZeVnhJJPZ7HynLg7lJPb9TxynWqefdRPfPUlNaG9xHZ6aVIorFmQ9o9/ F0s0tg7r3DyFOkpcM40WYuaYjSZ75tUlpUmMz6bncmZ1JKLBwQuOfClgwGGPKpueVM yOGWJB7FqoY4hAm2Bk2504aiZ0s5nceconJvbrvg= X-Original-To: patchew-devel@freelists.org X-Virus-Scanned: Debian amavisd-new at turing.freelists.org From: Fam Zheng To: patchew-devel@freelists.org Cc: pbonzini@redhat.com Subject: [patchew-devel] [PATCH 1/7] ansible: Use "copy" instead of "synchronize" to deploy tester Date: Wed, 7 Mar 2018 16:46:03 +0800 Message-Id: <20180307084609.8515-2-famz@redhat.com> In-Reply-To: <20180307084609.8515-1-famz@redhat.com> References: <20180307084609.8515-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 07 Mar 2018 08:46:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 07 Mar 2018 08:46:20 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-archive-position: 85 X-ecartis-version: Ecartis v1.0.0 Sender: patchew-devel-bounce@freelists.org Errors-to: patchew-devel-bounce@freelists.org X-original-sender: famz@redhat.com Precedence: normal Reply-To: patchew-devel@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: patchew-devel X-List-ID: patchew-devel List-subscribe: List-owner: List-post: List-archive: X-list: patchew-devel X-ZohoMail-DKIM: pass (identity @freelists.org) (identity @freelists.org) X-ZohoMail-Owner: <20180307084609.8515-2-famz@redhat.com>+zmo_0_patchew-devel-bounce@freelists.org X-ZohoMail: RDKM_0 RSF_4 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- scripts/playbooks/deploy-testers.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/playbooks/deploy-testers.yml b/scripts/playbooks/deplo= y-testers.yml index fd9cb0a..c520acc 100644 --- a/scripts/playbooks/deploy-testers.yml +++ b/scripts/playbooks/deploy-testers.yml @@ -22,9 +22,10 @@ - debug: msg: Patchew tester deploy starting - name: Copy patchew-cli - synchronize: - src: ../../../patchew-cli + copy: + src: ../../patchew-cli dest: . + mode: u+x - name: Generate password file shell: "echo {{ tester_pass }} > $HOME/.patchew-tester-pass" - name: Login with patchew-cli --=20 2.14.3 From nobody Fri Apr 26 10:19:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) client-ip=206.53.239.180; envelope-from=patchew-devel-bounce@freelists.org; helo=turing.freelists.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) smtp.mailfrom=patchew-devel-bounce@freelists.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from turing.freelists.org (turing.freelists.org [206.53.239.180]) by mx.zohomail.com with SMTPS id 1520412393728943.0393859738844; Wed, 7 Mar 2018 00:46:33 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 23B9326352; Wed, 7 Mar 2018 03:46:24 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S_zm5tPgYJFB; Wed, 7 Mar 2018 03:46:24 -0500 (EST) Received: from turing.freelists.org (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C20B9260D3; Wed, 7 Mar 2018 03:46:23 -0500 (EST) Received: with ECARTIS (v1.0.0; list patchew-devel); Wed, 07 Mar 2018 03:46:23 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 96C9526352 for ; Wed, 7 Mar 2018 03:46:23 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mAwnK03LOZBc for ; Wed, 7 Mar 2018 03:46:23 -0500 (EST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 7C435260D3 for ; Wed, 7 Mar 2018 03:46:23 -0500 (EST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39CB440363BE for ; Wed, 7 Mar 2018 08:46:23 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7CFF1C70E; Wed, 7 Mar 2018 08:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412384; bh=1wk8Oo60z9xxy9oT4FTdbWAX99BmLU4jUb5EmT9fgQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=MehyR+yPoIxJ8H0zdvGNARyaVCj/7UklWDu5W6lBkAujOGKFT9x7SaoySuZrG3Acz Kl8eGC/I0vzMx348fUZhndV+fUZRimixhhJvkZHgX1uBsNP0vw9TJN92eu3XW4ushC /nsxuyuz8t5GeQBUWv/ZIUJ4ODGWZ6JsmIdQijy8= X-Virus-Scanned: Debian amavisd-new at turing.freelists.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412384; bh=1wk8Oo60z9xxy9oT4FTdbWAX99BmLU4jUb5EmT9fgQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=MehyR+yPoIxJ8H0zdvGNARyaVCj/7UklWDu5W6lBkAujOGKFT9x7SaoySuZrG3Acz Kl8eGC/I0vzMx348fUZhndV+fUZRimixhhJvkZHgX1uBsNP0vw9TJN92eu3XW4ushC /nsxuyuz8t5GeQBUWv/ZIUJ4ODGWZ6JsmIdQijy8= X-Original-To: patchew-devel@freelists.org X-Virus-Scanned: Debian amavisd-new at turing.freelists.org From: Fam Zheng To: patchew-devel@freelists.org Cc: pbonzini@redhat.com Subject: [patchew-devel] [PATCH 2/7] Add SetProperty event Date: Wed, 7 Mar 2018 16:46:04 +0800 Message-Id: <20180307084609.8515-3-famz@redhat.com> In-Reply-To: <20180307084609.8515-1-famz@redhat.com> References: <20180307084609.8515-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:23 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-archive-position: 86 X-ecartis-version: Ecartis v1.0.0 Sender: patchew-devel-bounce@freelists.org Errors-to: patchew-devel-bounce@freelists.org X-original-sender: famz@redhat.com Precedence: normal Reply-To: patchew-devel@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: patchew-devel X-List-ID: patchew-devel List-subscribe: List-owner: List-post: List-archive: X-list: patchew-devel X-ZohoMail-DKIM: pass (identity @freelists.org) X-ZohoMail-Owner: <20180307084609.8515-3-famz@redhat.com>+zmo_0_patchew-devel-bounce@freelists.org X-ZohoMail: RDKM_0 RSF_4 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It is emitted after new properties are saved on Project or Message objects. Signed-off-by: Fam Zheng --- api/models.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/api/models.py b/api/models.py index 0c8688a..2055957 100644 --- a/api/models.py +++ b/api/models.py @@ -102,7 +102,7 @@ class Project(models.Model): r[m.name] =3D json.loads(m.value) return r =20 - def set_property(self, prop, value): + def _do_set_property(self, prop, value): if value =3D=3D None: ProjectProperty.objects.filter(project=3Dself, name=3Dprop).de= lete() return @@ -119,6 +119,12 @@ class Project(models.Model): pp.blob =3D blob pp.save() =20 + def set_property(self, prop, value): + old_val =3D self.get_property(prop) + self._do_set_property(prop, value) + emit_event("SetProperty", obj=3Dself, name=3Dprop, value=3Dvalue, + old_value=3Dold_val) + def total_series_count(self): return Message.objects.series_heads(project=3Dself.name).count() =20 @@ -176,6 +182,11 @@ declare_event("SeriesComplete", project=3D"project obj= ect", =20 declare_event("MessageAdded", message=3D"message object that is added") =20 +declare_event("SetProperty", obj=3D"object to set the property", + name=3D"name of the property", + value=3D"value of the property", + old_value=3D"old value if any") + class MessageManager(models.Manager): =20 class DuplicateMessageError(Exception): @@ -408,7 +419,7 @@ class Message(models.Model): self._properties =3D r return r =20 - def set_property(self, prop, value): + def _do_set_property(self, prop, value): if value =3D=3D None: MessageProperty.objects.filter(message=3Dself, name=3Dprop).de= lete() return @@ -427,6 +438,12 @@ class Message(models.Model): if hasattr(self, '_properties'): del(self._properties) =20 + def set_property(self, prop, value): + old_val =3D self.get_property(prop) + self._do_set_property(prop, value) + emit_event("SetProperty", obj=3Dself, name=3Dprop, value=3Dvalue, + old_value=3Dold_val) + def get_sender(self): return json.loads(self.sender) =20 --=20 2.14.3 From nobody Fri Apr 26 10:19:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) client-ip=206.53.239.180; envelope-from=patchew-devel-bounce@freelists.org; helo=turing.freelists.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) smtp.mailfrom=patchew-devel-bounce@freelists.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from turing.freelists.org (turing.freelists.org [206.53.239.180]) by mx.zohomail.com with SMTPS id 1520412394181326.8177906492451; Wed, 7 Mar 2018 00:46:34 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 93518262E2; Wed, 7 Mar 2018 03:46:26 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nbjeGsoTsYSq; Wed, 7 Mar 2018 03:46:26 -0500 (EST) Received: from turing.freelists.org (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3840E260D3; Wed, 7 Mar 2018 03:46:26 -0500 (EST) Received: with ECARTIS (v1.0.0; list patchew-devel); Wed, 07 Mar 2018 03:46:26 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0BA1F262E2 for ; Wed, 7 Mar 2018 03:46:26 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 58sjCYTWPi59 for ; Wed, 7 Mar 2018 03:46:25 -0500 (EST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id DD43B260D3 for ; Wed, 7 Mar 2018 03:46:25 -0500 (EST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93EDE40363BE for ; Wed, 7 Mar 2018 08:46:25 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id E278C1C70E; Wed, 7 Mar 2018 08:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412386; bh=j4PRh4PNWO1gxzntS/rzPLZvm9YQ9FVvFqrMLUgzFz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=kaE/6dD50N+q04koWFofBgck3stEaspM595DlXjVDNgmH63JfEVcPafkPLqdrqRVy h8Pa+HEVIAYke+EaVtqZjJdiEMl1vp65dmzG7G30A1JtIzodkxJwzry+GCEtyubAZe /JSSFACjjwy4EUfsJ+aINwM7T4JXRvRuHJo+1/0Y= X-Virus-Scanned: Debian amavisd-new at turing.freelists.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412386; bh=j4PRh4PNWO1gxzntS/rzPLZvm9YQ9FVvFqrMLUgzFz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=kaE/6dD50N+q04koWFofBgck3stEaspM595DlXjVDNgmH63JfEVcPafkPLqdrqRVy h8Pa+HEVIAYke+EaVtqZjJdiEMl1vp65dmzG7G30A1JtIzodkxJwzry+GCEtyubAZe /JSSFACjjwy4EUfsJ+aINwM7T4JXRvRuHJo+1/0Y= X-Original-To: patchew-devel@freelists.org X-Virus-Scanned: Debian amavisd-new at turing.freelists.org From: Fam Zheng To: patchew-devel@freelists.org Cc: pbonzini@redhat.com Subject: [patchew-devel] [PATCH 3/7] testing: Optimized "testing-get" API call Date: Wed, 7 Mar 2018 16:46:05 +0800 Message-Id: <20180307084609.8515-4-famz@redhat.com> In-Reply-To: <20180307084609.8515-1-famz@redhat.com> References: <20180307084609.8515-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:25 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-archive-position: 87 X-ecartis-version: Ecartis v1.0.0 Sender: patchew-devel-bounce@freelists.org Errors-to: patchew-devel-bounce@freelists.org X-original-sender: famz@redhat.com Precedence: normal Reply-To: patchew-devel@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: patchew-devel X-List-ID: patchew-devel List-subscribe: List-owner: List-post: List-archive: X-list: patchew-devel X-ZohoMail-DKIM: pass (identity @freelists.org) X-ZohoMail-Owner: <20180307084609.8515-4-famz@redhat.com>+zmo_0_patchew-devel-bounce@freelists.org X-ZohoMail: RDKM_0 RSF_4 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With "testing.ready" property, we immediately mark series as "ready to test" when git apply is done, eliminating the need to do a relatively heavy search query. Signed-off-by: Fam Zheng --- mods/testing.py | 22 +++++++++++++++++----- tests/test_testing.py | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/mods/testing.py b/mods/testing.py index 47933e2..80a22a5 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -23,7 +23,7 @@ import math from api.views import APILoginRequiredView from api.models import Message, Project, MessageProperty from api.search import SearchEngine -from event import emit_event, declare_event +from event import emit_event, declare_event, register_handler from patchew.logviewer import LogView from schema import * =20 @@ -112,6 +112,16 @@ class TestingModule(PatchewModule): test=3D"test name", log=3D"test log", is_timeout=3D"whether the test has timeout") + register_handler("SetProperty", self.on_set_property) + + 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.remove_testing_properties(obj) + obj.set_property("testing.ready", 1) =20 def remove_testing_properties(self, obj, test=3D""): for k in list(obj.get_properties().keys()): @@ -174,6 +184,7 @@ class TestingModule(PatchewModule): all_tests =3D set([k for k, v in self.get_tests(obj).items() if v[= "enabled"]]) if all_tests.issubset(done_tests): obj.set_property("testing.done", True) + obj.set_property("testing.ready", None) if all_tests.issubset(done_tests): obj.set_property("testing.tested-head", head) emit_event("TestingReport", tester=3Dtester, user=3Duser.username, @@ -430,11 +441,12 @@ class TestingGetView(APILoginRequiredView): return po, td =20 def _find_series_test(self, request, po, tester, capabilities): - se =3D SearchEngine() - q =3D se.search_series("is:applied", "not:old", "not:tested", - "project:" + po.name) + q =3D MessageProperty.objects.filter(name=3D"testing.ready", + value=3D1, + message__project=3Dpo) candidate =3D None - for s in q: + for prop in q: + s =3D prop.message test =3D self._find_applicable_test(request.user, po, tester, capabilities, s) if not test: diff --git a/tests/test_testing.py b/tests/test_testing.py index cca3513..300201b 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -46,6 +46,7 @@ class TestingTest(PatchewTestCase): if log is not None: self.msg.set_property("testing.log.tests", log) self.msg.set_property("testing.done", True) + self.msg.set_property("testing.ready", None) =20 def test_basic(self): self.api_login() --=20 2.14.3 From nobody Fri Apr 26 10:19:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) client-ip=206.53.239.180; envelope-from=patchew-devel-bounce@freelists.org; helo=turing.freelists.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) smtp.mailfrom=patchew-devel-bounce@freelists.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from turing.freelists.org (turing.freelists.org [206.53.239.180]) by mx.zohomail.com with SMTPS id 1520412393775712.0448451205904; Wed, 7 Mar 2018 00:46:33 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2F1D5263CB; Wed, 7 Mar 2018 03:46:29 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zX7dAChFwLm2; Wed, 7 Mar 2018 03:46:29 -0500 (EST) Received: from turing.freelists.org (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CEA6E260D3; Wed, 7 Mar 2018 03:46:28 -0500 (EST) Received: with ECARTIS (v1.0.0; list patchew-devel); Wed, 07 Mar 2018 03:46:28 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id A49DF263CB for ; Wed, 7 Mar 2018 03:46:28 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8h0tCDaFVgi8 for ; Wed, 7 Mar 2018 03:46:28 -0500 (EST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8899C260D3 for ; Wed, 7 Mar 2018 03:46:28 -0500 (EST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A35340363BE for ; Wed, 7 Mar 2018 08:46:28 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74C8B1C724; Wed, 7 Mar 2018 08:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412389; bh=QBP292XBdQf3U/LevHtu+LLzNiqkMsOuR0pL4/KMwog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=oFo1eviONGMopfHkID2CXCTtMasv9qoO9usacYhyX7Y0yCITMKBx/FYFqO96qG+Bv HAj46M7q4e50robrBv2jMZOtfpVCgoNsNVQDkvrdo69YkjtEv3+EoVSIx48nxqMqOy j5KJsT8NoVg2Fjw6HmAV1zJ/mrb5hGR24V5dyaYw= X-Virus-Scanned: Debian amavisd-new at turing.freelists.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412389; bh=QBP292XBdQf3U/LevHtu+LLzNiqkMsOuR0pL4/KMwog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=oFo1eviONGMopfHkID2CXCTtMasv9qoO9usacYhyX7Y0yCITMKBx/FYFqO96qG+Bv HAj46M7q4e50robrBv2jMZOtfpVCgoNsNVQDkvrdo69YkjtEv3+EoVSIx48nxqMqOy j5KJsT8NoVg2Fjw6HmAV1zJ/mrb5hGR24V5dyaYw= X-Original-To: patchew-devel@freelists.org X-Virus-Scanned: Debian amavisd-new at turing.freelists.org From: Fam Zheng To: patchew-devel@freelists.org Cc: pbonzini@redhat.com Subject: [patchew-devel] [PATCH 4/7] deploy-testers: Drop user in cron task Date: Wed, 7 Mar 2018 16:46:06 +0800 Message-Id: <20180307084609.8515-5-famz@redhat.com> In-Reply-To: <20180307084609.8515-1-famz@redhat.com> References: <20180307084609.8515-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:28 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-archive-position: 88 X-ecartis-version: Ecartis v1.0.0 Sender: patchew-devel-bounce@freelists.org Errors-to: patchew-devel-bounce@freelists.org X-original-sender: famz@redhat.com Precedence: normal Reply-To: patchew-devel@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: patchew-devel X-List-ID: patchew-devel List-subscribe: List-owner: List-post: List-archive: X-list: patchew-devel X-ZohoMail-DKIM: pass (identity @freelists.org) X-ZohoMail-Owner: <20180307084609.8515-5-famz@redhat.com>+zmo_0_patchew-devel-bounce@freelists.org X-ZohoMail: RDKM_0 RSF_4 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Initially the idea was creating a parameterized user but later I decided to use the current user as specified in the ssh connection. Signed-off-by: Fam Zheng --- scripts/playbooks/deploy-testers.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/playbooks/deploy-testers.yml b/scripts/playbooks/deplo= y-testers.yml index c520acc..2aa546d 100644 --- a/scripts/playbooks/deploy-testers.yml +++ b/scripts/playbooks/deploy-testers.yml @@ -37,7 +37,6 @@ value: "./patchew-cli -s {{ patchew_server }}" - cron: name: "Patchew tester {{ instance_name }}" - user: patchew minute: "*/10" job: "{ $PATCHEW login tester $(cat .patchew-tester-pass); $PATCHE= W tester --name {{ instance_name }} --singleton -p {{ tester_project }}; } = >>$HOME/patchew-tester.log 2>&1" =20 --=20 2.14.3 From nobody Fri Apr 26 10:19:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) client-ip=206.53.239.180; envelope-from=patchew-devel-bounce@freelists.org; helo=turing.freelists.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) smtp.mailfrom=patchew-devel-bounce@freelists.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from turing.freelists.org (turing.freelists.org [206.53.239.180]) by mx.zohomail.com with SMTPS id 152041239267742.72278573547419; Wed, 7 Mar 2018 00:46:32 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0155826512; Wed, 7 Mar 2018 03:46:32 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2_KjOYblqRN5; Wed, 7 Mar 2018 03:46:31 -0500 (EST) Received: from turing.freelists.org (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 9FD86260D3; Wed, 7 Mar 2018 03:46:31 -0500 (EST) Received: with ECARTIS (v1.0.0; list patchew-devel); Wed, 07 Mar 2018 03:46:31 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7547526512 for ; Wed, 7 Mar 2018 03:46:31 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0nUhdRGWwrTD for ; Wed, 7 Mar 2018 03:46:31 -0500 (EST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 59189260D3 for ; Wed, 7 Mar 2018 03:46:31 -0500 (EST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 053D140363BE for ; Wed, 7 Mar 2018 08:46:31 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id D71AB1C716; Wed, 7 Mar 2018 08:46:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412392; bh=qVVIlNcgvcAxWYPLQKmf5J2tRKd/kO9F8KqYDl5QiZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=r4mDtUOe7/6QhIPvJbG0AZEyaTlacRKFJeymWAzvvYyuqw+Do/DcVn15rdZcwir0A VTCatAmQNFuLO/wg0MGNHGEJ/2gz6Cm4AGg103h2Aqq4MDQL485C95jRAGcJPABZ5T 2Y4EeUXPj3uQ91OblKJ5sNzBzyeinc5LuH14kBW8= X-Virus-Scanned: Debian amavisd-new at turing.freelists.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412391; bh=qVVIlNcgvcAxWYPLQKmf5J2tRKd/kO9F8KqYDl5QiZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=n+hMXJqARwSq2quVabdkMNPVwdV8FhVtcwvnAr+WpGROmbFRf6aXLIfObZnOzcPU0 JKETJMlZAxZjNyFQ26Ka+pEb4v44n5jZpsNJooRYQF6ns03jO1wbGq5fUyDtaVux5C kv5THOxQXcTU2qQxQ55heRm64rJNpOF7Neh0EIaw= X-Original-To: patchew-devel@freelists.org X-Virus-Scanned: Debian amavisd-new at turing.freelists.org From: Fam Zheng To: patchew-devel@freelists.org Cc: pbonzini@redhat.com Subject: [patchew-devel] [PATCH 5/7] testing: Use testing.ready property for project HEAD test Date: Wed, 7 Mar 2018 16:46:07 +0800 Message-Id: <20180307084609.8515-6-famz@redhat.com> In-Reply-To: <20180307084609.8515-1-famz@redhat.com> References: <20180307084609.8515-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:31 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-archive-position: 89 X-ecartis-version: Ecartis v1.0.0 Sender: patchew-devel-bounce@freelists.org Errors-to: patchew-devel-bounce@freelists.org X-original-sender: famz@redhat.com Precedence: normal Reply-To: patchew-devel@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: patchew-devel X-List-ID: patchew-devel List-subscribe: List-owner: List-post: List-archive: X-list: patchew-devel X-ZohoMail-DKIM: pass (identity @freelists.org) (identity @freelists.org) X-ZohoMail-Owner: <20180307084609.8515-6-famz@redhat.com>+zmo_0_patchew-devel-bounce@freelists.org X-ZohoMail: RDKM_0 RSF_4 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The previous conditions were broken: tests don't run after git head moves. Adpot the "testing.ready" approach here too to fix it. Signed-off-by: Fam Zheng --- mods/testing.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/testing.py b/mods/testing.py index 80a22a5..ff07918 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -122,6 +122,10 @@ class TestingModule(PatchewModule): and obj.get_property("git.tag") and obj.get_property("git.repo= "): self.remove_testing_properties(obj) obj.set_property("testing.ready", 1) + elif isinstance(obj, Project) and name =3D=3D "git.head" \ + and old_value !=3D value: + self.remove_testing_properties(obj) + obj.set_property("testing.ready", 1) =20 def remove_testing_properties(self, obj, test=3D""): for k in list(obj.get_properties().keys()): @@ -428,6 +432,8 @@ class TestingGetView(APILoginRequiredView): obj.set_property("testing.done", True) =20 def _find_project_test(self, request, po, tester, capabilities): + if not po.get_property("testing.ready"): + return head =3D po.get_property("git.head") repo =3D po.git tested =3D po.get_property("testing.tested-head") --=20 2.14.3 From nobody Fri Apr 26 10:19:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) client-ip=206.53.239.180; envelope-from=patchew-devel-bounce@freelists.org; helo=turing.freelists.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) smtp.mailfrom=patchew-devel-bounce@freelists.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from turing.freelists.org (turing.freelists.org [206.53.239.180]) by mx.zohomail.com with SMTPS id 152041239494957.47266820731454; Wed, 7 Mar 2018 00:46:34 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5D216262E2; Wed, 7 Mar 2018 03:46:34 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Ar_Q7O49wKg; Wed, 7 Mar 2018 03:46:34 -0500 (EST) Received: from turing.freelists.org (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 08708260D3; Wed, 7 Mar 2018 03:46:33 -0500 (EST) Received: with ECARTIS (v1.0.0; list patchew-devel); Wed, 07 Mar 2018 03:46:33 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CFFDC26352 for ; Wed, 7 Mar 2018 03:46:33 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id diiyakD01bRh for ; Wed, 7 Mar 2018 03:46:33 -0500 (EST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id B480F260D3 for ; Wed, 7 Mar 2018 03:46:33 -0500 (EST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 590CA404008D for ; Wed, 7 Mar 2018 08:46:33 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id AAB541C70E; Wed, 7 Mar 2018 08:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412394; bh=8sfR6Jyadw3eo01ytC/FdfrApsWD8GJlw2ZBMxfQ42w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=okwDdoTiUbQsqqFD30FEzKSfZr8QnMdlpzlQrNsH+d3dYGPoMHy+WWVBhXEnZF6Xi s4R5Yy407aakZB0k+P1aTA018uNzg0NNmOBKpwqKa+Wlz7ebEngCH04AYFZaw+ci/M DB9xDVa41pTAfhexyLOdiCRbsgihivD2JQ54rmhU= X-Virus-Scanned: Debian amavisd-new at turing.freelists.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412394; bh=8sfR6Jyadw3eo01ytC/FdfrApsWD8GJlw2ZBMxfQ42w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=okwDdoTiUbQsqqFD30FEzKSfZr8QnMdlpzlQrNsH+d3dYGPoMHy+WWVBhXEnZF6Xi s4R5Yy407aakZB0k+P1aTA018uNzg0NNmOBKpwqKa+Wlz7ebEngCH04AYFZaw+ci/M DB9xDVa41pTAfhexyLOdiCRbsgihivD2JQ54rmhU= X-Original-To: patchew-devel@freelists.org X-Virus-Scanned: Debian amavisd-new at turing.freelists.org From: Fam Zheng To: patchew-devel@freelists.org Cc: pbonzini@redhat.com Subject: [patchew-devel] [PATCH 6/7] api: Don't append None into updated_series list Date: Wed, 7 Mar 2018 16:46:08 +0800 Message-Id: <20180307084609.8515-7-famz@redhat.com> In-Reply-To: <20180307084609.8515-1-famz@redhat.com> References: <20180307084609.8515-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 07 Mar 2018 08:46:33 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-archive-position: 90 X-ecartis-version: Ecartis v1.0.0 Sender: patchew-devel-bounce@freelists.org Errors-to: patchew-devel-bounce@freelists.org X-original-sender: famz@redhat.com Precedence: normal Reply-To: patchew-devel@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: patchew-devel X-List-ID: patchew-devel List-subscribe: List-owner: List-post: List-archive: X-list: patchew-devel X-ZohoMail-DKIM: pass (identity @freelists.org) X-ZohoMail-Owner: <20180307084609.8515-7-famz@redhat.com>+zmo_0_patchew-devel-bounce@freelists.org X-ZohoMail: RDKM_0 RSF_4 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- api/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/views.py b/api/views.py index 042aea0..27c8775 100644 --- a/api/views.py +++ b/api/views.py @@ -137,7 +137,9 @@ class UpdateProjectHeadView(APILoginRequiredView): ret +=3D 1 mo.is_merged =3D True mo.save() - updated_series.append(mo.get_series_head()) + s =3D mo.get_series_head() + if s: + updated_series.append(s) for s in updated_series: merged =3D True for p in s.get_patches(): --=20 2.14.3 From nobody Fri Apr 26 10:19:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) client-ip=206.53.239.180; envelope-from=patchew-devel-bounce@freelists.org; helo=turing.freelists.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zoho.com: 206.53.239.180 is neither permitted nor denied by domain of freelists.org) smtp.mailfrom=patchew-devel-bounce@freelists.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from turing.freelists.org (turing.freelists.org [206.53.239.180]) by mx.zohomail.com with SMTPS id 1520412397379927.8949450077932; Wed, 7 Mar 2018 00:46:37 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C7ABB26352; Wed, 7 Mar 2018 03:46:36 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R4TINhDCtDB4; Wed, 7 Mar 2018 03:46:36 -0500 (EST) Received: from turing.freelists.org (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6DFFD260D3; Wed, 7 Mar 2018 03:46:36 -0500 (EST) Received: with ECARTIS (v1.0.0; list patchew-devel); Wed, 07 Mar 2018 03:46:36 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4348326352 for ; Wed, 7 Mar 2018 03:46:36 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UPtJ1lniXNbV for ; Wed, 7 Mar 2018 03:46:36 -0500 (EST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 19C5B260D3 for ; Wed, 7 Mar 2018 03:46:36 -0500 (EST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B01B64023B98 for ; Wed, 7 Mar 2018 08:46:35 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-131.pek2.redhat.com [10.72.12.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 277DF1C716; Wed, 7 Mar 2018 08:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412396; bh=3divtXa8x5Robhh84g0g3JeSYeH4lDQmD3lAtPxxIcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=afm1p09LIa7SofwuhVkJ5h9kmkr+oPeChbHNj8giWSsTJKZnkPVPjCYnoYBCTCR9w alqvzSJ4j224aBdksePDMrMjFdiwx3B0j+/I/hDHZ/oggoq37PbUsOz4r/ZXVRDvw+ gOBXFUKBtXz4UsLNNh1ANS3pocolxDubXHol7xF4= X-Virus-Scanned: Debian amavisd-new at turing.freelists.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org; s=turing; t=1520412396; bh=3divtXa8x5Robhh84g0g3JeSYeH4lDQmD3lAtPxxIcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:List-help: List-unsubscribe:List-Id:List-subscribe:List-owner:List-post: List-archive; b=afm1p09LIa7SofwuhVkJ5h9kmkr+oPeChbHNj8giWSsTJKZnkPVPjCYnoYBCTCR9w alqvzSJ4j224aBdksePDMrMjFdiwx3B0j+/I/hDHZ/oggoq37PbUsOz4r/ZXVRDvw+ gOBXFUKBtXz4UsLNNh1ANS3pocolxDubXHol7xF4= X-Original-To: patchew-devel@freelists.org X-Virus-Scanned: Debian amavisd-new at turing.freelists.org From: Fam Zheng To: patchew-devel@freelists.org Cc: pbonzini@redhat.com Subject: [patchew-devel] [PATCH 7/7] tester: Test multiple projects Date: Wed, 7 Mar 2018 16:46:09 +0800 Message-Id: <20180307084609.8515-8-famz@redhat.com> In-Reply-To: <20180307084609.8515-1-famz@redhat.com> References: <20180307084609.8515-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 07 Mar 2018 08:46:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 07 Mar 2018 08:46:35 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-archive-position: 91 X-ecartis-version: Ecartis v1.0.0 Sender: patchew-devel-bounce@freelists.org Errors-to: patchew-devel-bounce@freelists.org X-original-sender: famz@redhat.com Precedence: normal Reply-To: patchew-devel@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: patchew-devel X-List-ID: patchew-devel List-subscribe: List-owner: List-post: List-archive: X-list: patchew-devel X-ZohoMail-DKIM: pass (identity @freelists.org) X-ZohoMail-Owner: <20180307084609.8515-8-famz@redhat.com>+zmo_0_patchew-devel-bounce@freelists.org X-ZohoMail: RDKM_0 RSF_4 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Allow project list in --project option, and round-robin test them one by one. Signed-off-by: Fam Zheng --- patchew-cli | 50 +++++++++++++++++++++---------------- tests/test_testing.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++-= ---- 2 files changed, 92 insertions(+), 27 deletions(-) diff --git a/patchew-cli b/patchew-cli index 52329e1..51a89c5 100755 --- a/patchew-cli +++ b/patchew-cli @@ -449,13 +449,15 @@ class TesterCommand(SubCommand): parser.add_argument("--singleton", "-S", action=3D"store_true", help=3D"quit if another singleton mode tester = is running") parser.add_argument("--project", "-p", required=3DTrue, - help=3D"which project to run test") + help=3D"comma separated project names to run t= est") parser.add_argument("--name", "-n", help=3D"name of this tester (default is the lo= gged in username)") parser.add_argument("--num", "-N", type=3Dint, default=3D0, help=3D"max number of tests to run") parser.add_argument("--no-clean-up", action=3D"store_true", help=3D"skip cleaning up after finish") + parser.add_argument("--no-wait", action=3D"store_true", + help=3D"don't wait if nothing to test") =20 def _make_script(self, wd, name, content): filename =3D os.path.join(wd, name) @@ -484,17 +486,18 @@ class TesterCommand(SubCommand): pass return ret =20 - def test_one(self, args, capabilities): - r =3D self.api_do("testing-get", project=3Dargs.project, tester=3D= args.name, - capabilities=3Dcapabilities) + def test_one(self, name, project, no_clean_up, capabilities): + r =3D self.api_do("testing-get", project=3Dproject, tester=3Dname, + capabilities=3Dcapabilities) if not r: return False print("Running test '%s'" % r["test"]["name"]) - if r["project"] !=3D args.project: + if r["project"] !=3D project: return =20 wd =3D tempfile.mkdtemp(prefix=3D"patchew-tester-tmp-", dir=3D"/va= r/tmp/") print(" Workdir:", wd) + print(" Project:", r["project"]) print(" Identity:", str(r["identity"])) logf =3D open(os.path.join(wd, "log"), "w+", encoding=3D"utf-8", errors=3D"ignore") @@ -565,7 +568,7 @@ class TesterCommand(SubCommand): self.api_do("testing-report", project=3Dr["project"], identity=3Dr["identity"], test=3Dr["test"]["name"], - tester=3Dargs.name, + tester=3Dname, head=3Dr["head"], base=3Dr["base"], passed=3Dpassed, @@ -573,7 +576,7 @@ class TesterCommand(SubCommand): is_timeout=3Dis_timeout) logf.close() finally: - if not args.no_clean_up: + if not no_clean_up: shutil.rmtree(wd) return True =20 @@ -591,25 +594,30 @@ class TesterCommand(SubCommand): if args.singleton: self._check_singleton() subprocess.check_output(["git", "version"]) - rest =3D False count =3D 0 cap_refresh =3D 10 + projects =3D [x.strip() for x in args.project.split(",") if len(x.= strip())] + if not projects: + raise Exception("No project specified") + capabilities =3D {} while True: - if count % cap_refresh =3D=3D 0: - capabilities =3D self._refresh_capabilities(args.project, - args.name) - count +=3D 1 - if self.test_one(args, capabilities=3Dcapabilities): + progress =3D False + for p in projects: + if count % cap_refresh =3D=3D 0: + for sp in projects: + capabilities[sp] =3D self._refresh_capabilities(sp= , args.name) + if self.test_one(args.name, p, args.no_clean_up, + capabilities=3Dcapabilities[p]): + progress =3D True + count +=3D 1 if count =3D=3D args.num: - break - rest =3D False - continue - if count =3D=3D args.num: - break - if not rest: + return 0 + if not progress: + if args.no_wait: + print("Nothing to test") + return 0 print("No more work, having a rest...") - rest =3D True - time.sleep(60) + time.sleep(60) return 0 =20 class ApplyFailedException(Exception): diff --git a/tests/test_testing.py b/tests/test_testing.py index 300201b..a68e237 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -11,10 +11,20 @@ import sys import os import datetime +import subprocess sys.path.append(os.path.dirname(__file__)) from patchewtest import PatchewTestCase, main from api.models import Message, Project =20 +def create_test(project, name): + prefix =3D "testing.tests." + name + "." + project.set_property(prefix + "timeout", 3600) + project.set_property(prefix + "enabled", True) + project.set_property(prefix + "script", "#!/bin/bash\ntrue") + project.set_property(prefix + "requirements", "") + project.set_property(prefix + "users", "") + project.set_property(prefix + "tester", "") + class TestingTest(PatchewTestCase): =20 def setUp(self): @@ -22,12 +32,7 @@ class TestingTest(PatchewTestCase): self.p =3D self.add_project("QEMU", "qemu-devel@nongnu.org") self.PROJECT_BASE =3D '%sprojects/%d/' % (self.REST_BASE, self.p.i= d) =20 - self.p.set_property("testing.tests.a.timeout", 3600) - self.p.set_property("testing.tests.a.enabled", True) - self.p.set_property("testing.tests.a.script", "#!/bin/bash\ntrue") - self.p.set_property("testing.tests.a.requirements", "") - self.p.set_property("testing.tests.a.users", "") - self.p.set_property("testing.tests.a.tester", "") + create_test(self.p, "a") =20 self.cli_login() self.cli_import('0001-simple-patch.mbox.gz') @@ -85,5 +90,57 @@ class TestingTest(PatchewTestCase): self.assertEquals(log.status_code, 200) self.assertEquals(log.content, b'sorry no good') =20 +class TesterTest(PatchewTestCase): + + def setUp(self): + self.create_superuser() + + p1 =3D self.add_project("QEMU", "qemu-devel@nongnu.org") + create_test(p1, "a") + p2 =3D self.add_project("UMEQ", "qemu-devel@nongnu.org") + create_test(p2, "b") + + self.cli_login() + self.cli_import('0001-simple-patch.mbox.gz') + self.cli_logout() + + 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"]: + subprocess.check_output(["touch", f], cwd=3Dself.repo) + subprocess.check_output(["git", "add", f], cwd=3Dself.repo) + subprocess.check_output(["git", "commit", "-m", "add " + f], + cwd=3Dself.repo) + base =3D subprocess.check_output(["git", "rev-parse", "HEAD~1"], + cwd=3Dself.repo).decode() + subprocess.check_output(["git", "tag", "test"], cwd=3Dself.repo) + + 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 test_tester(self): + self.cli_login() + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + "--no-wait"]) + self.assertIn("Project: QEMU\n", out) + self.assertIn("Project: UMEQ\n", out) + self.cli_logout() + + def test_tester_single(self): + self.cli_login() + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + "--no-wait", "-N", "1"]) + self.assertIn("Project: QEMU\n", out) + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + "--no-wait", "-N", "1"]) + self.assertIn("Project: UMEQ\n", out) + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + "--no-wait", "-N", "1"]) + self.assertIn("Nothing to test", out) + self.cli_logout() + if __name__ =3D=3D '__main__': main() --=20 2.14.3