From patchwork Thu Jul 2 15:22:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 91583 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B720DC44500 for ; Thu, 2 Jul 2026 15:22:28 +0000 (UTC) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.71764.1783005740416003623 for ; Thu, 02 Jul 2026 08:22:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre.com header.s=google header.b=GSGvMEZC; spf=pass (domain: baylibre.com, ip: 209.85.219.68, mailfrom: tgamblin@baylibre.com) Received: by mail-qv1-f68.google.com with SMTP id 6a1803df08f44-8ef1dc934d1so6528356d6.0 for ; Thu, 02 Jul 2026 08:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783005739; x=1783610539; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WZGeLKXT0HNmaCbQvlUa7YeY647guNQMYPQ4WF2lJCY=; b=GSGvMEZCI0xerKaAwml7fsJlFM2CWJwodOfskCpXhS81lgxGwJbBNSYxc12WmLwWjN vZ2xs2eiETwV26ase3v/kKvRKJPrOzPgbsw6PJoKMt6V+FfVhftSgJQelR1FFPksyPu+ A/psRfI3Lu3dkTJHEYv87ilTXa/AXGGPV3y+7nziYFHJe3OuSwwatQnYXP7P7vP0KdsT I6mCxBgVZ7xpB5d9nbKGHNzVyNkDuvK7TmX+ej+dqhMo0HjIq11zJVN+61dF0eB59VOc xk1iv2LV1Tr0ZwER8Zub1pcOPiLj4qdfqHvMg+ud6gz6G5GuNQyqEStp+baWmnCsQ2Dx EFVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783005739; x=1783610539; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WZGeLKXT0HNmaCbQvlUa7YeY647guNQMYPQ4WF2lJCY=; b=hhb0med2z7mlDPqi+7NTB5PgMSUOzlU1Wlqc+8fjlrvCkY0XjQyAnzsTih0kehWGVn vYZ4vGB/g829e55NGfYnbFVdtWHe6zZmnHeFqry3QX/qdfW/6HkWqwNh8UEuO35D59Dj rJvmTsdWmxfNyQi5JSmx2COD8lMsuqvxWIjLL+Kfqe8vQT20tzsZI8pQ1D+ONIgWGY9Z oF6Va+LZZ4W04wcQOvRxv8AiaRAlzYA4k/3KyKLWNW6QxHknkzsVbbEOl/9bH2SrMq/a +omvy+JinO+aFS7mNiODsIvFo0z04gFgaYTYpMaTNCyUIGRNt7tfcZc75y5xC1SChkIm NucQ== X-Gm-Message-State: AOJu0YwmcvfCjfg6VXQnCYpKoYb9fyR9wUXIOykRX5PKbjNyCQ2j0rMd OgkcaxCSfZCUfufjHeDetD2qtHgPvGSlmGd3RPXVcJzOIJQ6xzzbt85x3Mf2LWNYmJbEMnEodSV c5InCEI1bzEvH X-Gm-Gg: AfdE7cmBtTqaBEsU3vCuN/EuqF70REcUBr56kXbrlM+2ToFNSc3zNhaiOSVlkoHKyZa z/PZ6CxbNiVz+igdUe56bNfuQ5eM4J+8fx4KxLzEUI/aPHH6STy3p9OP+PSr2BJP69nl1aWMaff mWmg9Cyyr+k+0FGf9nUOlCR9HSvHhc5MqN39I9DE6M32zcveZVjac1Q5CvtNtI9iV3Q1BHN0Vwg WeJwuTRSd90XkRNG+VFwhQK/NURFDkyUh0NHRIXY9Ry/yvyW4VseZSrz6sR3+Is2++biaRh2NFh YhaMg+qNMzjXiPAv8xJUmzEif7nZmJfrE/qLqxq5NFmGQO2tLvfQeX4BKTGwItaVlPSyhhJbexb o8U5PhVhHPNmWa2mB/VKsA1gsKl9BAVCnF0ZO7peNPwY+fnyXx1iq6VJ8Gfllt+GFkRue3Cqt/W HMoWrHAvKv9SZa+hra X-Received: by 2002:a05:6214:1305:b0:8f1:5e32:9b06 with SMTP id 6a1803df08f44-8f5bca89c22mr5232736d6.13.1783005739163; Thu, 02 Jul 2026 08:22:19 -0700 (PDT) Received: from localhost ([2001:1970:3847:e000:e8bd:ca0f:c232:9f10]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f46e942af0sm29462366d6.14.2026.07.02.08.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 08:22:18 -0700 (PDT) From: Trevor Gamblin To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr Subject: [OE-core][PATCH 1/6] patchtest: tests: base.py: remove duplicate Commit object Date: Thu, 2 Jul 2026 11:22:08 -0400 Message-ID: <20260702152213.1439717-2-tgamblin@baylibre.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702152213.1439717-1-tgamblin@baylibre.com> References: <20260702152213.1439717-1-tgamblin@baylibre.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jul 2026 15:22:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240059 This is declared twice, so delete one occurrence. Signed-off-by: Trevor Gamblin --- meta/lib/patchtest/tests/base.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/lib/patchtest/tests/base.py b/meta/lib/patchtest/tests/base.py index 919ca136bb..8263932dda 100644 --- a/meta/lib/patchtest/tests/base.py +++ b/meta/lib/patchtest/tests/base.py @@ -22,10 +22,6 @@ info = logger.info warn = logger.warn error = logger.error -Commit = collections.namedtuple( - "Commit", ["author", "subject", "commit_message", "shortlog", "payload"] -) - Commit = collections.namedtuple('Commit', ['author', 'subject', 'commit_message', 'shortlog', 'payload']) class PatchtestOEError(Exception): From patchwork Thu Jul 2 15:22:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 91584 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C91FAC43327 for ; Thu, 2 Jul 2026 15:22:28 +0000 (UTC) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.71765.1783005742387473578 for ; Thu, 02 Jul 2026 08:22:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre.com header.s=google header.b=HC7kT/d3; spf=pass (domain: baylibre.com, ip: 209.85.222.169, mailfrom: tgamblin@baylibre.com) Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-9217d13c276so104592085a.1 for ; Thu, 02 Jul 2026 08:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783005741; x=1783610541; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=moeKyl6NWNfn4D8Ze4VpBo7QG3MucDsq9fLBBaGnLuc=; b=HC7kT/d3cPKKHNVPN6AejPO9DkIVY2AIezBxqatbFOh6odJyEKMVASntv4VcjYNWV/ cf39PX0L+mqMtVjybB87A/6Yz/l379/LSYWsRMmbPuCVrEvIiO26BAMNINb2kOczQeYS EY69KQArvVXKbfTauPtKz7tV5Ii9cY5ZvvJHSKb16ug0wZJyKaSmLcEVRNlPviekkI0e 0iVsGznqEUxudm2XsLZDM7mirLBtMuMQ+Fc4WOm5NGFXInC59I9ty+OdFh15PMc/c/lB IlDWO0Yhqe9IdZ1H/ZRSx1ak32m0ZGVMfRkSwspDzitBi1i9/OvEuVsXvEupE/C8Kf3V usBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783005741; x=1783610541; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=moeKyl6NWNfn4D8Ze4VpBo7QG3MucDsq9fLBBaGnLuc=; b=hOjRiTQoyLMIFfSBE6HNe6we0tKn1Pyd+aZQ0l4HqPcdB44UbD2CUomq8yJ8NjDwl+ e0GcMj0F3CigeT9LTELEJaAolfdKcV41A0VDeDcpctwQSVFe7bKhW9bef6asfKh6mJIL 0kzW6807HeJlB9llKJQkWIpkIVMVnPhcf9XnBP6b9xbH4gYcxI3LHnEn3Vhp9T9Q5bnY jMDPcYx3dXNPucVoe5oUP2Hx4ez7j4vFPI83FOgnfu9+kSCLHYoYtKtKQpYJkrOzOtdf gqZS5MNBNZNfLBEWDbBdD+VVWlvzTY9nlrJkzs5goQLoQSx/nvbCNzyY2U+a/b208eVh IZ3w== X-Gm-Message-State: AOJu0YzMaeo+pkVvQNnireZbOTUNLSJ9lNbllZyMuSoklceJcQ6FTP9J MCHzM2uPYbT1a7iSvaWp/YQNFLFMAkm6dJP8aaU9s8ft4y19rdoC0JD2FCdvVIhcC9nKkt6GHiB 6E0oiUorTIQ== X-Gm-Gg: AfdE7cnzQQ5XTAKjd0cPPDKBb3ZBFTBrQg3Pkr94YXdwwTvoz7F9//DNXNQwQMm2j66 3A9jlp5x47WsKaWxv4JrwBg0iroMtEqismRf7i+LA6PF7wxwawoC1byWBfS4CujH1j4wKSS6QhK AgL2gH/fQZUgeDvXYgkTOL2zAaCOQYNc17pzaB6mQDgCcOrdJ5gAHUPzIuN4KPOL3vY+/aZ3b97 w6dbQjWe/w/dvIHUOzv8r2tJrPTHw7z+mrhW2iLGWVnL4x6gFPlFpv45uXKDa8Oh0NSYQtP9AIo WwvjqBo15l/tHNVXqEAVkLZ7UoT130fhPQFCW6W433Us1pbRo3e9qpWAb/6mENmAiiE78hLy4Jl 7KLvmD8LXZ6gwiIiPz0HFDFBY+kM2YYw24ddozfhwc2N76DJu+QsT2hX5IwL3C0f/LIOvVws5dL ofF3iBl58Eke76PDQs X-Received: by 2002:a05:620a:460b:b0:92a:e752:a1d7 with SMTP id af79cd13be357-92e7809fc58mr849377185a.0.1783005741085; Thu, 02 Jul 2026 08:22:21 -0700 (PDT) Received: from localhost ([2001:1970:3847:e000:e8bd:ca0f:c232:9f10]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92e801968dasm240066985a.34.2026.07.02.08.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 08:22:20 -0700 (PDT) From: Trevor Gamblin To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr Subject: [OE-core][PATCH 2/6] patchtest: tests: test_mbox.py: improve variable and message clarity, fix whitespace Date: Thu, 2 Jul 2026 11:22:09 -0400 Message-ID: <20260702152213.1439717-3-tgamblin@baylibre.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702152213.1439717-1-tgamblin@baylibre.com> References: <20260702152213.1439717-1-tgamblin@baylibre.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jul 2026 15:22:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240060 - Rename "l" to "length" so it's clearer - Make the message printed for an invalid author (AUH, in particular) more explicit - Remove an extra space in an if block inside test_target_mailing_list() Signed-off-by: Trevor Gamblin --- meta/lib/patchtest/tests/test_mbox.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py index 5cf02af7bd..feb87fa2ae 100644 --- a/meta/lib/patchtest/tests/test_mbox.py +++ b/meta/lib/patchtest/tests/test_mbox.py @@ -74,11 +74,11 @@ class TestMbox(base.Base): shortlog = re.sub(r'^(\[.*?\])+ ', '', commit.shortlog) if shortlog.startswith('Revert "'): continue - l = len(shortlog) - if l > patchtest_patterns.mbox_shortlog_maxlength: + length = len(shortlog) + if length > patchtest_patterns.mbox_shortlog_maxlength: self.fail( "Edit shortlog so that it is %d characters or less (currently %d characters)" - % (patchtest_patterns.mbox_shortlog_maxlength, l), + % (patchtest_patterns.mbox_shortlog_maxlength, length), commit=commit, ) @@ -120,7 +120,7 @@ class TestMbox(base.Base): folders = patch.path.split('/') base_path = folders[0] for project in [self.bitbake, self.doc, self.oe, self.poky]: - if base_path in project.paths: + if base_path in project.paths: self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists', data=[('Suggested ML', '%s [%s]' % (project.listemail, project.gitrepo)), ('Patch\'s path:', patch.path)]) @@ -173,7 +173,7 @@ class TestMbox(base.Base): for commit in self.commits: if patchtest_patterns.auh_email in commit.commit_message: self.fail( - "Invalid author %s. Resend the series with a valid patch author" + "Commit message contains AUH email address %s. Resend the series with a valid patch author" % patchtest_patterns.auh_email, commit=commit, ) From patchwork Thu Jul 2 15:22:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 91582 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA3F1C44501 for ; Thu, 2 Jul 2026 15:22:28 +0000 (UTC) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.72289.1783005744459669988 for ; Thu, 02 Jul 2026 08:22:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre.com header.s=google header.b=CKPZVkoX; spf=pass (domain: baylibre.com, ip: 209.85.222.173, mailfrom: tgamblin@baylibre.com) Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-92e5cb052edso153215885a.2 for ; Thu, 02 Jul 2026 08:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783005743; x=1783610543; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3PGY9fiYj5E1V1ib9hEZOQELeHaxR2kg16b0f2Cujmc=; b=CKPZVkoXYP2rgMZ0GCxKpJlvAI5O37DA/3gBNaiDPrjBlWGcwkCGjNntyZfiOvYrHy igHAMQibkj82WG9KNAffkipgy8OQV/qtcPNPaLe6FQsXgvUKJFkEr5H+XcgEgUP0p5A8 k9fMMcuHuRTlzoxi0249aCaW8pmEKvddIT72ZPdSLKjiOUGT/RnbMJVlMoBFMQWHKlSr z2Kqr+RE8L5jXp8SAALDINVNpq85RnOc+7GvQ1BMykvR7T7hW09CHxAqA173/M37oWPH FJS6SPTSH2WHRq4KWC0XjaNKVq8tlJlW1YcJmh0gaX2aJclYr/iO1u8jGSPbyeE5OlAQ f2TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783005743; x=1783610543; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3PGY9fiYj5E1V1ib9hEZOQELeHaxR2kg16b0f2Cujmc=; b=nsOdgkeFYMyBymrXno6NYihuqD1xzRuAIQaarCJhk19ZxAmGlRApeJ9E/XzHw1ukJg 0+Mn4HBeO3tlUhDjFbsDdqh2vlV4SNdksiX7sHzdtUUAcBkxa6/yITGQpzZx5jD60yIG tti6ilKDydjnjiq6ubpNL1h1dbtBMYWEL4AZBwhG6Rvm5PXmD0Y8vcMfBO9Iq5GHrtQw FOeSOqA1k9oEYTFNYFKFxfDdqVXNK2aHNYaI8ZsC+1r0IS6x4+D0RIiImLwlO35MwTD9 PX6xEO/JGwtg0enDiNlvweV5S+BpKX3hDZa+7O6I4As0uq4GE45T5KXVPO/ZcLRdNzas wgYA== X-Gm-Message-State: AOJu0Yxt3y+s74jWp+DALnPjk2axFvyZIfhmC8ABEBih6F2hsvI3Opvk U5HiOFn0LnWc+/W916NMPmN0gEijVC7uYv8jJiQS0jHZkCI+Eddpq2LACqc7+WfKkafAldM/Fmp +vizYOAQj2Q== X-Gm-Gg: AfdE7cmXHGYzuhoeSwGZXSU3+FzteBtOBFP2h8y3KOu/Yk3wPabBwzBwl1ZqYalKlfX xD5Wc5/XUUqAx96L6F9l3btiKCvWGgPucRxb+GfQL5+m+fJ09Nv4/ls/erryT8zTvnd0fbBOWyE Y8ZEQR4bf/gv7asKFtS6EkvpkH8G4i3E9dSO0PslGU8/BJpG7pIXOpy0yn/y8vjHE4V6Doe9anW j5i0F0Zhrc3yluknjGFdQ6f6B5NHSBoOQosLF2kHOwNP+zJ7e6Yru+l+pAZp1vmUMxJ8QX4uUlT QdYim0xGy6qU8990eexWCkW8r1qDXuwHAH7mOzlGMTqoDL6PLG1lhuOIOaI4B8iyBqeG7dexE9K uimXp8qhIVl2L5OZVLPfAHlQMOyjSUqiRlcu3tE7J9TYhilWZfHW/4/pTUfkwNphw9hMDSWgu3+ 3Q339l0x8Wv85YjGeO X-Received: by 2002:a05:620a:458d:b0:92e:7317:8aee with SMTP id af79cd13be357-92e7afb17abmr728505885a.8.1783005743214; Thu, 02 Jul 2026 08:22:23 -0700 (PDT) Received: from localhost ([2001:1970:3847:e000:e8bd:ca0f:c232:9f10]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92e801bbec0sm245243085a.45.2026.07.02.08.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 08:22:22 -0700 (PDT) From: Trevor Gamblin To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr Subject: [OE-core][PATCH 3/6] patchtest: tests: test_metadata.py: simplify SRC_URI collection, remove unneeded import Date: Thu, 2 Jul 2026 11:22:10 -0400 Message-ID: <20260702152213.1439717-4-tgamblin@baylibre.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702152213.1439717-1-tgamblin@baylibre.com> References: <20260702152213.1439717-1-tgamblin@baylibre.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jul 2026 15:22:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240061 The pretest_src_uri_left_files() and test_src_uri_left_files() functions both use the same logic to check for changes, so encapsulate that into a function for easier re-use. Also remove a pyparsing import which isn't needed, since it already gets pulled in through other patchtest modules. Signed-off-by: Trevor Gamblin --- meta/lib/patchtest/tests/test_metadata.py | 32 +++++++---------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/meta/lib/patchtest/tests/test_metadata.py b/meta/lib/patchtest/tests/test_metadata.py index 30da8dbe60..442e80973d 100644 --- a/meta/lib/patchtest/tests/test_metadata.py +++ b/meta/lib/patchtest/tests/test_metadata.py @@ -8,7 +8,6 @@ import base import collections import os import patchtest_patterns -import pyparsing from patchtest_parser import PatchtestParser # Data store commonly used to share values between pre and post-merge tests @@ -108,39 +107,28 @@ class TestMetadata(base.Metadata): ], ) - def pretest_src_uri_left_files(self): - # these tests just make sense on patches that can be merged - if not PatchtestParser.repo.canbemerged(): - self.skip("Patch cannot be merged") - if not self.modified: - self.skip('No modified recipes, skipping pretest') - - # get the proper metadata values + def _collect_src_uri(self, key_prefix): for pn in self.modified: - # we are not interested in images if 'core-image' in pn: continue rd = self.tinfoil.parse_recipe(pn) PatchTestDataStore[ - "%s-%s-%s" % (self.shortid(), patchtest_patterns.metadata_src_uri, pn) + "%s-%s-%s" % (key_prefix, patchtest_patterns.metadata_src_uri, pn) ] = rd.getVar(patchtest_patterns.metadata_src_uri) - def test_src_uri_left_files(self): - # these tests just make sense on patches that can be merged + def pretest_src_uri_left_files(self): if not PatchtestParser.repo.canbemerged(): self.skip("Patch cannot be merged") if not self.modified: self.skip('No modified recipes, skipping pretest') + self._collect_src_uri(self.shortid()) - # get the proper metadata values - for pn in self.modified: - # we are not interested in images - if 'core-image' in pn: - continue - rd = self.tinfoil.parse_recipe(pn) - PatchTestDataStore[ - "%s-%s-%s" % (self.shortid(), patchtest_patterns.metadata_src_uri, pn) - ] = rd.getVar(patchtest_patterns.metadata_src_uri) + def test_src_uri_left_files(self): + if not PatchtestParser.repo.canbemerged(): + self.skip("Patch cannot be merged") + if not self.modified: + self.skip('No modified recipes, skipping test') + self._collect_src_uri(self.shortid()) for pn in self.modified: pretest_src_uri = PatchTestDataStore[ From patchwork Thu Jul 2 15:22:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 91585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01B76C44502 for ; Thu, 2 Jul 2026 15:22:29 +0000 (UTC) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.71772.1783005747949964092 for ; Thu, 02 Jul 2026 08:22:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre.com header.s=google header.b=O4ncmTpK; spf=pass (domain: baylibre.com, ip: 209.85.160.169, mailfrom: tgamblin@baylibre.com) Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-51c0cea8883so5877361cf.1 for ; Thu, 02 Jul 2026 08:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783005747; x=1783610547; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=23PeNl+BtZJMAJKTvvQbmucnGGqLskt4uYBC8lFe+4Y=; b=O4ncmTpKqelQbmf4JHEw4ANadGB5rYJ73kjmxQcwyZqeLmNwEGEopQm1ScBYGpdytp SLP/R632d6Yu7KlM3LOMuUWPSwsuliOmSTu1uFAJJ3e38ZVr8CKg1xMoul9PcAod97as IGl9Z1AXeD8c5UimdncSmERk3S8gFMhzr875rFDgeJ/hp5QGhg2nt9ob1vbnPmIN+3Dh RWXwnhKra6WCFR1jM2U0mmPCnEFQK7ceqSwFZSzFyFuUDrWpX2xKZyMkw1WRPXGNiWv2 gleFC4GnFQ1cOjg+P0oEdvJJ03mc/gHB7K9efQuFiZ5FGWMd1YXwUaf5o3fOEW4XhIT1 0k3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783005747; x=1783610547; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=23PeNl+BtZJMAJKTvvQbmucnGGqLskt4uYBC8lFe+4Y=; b=VukLSWR98w63dfHHMjHUTjB4qEKxsuBLkiJBxRCUzINAGaqsX8GjbQMdbvhvwr4Z2v 3xJ/5I3mQs6ZEZve6aLcbed9Rq+wJ25xP8+we8lEvEH+w59RJIyg7V3UmPrm1rEo40CZ eusgULjZ18jX27yDPq6R/+kDJzFc2FQVJU9EPRx/QDyqik5CaLAS+UeAiK0Rmq9bACo6 II/pHXuzhjLNICrJu8RIp1PEjHtHOTCztnfVNiuyPDB2YLGbGC5nkS5fzyY9v+ZXu9/M oKv8VR930nI3J3pm4MGIGeoHdgH3Sb0h1w2SqRfrplc1kf9zvkhdmsIENAVoxoPaIqod wOTA== X-Gm-Message-State: AOJu0YwbWRj8+VsTgWT1r7z5x0KZmppd7vV5bvsxj+fGkGLvDUcJUtuA tRq2yT8UeIU9QVP+WFSII3WZv1vuUxOVk2XoNFyyovObcpysbdRtlZQHVV6VS7+bpdagSGP2V8n tJARq7qZ+PA== X-Gm-Gg: AfdE7cm0yk6WLSMUMM2E7mQLnWoPBCsTkPLLWWTpy2DVU500eh7CJ4DDU7lB/GjbuqZ Gha6Fq1mgd3uRAB1VR8iErPYDtPTDj7X7DRu30v/f2X4gaTgaMPjyCufCQ/khEeulheLz2ZsdDY 8uz0MWyPF0eUrQgxT2fNGBizGEp+2cDnThHztKdlf4uVQythxCaXfIkYIMStGIceC6KZgyYCBOD Yl6jtKOK4vtni76xUc1xfgXt1XRmIMj8V86gp0UD60ROtdssfpVi/Em0rQnGtamOZl40E9sReLM vci910vpzHRY1LlvuAtU7FXilK4MO849efy41+BgxkdboZ8HzdlJjuPwf1KEXBHcSetOAMAvAwj B8Hq5YdnJyu9ihi9adbcG5CP94OuRD725ZR8LH21LlpBTWMFFyjHIMyo1LgOqmWTbODYrzYrGVP SolExQ9jVwliaC/Lyr X-Received: by 2002:a05:622a:1823:b0:50b:29da:ec58 with SMTP id d75a77b69052e-51c3c05863dmr4873921cf.8.1783005746731; Thu, 02 Jul 2026 08:22:26 -0700 (PDT) Received: from localhost ([2001:1970:3847:e000:e8bd:ca0f:c232:9f10]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51c30c654b7sm16204441cf.29.2026.07.02.08.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 08:22:24 -0700 (PDT) From: Trevor Gamblin To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr Subject: [OE-core][PATCH 4/6] patchtest: tests: test_patch.py: simplify source patch and upstream status checking Date: Thu, 2 Jul 2026 11:22:11 -0400 Message-ID: <20260702152213.1439717-5-tgamblin@baylibre.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702152213.1439717-1-tgamblin@baylibre.com> References: <20260702152213.1439717-1-tgamblin@baylibre.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jul 2026 15:22:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240062 - Only check for new patches once in setUp(), rather than in each function - Fix misleading "CVE" messages when we're really looking for any new source patches which are added - Move patterns for checking patch upstream status into the relevant test Signed-off-by: Trevor Gamblin --- meta/lib/patchtest/tests/test_patch.py | 37 +++++++++----------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/meta/lib/patchtest/tests/test_patch.py b/meta/lib/patchtest/tests/test_patch.py index 3b33b5a199..34e580500b 100644 --- a/meta/lib/patchtest/tests/test_patch.py +++ b/meta/lib/patchtest/tests/test_patch.py @@ -28,20 +28,12 @@ class TestPatch(base.Base): def setUp(self): if self.unidiff_parse_error: self.skip('Parse error %s' % self.unidiff_parse_error) - - self.valid_status = ", ".join(patchtest_patterns.upstream_status_nonliteral_valid_status) - self.standard_format = "Upstream-Status: " - - # we are just interested in series that introduce CVE patches, thus discard other - # possibilities: modification to current CVEs, patch directly introduced into the - # recipe, upgrades already including the CVE, etc. - new_cves = [p for p in self.patchset if p.path.endswith('.patch') and p.is_added_file] - if not new_cves: - self.skip('No new CVE patches introduced') + if not TestPatch.newpatches: + self.skip('No new source patches introduced') def test_upstream_status_presence_format(self): - if not TestPatch.newpatches: - self.skip("There are no new software patches, no reason to test Upstream-Status presence/format") + valid_status = ", ".join(patchtest_patterns.upstream_status_nonliteral_valid_status) + standard_format = "Upstream-Status: " for newpatch in TestPatch.newpatches: payload = newpatch.__str__() @@ -71,16 +63,16 @@ class TestPatch(base.Base): 'Upstream-Status is present only after the patch scissors. ' "It must be placed in the patch header before the scissors line.", data=[ - ("Standard format", self.standard_format), - ("Valid status", self.valid_status), + ("Standard format", standard_format), + ("Valid status", valid_status), ], ) else: self.fail( "Added patch file is missing Upstream-Status: in the commit message", data=[ - ("Standard format", self.standard_format), - ("Valid status", self.valid_status), + ("Standard format", standard_format), + ("Valid status", valid_status), ], ) @@ -97,8 +89,8 @@ class TestPatch(base.Base): "but was found afterwards.", data=[ ("Current", line.lstrip("+")), - ("Standard format", self.standard_format), - ("Valid status", self.valid_status), + ("Standard format", standard_format), + ("Valid status", valid_status), ], ) @@ -142,15 +134,12 @@ class TestPatch(base.Base): "Upstream-Status is in incorrect format", data=[ ("Current", pe.pstr), - ("Standard format", self.standard_format), - ("Valid status", self.valid_status), + ("Standard format", standard_format), + ("Valid status", valid_status), ], ) def test_signed_off_by_presence(self): - if not TestPatch.newpatches: - self.skip("There are no new software patches, no reason to test %s presence" % PatchSignedOffBy.mark) - for newpatch in TestPatch.newpatches: payload = newpatch.__str__() for line in payload.splitlines(): @@ -162,7 +151,7 @@ class TestPatch(base.Base): self.fail('A patch file has been added without a Signed-off-by tag: \'%s\'' % os.path.basename(newpatch.path)) def test_cve_tag_format(self): - for commit in TestPatch.commits: + for commit in self.commits: if patchtest_patterns.cve.search_string( commit.shortlog ) or patchtest_patterns.cve.search_string(commit.commit_message): From patchwork Thu Jul 2 15:22:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 91587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3C3FC43458 for ; Thu, 2 Jul 2026 15:22:38 +0000 (UTC) Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.72293.1783005749618067249 for ; Thu, 02 Jul 2026 08:22:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre.com header.s=google header.b=FiJkoAfB; spf=pass (domain: baylibre.com, ip: 209.85.219.41, mailfrom: tgamblin@baylibre.com) Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-8eff5ce3b95so16871676d6.3 for ; Thu, 02 Jul 2026 08:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783005748; x=1783610548; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lpEqPX+3vUoKU7DBXoSoh3owWBloA8LHKsvLMyfYVlU=; b=FiJkoAfBoHiEu+eek5JDxRlMAWte+rhn6aWw0WmtkXNeH0GnmlDZXF/XRuI7DV5RcV knfmui16YUyJL4aTDazpQ6MkT//hq54PWXeJGKchM8xvNsFFQv0efz910TBzI40E06Jn 7qRyh4XU62U4a0jtG1pPfCguyYeGDSaFkBih5u9MkgNLzfNCLjk0ZOA73EV/wF0vZPs2 wr2L7orM+7GtS98t5rX+M8RWt6tY6uX7gtc2ESlo1EVyPwHMvQDVRsHm0WNcYF+LMlAr VtZuNeqFqLWgxYvOmLcI/vze181BdTSVtdJUYhQQZ4PSW/CzNEVF+achPlrw8HWIjXyC 8+lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783005748; x=1783610548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=lpEqPX+3vUoKU7DBXoSoh3owWBloA8LHKsvLMyfYVlU=; b=P9MfovUJRwCTCE7n/8D9h3pyaJuUR2jc/isKDyBLaVKmITduuLq6zH5tAB9e24X0Ev klyS0KgIhu0lLt5TdSRCrk42FzhnpEA76QJA2gD8iyH3y8mhVw0IqhKsOhjGQMHs3m/+ uc9G3zue99IxCPHYmWswip+me7q1mIltcdVpY1m+Ogo/l8AY+JXRCSvr3TaT8s7jok/H nLjOcwjRJSgj8vsLkMujSuVTlC/XGrjU6FUKwZpDUHgghcWg7sohr++7fs5xAMb2LdU9 B5wXun8xXuSIv/tSdpVfv2pxmoVHd9Xi2QPlorrS/MkkPSuvaXNfuYFNW/hN4zgI7i3L KLLw== X-Gm-Message-State: AOJu0YxBFMNg3CAVniqLDED+jB58XU/c+vPCh1UVytJbG3p6p/R5VbSV CC/ZOYwUmNDEi2n0F82UZN3DbcqxE5BLPCMnczJPf8DSZsEyUJTOmIDGNYZq9tNcFCRoFblqMUo QX69X70oavg== X-Gm-Gg: AfdE7cn60EbZ9oTBQ74TGrt+rDcUjoguv6hfuymOIQidDzjIj/ItSdgv7bGaUSo+URf gnTpZX9heZi8lkK8knJh10P0tDFuWW0oH9+E0OwM5utNTx6VOemYR0SVh4i4bXz/5jT1zGkTUS7 1NupTCI0DJqQDaovA6LHpqEwMqKGPz7ib9chjie/kRPABrpHtwUOaqwIwW95O2v1ll2HjjDLLUU 1u7cbLUAn2TAn348nu20AqqrzvgPJaVeA8MG3J5qWyfiRabJWtWspoOcE+K0cAfLHt6/Z3utdu4 hCSd3qkLorLaFEqjFoXceJti5SmKxHTAmXRFxpJ7VfAsdzDuV4SI5Mv2ihm1UsY2esua4Pzn9O/ Sj5meseITCqjCcP3ccn+aGEvMvdrmefShfWpNmSbhpMj/pU64x2My7Xxu1wmlJTq3hEsgzi/YlM p1iA/nerU/zLcvzBUH+q6bc1WdLWY= X-Received: by 2002:a05:6214:dcf:b0:8f1:2607:ad86 with SMTP id 6a1803df08f44-8f42149c5f5mr70803406d6.4.1783005748523; Thu, 02 Jul 2026 08:22:28 -0700 (PDT) Received: from localhost ([2001:1970:3847:e000:e8bd:ca0f:c232:9f10]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f46e27d555sm28510916d6.7.2026.07.02.08.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 08:22:27 -0700 (PDT) From: Trevor Gamblin To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr Subject: [OE-core][PATCH 5/6] patchtest: tests: test_python_pylint.py: use more Pythonic comparison, fix indent Date: Thu, 2 Jul 2026 11:22:12 -0400 Message-ID: <20260702152213.1439717-6-tgamblin@baylibre.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702152213.1439717-1-tgamblin@baylibre.com> References: <20260702152213.1439717-1-tgamblin@baylibre.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jul 2026 15:22:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240063 - Use "!=" instead of "is not" when checking for a renamed file - Fix the pylint readlines() block so that indentation is consistent with the rest of the module (four spaces instead of eight) Signed-off-by: Trevor Gamblin --- meta/lib/patchtest/tests/test_python_pylint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/lib/patchtest/tests/test_python_pylint.py b/meta/lib/patchtest/tests/test_python_pylint.py index ec9129bc79..37d1de9436 100644 --- a/meta/lib/patchtest/tests/test_python_pylint.py +++ b/meta/lib/patchtest/tests/test_python_pylint.py @@ -47,7 +47,7 @@ class PyLint(base.Base): for pythonpatch in self.pythonpatches: # a condition checking whether a file is renamed or not # unidiff doesn't support this yet - if pythonpatch.target_file is not pythonpatch.path: + if pythonpatch.target_file != pythonpatch.path: path = pythonpatch.target_file[2:] else: path = pythonpatch.path @@ -55,9 +55,9 @@ class PyLint(base.Base): reporter = TextReporter(pylint_output) lint.Run([self.pylint_options, pythonpatch.path], reporter=reporter, exit=False) for line in pylint_output.readlines(): - if not '*' in line: - if line.strip(): - self.pylint_test[line.strip().split(' ',1)[0]] = line.strip().split(' ',1)[1] + if not '*' in line: + if line.strip(): + self.pylint_test[line.strip().split(' ',1)[0]] = line.strip().split(' ',1)[1] for issue in self.pylint_test: if self.pylint_test[issue] not in self.pylint_pretest.values(): From patchwork Thu Jul 2 15:22:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 91586 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D8DCC43602 for ; Thu, 2 Jul 2026 15:22:39 +0000 (UTC) Received: from par08s09-in-f0.1e100.net (par08s09-in-f0.1e100.net [74.125.230.192]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.72294.1783005752013832220 for ; Thu, 02 Jul 2026 08:22:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre.com header.s=google header.b=JJByEIlm; spf=pass (domain: baylibre.com, ip: 74.125.230.192, mailfrom: tgamblin@baylibre.com) Received: by par08s09-in-f0.1e100.net with SMTP id d75a77b69052e-51c169d90cdso4048731cf.1 for ; Thu, 02 Jul 2026 08:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783005751; x=1783610551; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=93jJEijk+8CRJGhoEYZXYhlpQAoVgiNW+/eACcagFOw=; b=JJByEIlm+ogQxG5R7yng853Wtt3+0CECgHzUOAEOenDqo5vss5/NQ+721lOJNT8QpU s8ixNOrFmitHwle6n+BGPA37dEW/SwuWax0vty/Q6FEeYXGzEhRInNJ9z81vV4HSbtfv 5OUOzZJSsWkRUPP0RdXmz3w8ddr43ERnicOXnSPymKb2YspP4m6EGJt0y5pUd6cCBOGL nc3j32OdEdzJeFpOevoezQyyBwKrfCbD8fbPtXCvTsBc5NWuqwNrJdl6WolPTbr68bC7 XQeVmckTUOuA0a12IjdSBOk0rAGL0FHCRIiZJZcz0W6YmhulZAjt1I80garTrvnWiBVD pAaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783005751; x=1783610551; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=93jJEijk+8CRJGhoEYZXYhlpQAoVgiNW+/eACcagFOw=; b=Mbh2cWqli0fKYjqNldNgFdafcNObhhaSDKPGnoF/S8A3QQCD7vQ/WCAAzSUEbCLqWp LVbie7/GpT1EToApSoc6UJClyO8rqRsB4gpO/8YtERzDIza1qLRfF7tk3yduKmikaDtM BkVGyWVwVTZp0VdTHXfv/sFy9nKt0VF7OtY1cBZcsYhr1BwGWy5nZVxRnQy4VuFLo3ZX B66ZoSsmT8fZBxKASMd10irUGhMl9WqQ3U/iQbIiO4qXsh2vku9XoFeZ172PdCN4kgzy PQlySwnY5h+j8Vm8003btWtrW0TghnYZ2DusmNCsATM7iQL4L6nZyL4pog5Z5XKU+dWG Z2wg== X-Gm-Message-State: AOJu0Yyf86I2UNeDjhPJNACSXYjdbk947agQ/4V76IpLD6wJvy9Y8SLZ jMDIh73PpllJj9a5xrtULKzx7qUJqRVHHFbHh8aYXgNOPLszdaERtWK/hIqEwMZdvwvMQwstIXo stWzxW5LXh3mw X-Gm-Gg: AfdE7cm6xZshJjh2F86kdxePo0I6wtBI5QiDzwn2YdBcn+PiDJrTSMu6WIAM1OIXYML U4lSE57Ts5E5oIEw6xgZfdZ6jhriSyPHHANppUn/S/Ut8wiXpktHuKhyLyYL8JM6mx3g3gDkYyg W3LQyBMdBntV5hp1sIY1PDMVc9lsG5RaYidzbG+AKD351Db4jk6qPsSdBaKJFW7IvGMen1Bp3oN mDnakXoLxTdFvb4EbMOeyacwktZfN8tCHFJ9C7EofzrwI+OW4o/D5m1nIg2IJUN0V0FSgB8jn4e K+LysbXmekKuce8+brzVJg7GXBeuc1SC4bplj1nVoEI1TuHelx21anXLr+LPLCV77Id7BuVmGwW rdPANY3VjGwT9v/A2J8qaEjQqbZYfRi8JYsDfOor/sw29n2zDJS6Ctxb/dI5dR5wn1bYPOWWbRe uqi7ZVUCEagk+LHfeh X-Received: by 2002:a05:622a:4c05:b0:517:21c9:a22a with SMTP id d75a77b69052e-51c26b25663mr83083911cf.54.1783005750319; Thu, 02 Jul 2026 08:22:30 -0700 (PDT) Received: from localhost ([2001:1970:3847:e000:e8bd:ca0f:c232:9f10]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51c30c165casm16234361cf.17.2026.07.02.08.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 08:22:29 -0700 (PDT) From: Trevor Gamblin To: openembedded-core@lists.openembedded.org Cc: yoann.congal@smile.fr Subject: [OE-core][PATCH 6/6] patchtest: correctly abort --directory test Date: Thu, 2 Jul 2026 11:22:13 -0400 Message-ID: <20260702152213.1439717-7-tgamblin@baylibre.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702152213.1439717-1-tgamblin@baylibre.com> References: <20260702152213.1439717-1-tgamblin@baylibre.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jul 2026 15:22:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/240064 Currently, patchtest run with --directory responds to a CTRL+C press by aborting only the current patch being tested, and moves onto the next. Instead, this key press should stop the test entirely. Remove usage of the unittest.installHandler() function (which intercepts the signal) and handle it ourselves. Also make sure that the branch is properly reset with git am --abort afterwards, and that the return code is properly set in the sigint handler function. Finally, update patchtest_parser.py so that the helper info reflects this change. AI-Generated: Uses Claude Code Signed-off-by: Trevor Gamblin --- meta/lib/patchtest/patchtest_parser.py | 2 +- meta/lib/patchtest/repo.py | 4 ++++ scripts/patchtest | 32 ++++++++++++++++++++++---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/meta/lib/patchtest/patchtest_parser.py b/meta/lib/patchtest/patchtest_parser.py index 2a11cb76c2..69bcb4b8e5 100644 --- a/meta/lib/patchtest/patchtest_parser.py +++ b/meta/lib/patchtest/patchtest_parser.py @@ -37,7 +37,7 @@ class PatchtestParser(object): help='The patch to be tested') target_patch_group.add_argument('--directory', metavar='DIRECTORY', dest='patch_path', - help='The directory containing patches to be tested') + help='The directory containing patches to be tested. CTRL+C aborts the entire directory test.') parser.add_argument('--repodir', metavar='REPO', default=default_repodir, diff --git a/meta/lib/patchtest/repo.py b/meta/lib/patchtest/repo.py index 6a7d7d2d3b..b4cf9e8ded 100644 --- a/meta/lib/patchtest/repo.py +++ b/meta/lib/patchtest/repo.py @@ -85,6 +85,10 @@ class PatchTestRepo(object): self._patchmerged = True def clean(self): + try: + self.repo.git.execute(['git', 'am', '--abort']) + except git.exc.GitCommandError: + pass self.repo.git.execute(['git', 'checkout', self.current_branch if self.current_branch else self.current_commit]) self.repo.git.execute(['git', 'branch', '-D', self._workingbranch]) self._patchmerged = False diff --git a/scripts/patchtest b/scripts/patchtest index b5a9bc2a51..17a3cebb48 100755 --- a/scripts/patchtest +++ b/scripts/patchtest @@ -12,6 +12,7 @@ import json import logging import os +import signal import subprocess import sys import traceback @@ -139,9 +140,6 @@ def _runner(resultklass, prefix=None): def run(patch, logfile=None): """ Load, setup and run pre and post-merge tests """ - # Get the result class and install the control-c handler - unittest.installHandler() - premerge_result = _runner(getResult(patch, False, logfile), 'pretest') postmerge_result = _runner(getResult(patch, True, logfile), 'test') @@ -190,10 +188,26 @@ def main(): else: patch_list = [patch_path] + interrupted = False + previous_sigint = signal.getsignal(signal.SIGINT) + + def _sigint_handler(signum, frame): + nonlocal interrupted + interrupted = True + # Restore previous handler so a second CTRL+C exits immediately + signal.signal(signal.SIGINT, previous_sigint) + signal.default_int_handler(signum, frame) + + signal.signal(signal.SIGINT, _sigint_handler) + ret = 0 for patch in patch_list: + if interrupted: + break + if os.path.getsize(patch) == 0: logger.error('patchtest: patch is empty') + signal.signal(signal.SIGINT, previous_sigint) return 1 logger.info('Testing patch %s' % patch) @@ -204,8 +218,18 @@ def main(): with open(log_path, "a") as f: f.write("Patchtest results for patch '%s':\n\n" % patch) - ret = run(patch, log_path) + try: + result = run(patch, log_path) + ret = ret or result + except KeyboardInterrupt: + interrupted = True + + if interrupted: + logger.error('\npatchtest: interrupted') + signal.signal(signal.SIGINT, previous_sigint) + return 1 + signal.signal(signal.SIGINT, previous_sigint) return ret if __name__ == '__main__':