From patchwork Thu Mar 23 09:20:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 21599 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 523BCC76195 for ; Thu, 23 Mar 2023 09:21:09 +0000 (UTC) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by mx.groups.io with SMTP id smtpd.web11.67849.1679563261471162841 for ; Thu, 23 Mar 2023 02:21:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=kUDwXmzj; spf=pass (domain: bootlin.com, ip: 217.70.183.194, mailfrom: alexis.lothore@bootlin.com) Received: (Authenticated sender: alexis.lothore@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id AD58E40014; Thu, 23 Mar 2023 09:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679563260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0+TpbgbwXq/6oxGBtLwKzzVW2QCXls1B26txe6N4HaQ=; b=kUDwXmzjN+kVl/Jv7BuF+fupN0BqX1iUptySe1DuopGw1ITJXkQrSQ58mgVg3axrMdILtP zBWj6uIv7eArWj8drYTpkuBapH2BVbcAX5Wiq9AfKBRXVyQ75VFEOfEqCPk96avRPkYifK JRVqfthiwGzWFa6eLsQmEdwyBUBx9tc9Fp3NFzpul/T2swrOmGC7PBPZr5nun6vDVlef4g INYGapNCkG7KoKnBAI8sQ3rN6Y+zKtExzOQWebA4cf2NhbmNlDeIayY85mIuhbmf/nPV55 5E/3JRQ3Ixn8mzvXBnH+fvIdscIMOP/6dk8nnCnOqMxoKLR6j7/8vOIrm7xzvA== From: alexis.lothore@bootlin.com To: yocto@lists.yoctoproject.org Cc: alexandre.belloni@bootlin.com, thomas.petazzoni@bootlin.com Subject: [yocto-autobuilder-helper][PATCH 1/3] scripts/test_utils: test master nightly build case Date: Thu, 23 Mar 2023 10:20:55 +0100 Message-Id: <20230323092057.17918-2-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230323092057.17918-1-alexis.lothore@bootlin.com> References: <20230323092057.17918-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 23 Mar 2023 09:21:09 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/59496 From: Alexis Lothoré Signed-off-by: Alexis Lothoré --- scripts/test_utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/test_utils.py b/scripts/test_utils.py index ab91e3b..d02e9b2 100755 --- a/scripts/test_utils.py +++ b/scripts/test_utils.py @@ -99,6 +99,16 @@ class TestGetComparisonBranch(unittest.TestCase): self.assertEqual( comparebranch, None, msg="Arbitrary repo/branch should not return any specific comparebranch") + def test_master_nightly(self): + repo = "ssh://git@push.yoctoproject.org/poky" + branch = "master" + basebranch, comparebranch = utils.getcomparisonbranch( + self.TEST_CONFIG, repo, branch) + self.assertEqual( + basebranch, "master", msg="Master branch should be returned") + self.assertEqual( + comparebranch, None, msg="No specific comparebranch should be returned") + if __name__ == '__main__': unittest.main() From patchwork Thu Mar 23 09:20:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 21601 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 632B1C761AF for ; Thu, 23 Mar 2023 09:21:09 +0000 (UTC) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by mx.groups.io with SMTP id smtpd.web11.67850.1679563261829594377 for ; Thu, 23 Mar 2023 02:21:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=kHd8VQu9; spf=pass (domain: bootlin.com, ip: 217.70.183.194, mailfrom: alexis.lothore@bootlin.com) Received: (Authenticated sender: alexis.lothore@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 2188040015; Thu, 23 Mar 2023 09:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679563260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U+3wU60tBVXdbBYXaHM6oAl2qGMZz1MKhy7Rj6UTFuk=; b=kHd8VQu90dhsIEbV67+ga+tRW4mHICKCvupG2FcUa9G0DgNdvfhXtZ5vFrLXZ24K6HgUC6 IkbarWyp5WDxGdhSn0C/GsOM02vQKpReR9+sItRGk4n42xOctjgoJ3PIlPBMwzrlZWh9zn F4uzvJan2l7ls/+7AcSCQQEt9vzdTCAOgCImTPpKyRve6vsgh8qeEnJW3111QzCM+xPZ2S ePf49oGmEA4tSx4x/JV2uF3CkHpUqPgDbAPrWYFyL2aSA/19FUsGXtHX4dRmVCTgdKIdfG /4LxaFk6I8zrJSm3iQn4qRXB4+BMdmhcXxOOrN15SkwbdZ1FY5JhMsf+L187+g== From: alexis.lothore@bootlin.com To: yocto@lists.yoctoproject.org Cc: alexandre.belloni@bootlin.com, thomas.petazzoni@bootlin.com Subject: [yocto-autobuilder-helper][PATCH 2/3] scripts/test_send_qa_email.py: allow tests with non static results Date: Thu, 23 Mar 2023 10:20:56 +0100 Message-Id: <20230323092057.17918-3-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230323092057.17918-1-alexis.lothore@bootlin.com> References: <20230323092057.17918-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 23 Mar 2023 09:21:09 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/59497 From: Alexis Lothoré When the test assert is about a tag in Poky, the result will not be the same depending on existing tags at the time of running tests. Add a LAST_TAG marker to loosen constraints but still allow to tests for general cases (e.g. : test that tag-depending tests does not return None) Signed-off-by: Alexis Lothoré --- scripts/test_send_qa_email.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/test_send_qa_email.py b/scripts/test_send_qa_email.py index ccdcba6..ce0c6b7 100755 --- a/scripts/test_send_qa_email.py +++ b/scripts/test_send_qa_email.py @@ -65,8 +65,17 @@ class TestVersion(unittest.TestCase): def test_get_regression_base_and_target(self): for data in self.regression_inputs: with self.subTest(data['name']): - self.assertEqual(send_qa_email.get_regression_base_and_target( - data['input']['basebranch'], data['input']['comparebranch'], data['input']['release'], os.environ.get("POKY_PATH")), data['expected']) + base, target = send_qa_email.get_regression_base_and_target( + data['input']['basebranch'], data['input']['comparebranch'], data['input']['release'], os.environ.get("POKY_PATH")) + expected_base, expected_target = data["expected"] + # The comparison base can not be set statically in tests when it is supposed to be the previous tag, + # since the result will depend on current tags + if expected_base == "LAST_TAG": + self.assertIsNotNone(base) + else: + self.assertEqual(base, expected_base) + self.assertEqual(target, expected_target) + if __name__ == '__main__': if os.environ.get("POKY_PATH") is None: From patchwork Thu Mar 23 09:20:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 21600 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 51641C6FD1C for ; Thu, 23 Mar 2023 09:21:09 +0000 (UTC) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by mx.groups.io with SMTP id smtpd.web10.68202.1679563262377033610 for ; Thu, 23 Mar 2023 02:21:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gkxqHdSk; spf=pass (domain: bootlin.com, ip: 217.70.183.194, mailfrom: alexis.lothore@bootlin.com) Received: (Authenticated sender: alexis.lothore@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id AD6654000A; Thu, 23 Mar 2023 09:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679563261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZzFIquftOijHu+VKC9fzhDskr9/XGtEWe7iCP/x5I6Q=; b=gkxqHdSk+926err6eTIwzvZBXsz74toc9KBj/oTG/cl6XSiEX494B1fMlXIH4NsWXfuSVp SqbV1i2xPPpZgegiHWkFQ0KjUw4ntkeFWqdMyAlYEqBerK52oY8J8rH+OZH3ThsDf+jNyB CLFAN4H0X4qM4w03hzePz/ZtWnyiqiSJ0H9/FvACx2+CBFWzjU8W6+YbMVthV9Ajxa57to 2U1fiFgYM14d4K2ED05SA1bsOokZ8lNBXkoGTnu/Ofli/QGjXawyioHp6CJLN3bYtPSkJy VStyQSXt0ysGkhXj4750IZADPKG9t6Zrbiwc1pubeLcwM8Epjvft2I7YXg/2XA== From: alexis.lothore@bootlin.com To: yocto@lists.yoctoproject.org Cc: alexandre.belloni@bootlin.com, thomas.petazzoni@bootlin.com Subject: [yocto-autobuilder-helper][PATCH 3/3] scripts/send_qa_email: return previous tag when running a non-release master build Date: Thu, 23 Mar 2023 10:20:57 +0100 Message-Id: <20230323092057.17918-4-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230323092057.17918-1-alexis.lothore@bootlin.com> References: <20230323092057.17918-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 23 Mar 2023 09:21:09 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/59499 From: Alexis Lothoré Some nightly builders are configured in yocto-autobuilder2 to run master builds. Those build parameters currently skip all branches of get_regression_base_and_target, which then return None, while the caller expects a base and target tuple Set default behaviour to return previous tag as comparison base and passed branch as target for such builds Signed-off-by: Alexis Lothoré --- scripts/send_qa_email.py | 3 +++ scripts/test_send_qa_email.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py index 78e051a..4613bff 100755 --- a/scripts/send_qa_email.py +++ b/scripts/send_qa_email.py @@ -61,6 +61,9 @@ def get_regression_base_and_target(basebranch, comparebranch, release, targetrep # Basebranch/comparebranch is defined in config.json: regression reporting must be done against branches as defined in config.json return comparebranch, basebranch + #Default case: return previous tag as base + return get_previous_tag(targetrepodir, release), basebranch + def generate_regression_report(querytool, targetrepodir, base, target, resultdir, outputdir): print(f"Comparing {target} to {base}") diff --git a/scripts/test_send_qa_email.py b/scripts/test_send_qa_email.py index ce0c6b7..974112a 100755 --- a/scripts/test_send_qa_email.py +++ b/scripts/test_send_qa_email.py @@ -48,6 +48,8 @@ class TestVersion(unittest.TestCase): "comparebranch": "master", "release": None}, "expected": ("master", "master-next")}, {"name": "Fork Master Next", "input": {"basebranch": "ross/mut", "comparebranch": "master", "release": None}, "expected": ("master", "ross/mut")}, + {"name": "Nightly a-quick", "input": {"basebranch": "master", + "comparebranch": None, "release": "20230322-2"}, "expected": ("LAST_TAG", "master")}, ] def test_versions(self):