From nobody Sat Apr 20 01:03:30 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 1532663990364748.1136900334762; Thu, 26 Jul 2018 20:59:50 -0700 (PDT) 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 0210A4901F; Fri, 27 Jul 2018 03:59:49 +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 E96683797; Fri, 27 Jul 2018 03:59:48 +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 DE5B64BB78; Fri, 27 Jul 2018 03:59:48 +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 w6R3xkUL018638 for ; Thu, 26 Jul 2018 23:59:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id D20A2111DD10; Fri, 27 Jul 2018 03:59:46 +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 6D185111DD04; Fri, 27 Jul 2018 03:59:45 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:24 +0800 Message-Id: <20180727035934.32555-2-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 01/11] testing: Avoid masking out outter iterator r 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.38]); Fri, 27 Jul 2018 03:59:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The 'r' we want to yield is the object in queryset. Avoid overwriting it with a requirement string. Signed-off-by: Fam Zheng --- mods/testing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/testing.py b/mods/testing.py index 0a80b3d..70b4674 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -409,8 +409,8 @@ class TestingGetView(APILoginRequiredView): if not t: continue reqs =3D t.get("requirements", "") - for r in [x.strip() for x in reqs.split(",") if x]: - if r not in capabilities: + for req in [x.strip() for x in reqs.split(",") if x]: + if req not in capabilities: break else: yield r, t --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532663991925139.8921438302906; Thu, 26 Jul 2018 20:59:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9ADC3082A4D; Fri, 27 Jul 2018 03:59:50 +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 AC33D612A8; Fri, 27 Jul 2018 03:59:50 +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 9EDD84BB78; Fri, 27 Jul 2018 03:59:50 +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 w6R3xnic018648 for ; Thu, 26 Jul 2018 23:59:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0B656111DD10; Fri, 27 Jul 2018 03:59:49 +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 8774B111DD04; Fri, 27 Jul 2018 03:59:47 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:25 +0800 Message-Id: <20180727035934.32555-3-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 02/11] cli: Default -N of tester command to -1 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 27 Jul 2018 03:59:50 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is a more appropriate value for "run forever", because 0 could result in an unexpected early return in the loop when there is no test to run. Signed-off-by: Fam Zheng --- patchew-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchew-cli b/patchew-cli index 174d1e6..f4539a7 100755 --- a/patchew-cli +++ b/patchew-cli @@ -452,7 +452,7 @@ class TesterCommand(SubCommand): 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, + parser.add_argument("--num", "-N", type=3Dint, default=3D-1, 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") --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532663999723795.6989677435096; Thu, 26 Jul 2018 20:59:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13DE4369CC; Fri, 27 Jul 2018 03:59:53 +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 062E22010CC1; Fri, 27 Jul 2018 03:59:53 +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 EE3774BB78; Fri, 27 Jul 2018 03:59:52 +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 w6R3xplY018659 for ; Thu, 26 Jul 2018 23:59:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A62E111DD09; Fri, 27 Jul 2018 03:59:51 +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 B3516111DD04; Fri, 27 Jul 2018 03:59:49 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:26 +0800 Message-Id: <20180727035934.32555-4-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 03/11] deploy-testers: Allow deploy with normal user access 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 27 Jul 2018 03:59:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Ansible "become" and "/data" basically requires root access to the tester machine, but that is not always the case. Tweak the playbook a bit to allow that. Signed-off-by: Fam Zheng --- scripts/playbooks/deploy-testers.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/playbooks/deploy-testers.yml b/scripts/playbooks/deplo= y-testers.yml index ae3ab0b..7b375db 100644 --- a/scripts/playbooks/deploy-testers.yml +++ b/scripts/playbooks/deploy-testers.yml @@ -23,7 +23,7 @@ default: patchew private: no vars: - base_dir: "/data/{{ instance_name }}" + base_dir: "{{ instance_name }}" src_dir: "{{ base_dir }}/src" patchew_cmd: "{{ src_dir }}/patchew-cli -s {{ patchew_server }}" tasks: @@ -52,16 +52,10 @@ - "--exclude=3D/venv" - name: Generate password file shell: "echo {{ tester_pass }} > $HOME/.patchew-tester-pass" - become: true - become_user: "{{ cron_user }}" - name: Login with patchew-cli shell: "{{ patchew_cmd }} login {{ tester_user }} $(cat $HOME/.patch= ew-tester-pass)" - become: true - become_user: "{{ cron_user }}" - name: Logout with patchew-cli shell: "{{ patchew_cmd }} logout" - become: true - become_user: "{{ cron_user }}" - name: Define PATCHEW env in cron cron: name: PATCHEW --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532664003025332.05614337390534; Thu, 26 Jul 2018 21:00:03 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF675356C3; Fri, 27 Jul 2018 03:59:54 +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 BE6EB60851; Fri, 27 Jul 2018 03:59:54 +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 B06B118052E9; Fri, 27 Jul 2018 03:59:54 +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 w6R3xrGS018669 for ; Thu, 26 Jul 2018 23:59:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5399D111DD09; Fri, 27 Jul 2018 03:59:53 +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 E41C6111DD04; Fri, 27 Jul 2018 03:59:51 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:27 +0800 Message-Id: <20180727035934.32555-5-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 04/11] models: Add ResultUpdate event 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 27 Jul 2018 03:59:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- api/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/models.py b/api/models.py index ebaecde..ad89cf8 100644 --- a/api/models.py +++ b/api/models.py @@ -78,7 +78,11 @@ class Result(models.Model): =20 def save(self): self.last_update =3D datetime.datetime.utcnow() - return super(Result, self).save() + old_result =3D Result.objects.filter(pk=3Dself.pk).first() + old_status =3D old_result.status if old_result else None + r =3D super(Result, self).save() + emit_event("ResultUpdate", obj=3Dself.obj, + old_status=3Dold_status, result=3Dself) =20 @property def renderer(self): @@ -300,6 +304,10 @@ declare_event("SetProperty", obj=3D"object to set the = property", value=3D"value of the property", old_value=3D"old value if any") =20 +declare_event("ResultUpdate", obj=3D"the updated object", + old_status=3D'the old result status', + result=3D"the new result object") + class MessageManager(models.Manager): =20 class DuplicateMessageError(Exception): --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532663998481962.8841916402589; Thu, 26 Jul 2018 20:59:58 -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 2689630841AB; Fri, 27 Jul 2018 03:59:57 +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 183F7600C4; Fri, 27 Jul 2018 03:59:57 +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 09F6918052E9; Fri, 27 Jul 2018 03:59:57 +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 w6R3xt4e018680 for ; Thu, 26 Jul 2018 23:59:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6A9FC111DD10; Fri, 27 Jul 2018 03:59:55 +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 08BCF111DD04; Fri, 27 Jul 2018 03:59:53 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:28 +0800 Message-Id: <20180727035934.32555-6-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 05/11] testing: Fix git info for testing-get method 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.40]); Fri, 27 Jul 2018 03:59:57 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Git properties are no longer there, we have to go for the Result object. Signed-off-by: Fam Zheng --- mods/testing.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/testing.py b/mods/testing.py index 70b4674..3403e8b 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -377,10 +377,12 @@ class TestingGetView(APILoginRequiredView): return r =20 def _generate_series_test_data(self, s, test): + gr =3D s.git_result + assert gr.is_success() return self._generate_test_data(project=3Ds.project.name, - repo=3Ds.get_property("git.repo"), - head=3Ds.get_property("git.tag"), - base=3Ds.get_property("git.base"), + repo=3Dgr.data["repo"], + head=3Dgr.data["tag"], + base=3Dgr.data.get("base", None), identity=3D{ "type": "series", "message-id": s.message_id, --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532664000345617.0152416626438; Thu, 26 Jul 2018 21:00:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3454783F3E; Fri, 27 Jul 2018 03:59:59 +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 2698C2010CC1; Fri, 27 Jul 2018 03:59:59 +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 1B2F018052E9; Fri, 27 Jul 2018 03:59:59 +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 w6R3xvVj018690 for ; Thu, 26 Jul 2018 23:59:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8FF1D111DD10; Fri, 27 Jul 2018 03:59:57 +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 20E73111DD04; Fri, 27 Jul 2018 03:59:55 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:29 +0800 Message-Id: <20180727035934.32555-7-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 06/11] testing: Reset testing upon git result update 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 27 Jul 2018 03:59:59 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Similar has been done in SetProperty handler but recently the git properties we listen to were converted into a Result record. So we have to watch that. Signed-off-by: Fam Zheng --- mods/testing.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mods/testing.py b/mods/testing.py index 3403e8b..82b8c80 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -106,6 +106,7 @@ class TestingModule(PatchewModule): html_log_url=3D"URL to test log (HTML)", is_timeout=3D"whether the test has timeout") register_handler("SetProperty", self.on_set_property) + 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) \ @@ -121,6 +122,16 @@ class TestingModule(PatchewModule): and old_value !=3D value: self.recalc_pending_tests(obj) =20 + def on_result_update(self, evt, obj, old_status, result): + 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"): + self.clear_and_start_testing(obj) + def get_testing_results(self, obj, *args, **kwargs): return obj.results.filter(name__startswith=3D'testing.', *args, **= kwargs) =20 --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532664002256458.3716910194412; Thu, 26 Jul 2018 21:00:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EE775D5E6; Fri, 27 Jul 2018 04:00:01 +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 F001560BE5; Fri, 27 Jul 2018 04:00:00 +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 E2DC318052E9; Fri, 27 Jul 2018 04:00:00 +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 w6R3xx2n018701 for ; Thu, 26 Jul 2018 23:59:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id B520C111DD09; Fri, 27 Jul 2018 03:59:59 +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 44DCD111DD04; Fri, 27 Jul 2018 03:59:57 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:30 +0800 Message-Id: <20180727035934.32555-8-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 07/11] testing: Move do_apply to base class 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 27 Jul 2018 04:00:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- tests/patchewtest.py | 5 +++++ tests/test_git.py | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/patchewtest.py b/tests/patchewtest.py index 5bed3b9..9d34555 100644 --- a/tests/patchewtest.py +++ b/tests/patchewtest.py @@ -100,6 +100,11 @@ class PatchewTestCase(django.test.LiveServerTestCase): def cli_import(self, mbox, rc=3D0): self.check_cli(["import", self.get_data_path(mbox)], rc) =20 + def do_apply(self): + self.cli(["apply", "--applier-mode"]) + for s in Message.objects.series_heads(): + self.assertNotEqual(s.git_result.status, Result.PENDING) + def get_data_path(self, fname): r =3D tempfile.NamedTemporaryFile(dir=3DRUN_DIR, prefix=3D"test-da= ta-", delete=3DFalse) d =3D os.path.join(BASE_DIR, "tests", "data", fname) diff --git a/tests/test_git.py b/tests/test_git.py index b2802d5..31e9823 100755 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -31,11 +31,6 @@ class GitTest(PatchewTestCase): def cleanUp(self): shutil.rmtree(self.repo) =20 - def do_apply(self): - self.cli(["apply", "--applier-mode"]) - for s in Message.objects.series_heads(): - self.assertNotEqual(s.git_result.status, Result.PENDING) - def test_need_apply(self): self.cli_import("0001-simple-patch.mbox.gz") s =3D Message.objects.series_heads()[0] --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532664009537801.436977061367; Thu, 26 Jul 2018 21:00:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 573A432B690; Fri, 27 Jul 2018 04:00:08 +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 422F261289; Fri, 27 Jul 2018 04:00:08 +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 302A34BB78; Fri, 27 Jul 2018 04:00:08 +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 w6R406A3018717 for ; Fri, 27 Jul 2018 00:00:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id CC3BC111C4AB; Fri, 27 Jul 2018 04:00:06 +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 25844111DD04; Fri, 27 Jul 2018 04:00:00 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:31 +0800 Message-Id: <20180727035934.32555-9-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 08/11] tests: Create repo automatically for projects 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 27 Jul 2018 04:00:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" They are likely useful for git and testing related cases, so do it automatically. Signed-off-by: Fam Zheng --- tests/patchewtest.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/patchewtest.py b/tests/patchewtest.py index 9d34555..d41793e 100644 --- a/tests/patchewtest.py +++ b/tests/patchewtest.py @@ -118,8 +118,12 @@ class PatchewTestCase(django.test.LiveServerTestCase): return Project.objects.all() =20 def add_project(self, name, mailing_list=3D"", git_repo=3D""): - p =3D Project(name=3Dname, mailing_list=3Dmailing_list, git=3Dgit_= repo) + p =3D Project(name=3Dname, mailing_list=3Dmailing_list, git=3Dgit_= repo or self.create_git_repo(name)) p.save() + push_repo =3D self.create_git_repo(name + "_push") + p.set_property("git.push_to", push_repo) + p.set_property("git.public_repo", push_repo) + p.set_property("git.url_template", push_repo) return p =20 def api_login(self): @@ -146,10 +150,13 @@ class PatchewTestCase(django.test.LiveServerTestCase): repo =3D os.path.join(self.get_tmpdir(), name) os.mkdir(repo) subprocess.check_output(["git", "init"], cwd=3Drepo) - subprocess.check_output(["touch", "foo"], cwd=3Drepo) + subprocess.check_output(["touch", "foo", "bar"], cwd=3Drepo) subprocess.check_output(["git", "add", "foo"], cwd=3Drepo) subprocess.check_output(["git", "commit", "-m", "initial commit"], cwd=3Drepo) + subprocess.check_output(["git", "add", "bar"], cwd=3Drepo) + subprocess.check_output(["git", "commit", "-m", "another commit"], + cwd=3Drepo) return repo =20 def parse_args(): --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 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 From nobody Sat Apr 20 01:03:30 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 15326640152121007.3696857967502; Thu, 26 Jul 2018 21:00:15 -0700 (PDT) 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 EE502307D869; Fri, 27 Jul 2018 04:00:13 +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 D7AC43797; Fri, 27 Jul 2018 04:00:13 +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 C921C4BB78; Fri, 27 Jul 2018 04:00:13 +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 w6R40CK5018739 for ; Fri, 27 Jul 2018 00:00:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6D6E0111C4BD; Fri, 27 Jul 2018 04:00:12 +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 CC706111C4AB; Fri, 27 Jul 2018 04:00:10 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:33 +0800 Message-Id: <20180727035934.32555-11-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 10/11] docker: Unlimited restart of systemd service 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.48]); Fri, 27 Jul 2018 04:00:14 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Sleeping for 60 seconds makes sure we don't hog the machine, and keep retrying helps us survive transient network issues. The patch is not tested, I just referenced systemd document for it. Signed-off-by: Fam Zheng --- scripts/playbooks/templates/docker.service.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/playbooks/templates/docker.service.j2 b/scripts/playbo= oks/templates/docker.service.j2 index 45d2871..afd5df1 100644 --- a/scripts/playbooks/templates/docker.service.j2 +++ b/scripts/playbooks/templates/docker.service.j2 @@ -2,6 +2,7 @@ Description=3DPatchew docker instance control service for {{ instance_name= }} Requires=3Ddocker.service After=3Ddocker.service +StartLimitIntervalSec=3D0 =20 [Service] Restart=3Dalways @@ -11,6 +12,7 @@ ExecStart=3D/usr/bin/docker run --privileged --name {{ in= stance_name }} \ -e PATCHEW_DATA_DIR=3D/data/patchew \ patchew:{{ instance_name }} ExecStop=3D/usr/bin/docker stop -t 10 {{ instance_name }} +RestartSec=3D60 =20 [Install] WantedBy=3Ddefault.target --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:03:30 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 1532664018796629.5837092460656; Thu, 26 Jul 2018 21:00:18 -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 09C7F821C7; Fri, 27 Jul 2018 04:00:17 +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 EB729600C5; Fri, 27 Jul 2018 04:00:16 +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 D9C2F4BB78; Fri, 27 Jul 2018 04:00:16 +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 w6R40FNV018749 for ; Fri, 27 Jul 2018 00:00:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C73A111C4BE; Fri, 27 Jul 2018 04:00:15 +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 58DB3111C4AB; Fri, 27 Jul 2018 04:00:13 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:34 +0800 Message-Id: <20180727035934.32555-12-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 11/11] tests: Use requirements in test 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.28]); Fri, 27 Jul 2018 04:00:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- tests/test_testing.py | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/tests/test_testing.py b/tests/test_testing.py index c1a1c94..7a40ec3 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -16,12 +16,12 @@ sys.path.append(os.path.dirname(__file__)) from tests.patchewtest import PatchewTestCase, main from api.models import Message, Result =20 -def create_test(project, name): +def create_test(project, name, requirements=3D""): 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 + "requirements", requirements) =20 class TestingTestCase(PatchewTestCase, metaclass=3Dabc.ABCMeta): =20 @@ -197,17 +197,31 @@ class TesterTest(PatchewTestCase): 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.p3 =3D self.add_project("ALLOW", "qemu-devel@nongnu.org") + self.p3.set_property("testing.requirements.allow.script", + "#!/bin/sh\ntrue") + create_test(self.p3, "c", "allow") + + self.p4 =3D self.add_project("DENY", "qemu-devel@nongnu.org") + self.p4.set_property("testing.requirements.deny.script", + "#!/bin/sh\nfalse") + create_test(self.p4, "d", "deny") + self.cli_login() self.cli_import('0013-foo-patch.mbox.gz') self.cli_logout() =20 self.update_head(self.p1) self.update_head(self.p2) + self.update_head(self.p3) + self.update_head(self.p4) base =3D subprocess.check_output(["git", "rev-parse", "HEAD~1"], cwd=3Dself.repo).decode() subprocess.check_output(["git", "tag", "test"], cwd=3Dself.repo) @@ -225,41 +239,48 @@ class TesterTest(PatchewTestCase): =20 def test_tester(self): self.cli_login() - out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", "--no-wait"]) self.assertIn("Project: QEMU\n", out) self.assertIn("Project: UMEQ\n", out) + self.assertIn("Project: ALLOW\n", out) + 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", + 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", + 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", + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", + "--no-wait", "-N", "1"]) + self.assertIn("Project: ALLOW\n", out) + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", "--no-wait", "-N", "1"]) self.assertIn("Nothing to test", out) self.cli_logout() =20 def test_tester_project(self): self.cli_login() - out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", "--no-wait"]) self.assertIn("Project: QEMU\n", out) self.assertIn("Project: UMEQ\n", out) + self.assertIn("Project: ALLOW\n", out) + self.assertNotIn("Project: DENY\n", out) =20 self.p1.git =3D self.repo self.p1.save() self.add_file_and_commit("baz") self.update_head(self.p1) - out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", "--no-wait", "-N", "1"]) self.assertIn("Project: QEMU\n", out) self.assertIn("'type': 'project'", out) - out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ", + out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", "--no-wait", "-N", "1"]) self.assertIn("Nothing to test", out) self.cli_logout() --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel