From patchwork Wed Jun 14 08:56:12 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: 25562 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 C22D0EB64DA for ; Wed, 14 Jun 2023 08:56:13 +0000 (UTC) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by mx.groups.io with SMTP id smtpd.web10.6779.1686732964637174796 for ; Wed, 14 Jun 2023 01:56:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gloSEUdF; spf=pass (domain: bootlin.com, ip: 217.70.183.195, mailfrom: alexis.lothore@bootlin.com) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686732963; 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=af7YHyCAJmHV5L+xpM7L5914imNVsJp1Tq5EbDqwPoo=; b=gloSEUdFpJcCmtUp5/4itckkq7i8/dNqi+MmAxfJVVonSerSiuG5C+gp/ey32PsNegr935 Z/7FAtWW5qldTDkbyDip1XUut4VeLKb8XNPpX1wnPuvVxM4YTTJZMgCCg/4ruieeq7H3M1 8KaVYz1YCX5hdJ5GSglXeIsR94M+1j39VhunN1uAdwjyeaMPFH/R6X3/cjx6f9DNGt/+Dp zXHaUnWvsMiMSnIQ2FwBYcG07iAFEkUb3+3H+OEdi9V6SNFThnr0TgRNGNgB2bmrHCU+bd gsYt110ABbipW1sfzPafJkU2/v+Lcj03ZqgPWi8KNwGR6tGvl/2XBcMk3SwB2g== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id C239760015; Wed, 14 Jun 2023 08:56:02 +0000 (UTC) From: alexis.lothore@bootlin.com To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][PATCH 1/3] scripts/send-qa-email: use logger instead of raw prints Date: Wed, 14 Jun 2023 10:56:12 +0200 Message-ID: <20230614085614.27951-2-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614085614.27951-1-alexis.lothore@bootlin.com> References: <20230614085614.27951-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 ; Wed, 14 Jun 2023 08:56:13 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/60289 From: Alexis Lothoré As for other scripts in yocto-autobuilder-helper or oecore, use python logger class instead of raw print calls to allow log level distinction Signed-off-by: Alexis Lothoré --- scripts/send_qa_email.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py index 4613bff892e0..8a8454d09c2f 100755 --- a/scripts/send_qa_email.py +++ b/scripts/send_qa_email.py @@ -11,6 +11,7 @@ import sys import subprocess import tempfile import re +import logging import utils @@ -64,8 +65,8 @@ def get_regression_base_and_target(basebranch, comparebranch, release, targetrep #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}") +def generate_regression_report(querytool, targetrepodir, base, target, resultdir, outputdir, log): + log.info(f"Comparing {target} to {base}") try: regreport = subprocess.check_output([querytool, "regression-report", base, target, '-t', resultdir]) @@ -73,9 +74,13 @@ def generate_regression_report(querytool, targetrepodir, base, target, resultdir f.write(regreport) except subprocess.CalledProcessError as e: error = str(e) - print(f"Error while generating report between {target} and {base} : {error}") + log.error(f"Error while generating report between {target} and {base} : {error}") def send_qa_email(): + # Setup logging + logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") + log = logging.getLogger('send-qa-email') + parser = utils.ArgParser(description='Process test results and optionally send an email about the build to prompt QA to begin testing.') parser.add_argument('send', @@ -132,7 +137,7 @@ def send_qa_email(): try: subprocess.check_call(["git", "clone", "git@push.yoctoproject.org:yocto-testresults", tempdir, "--depth", "1"] + cloneopts) except subprocess.CalledProcessError: - print("No comparision branch found, falling back to master") + log.info("No comparision branch found, falling back to master") subprocess.check_call(["git", "clone", "git@push.yoctoproject.org:yocto-testresults", tempdir, "--depth", "1"]) # If the base comparision branch isn't present regression comparision won't work @@ -157,7 +162,7 @@ def send_qa_email(): regression_base, regression_target = get_regression_base_and_target(basebranch, comparebranch, args.release, targetrepodir) if regression_base and regression_target: - generate_regression_report(querytool, targetrepodir, regression_base, regression_target, tempdir, args.results_dir) + generate_regression_report(querytool, targetrepodir, regression_base, regression_target, tempdir, args.results_dir, log) finally: subprocess.check_call(["rm", "-rf", tempdir]) From patchwork Wed Jun 14 08:56:13 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: 25561 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 CF3EDEB64DD for ; Wed, 14 Jun 2023 08:56:13 +0000 (UTC) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by mx.groups.io with SMTP id smtpd.web10.6780.1686732964909654310 for ; Wed, 14 Jun 2023 01:56:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=djMxmyys; spf=pass (domain: bootlin.com, ip: 217.70.183.195, mailfrom: alexis.lothore@bootlin.com) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686732963; 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=OTOsnlFowihKiBIBoi1/E2d78r/pL3M6QQdWpqk7tYQ=; b=djMxmyysLWZCbKd7fbRIKN9yFGXHHHFJDMpzqnUi7+OW4TodFeOpDjBAZmiuJ721cJrgJ9 39dGhnol3vneQ4n6QUumq9Vs/MkXlDqLlc9eZgQYDTrCIOvXhgzzoFbgy5kgNjWRlxxn/B nMCpyN6lxxQoFMPZYfASBAb26Z/nGZofVxuwiYZILgA7O9oqgX/u7VcWdgKH7gm7nLz5wR DS9w2oj5uhA/zguRNl4daBwnPaLuwXvgagpx00iYYZgm2pG9kMfiZDQ/dNSNAP7k9VrUhm 13Xg69a2G+lbeilabeYg9aqjEbXNLh9gAgZYdDxkrGJdBim3QTIBIbADXVBiQA== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 515E760013; Wed, 14 Jun 2023 08:56:03 +0000 (UTC) From: alexis.lothore@bootlin.com To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][PATCH 2/3] scripts/send-qa-email: print warning when test results are not stored Date: Wed, 14 Jun 2023 10:56:13 +0200 Message-ID: <20230614085614.27951-3-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614085614.27951-1-alexis.lothore@bootlin.com> References: <20230614085614.27951-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 ; Wed, 14 Jun 2023 08:56:13 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/60290 From: Alexis Lothoré Tests results push command depends on basebranch and comparebranch variables, which are computed based on config.json content. If this file is not in sync with current release branch, tests results will be properly stored in git directory but not pushed onto test results server. Since we are able to detect this scenario, print at least a warning, without breaking current build since it could be a release Signed-off-by: Alexis Lothoré --- scripts/send_qa_email.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py index 8a8454d09c2f..fc7fccc6f6f7 100755 --- a/scripts/send_qa_email.py +++ b/scripts/send_qa_email.py @@ -159,6 +159,8 @@ def send_qa_email(): elif basebranch: subprocess.check_call(["git", "push", "--all"], cwd=tempdir) subprocess.check_call(["git", "push", "--tags"], cwd=tempdir) + elif is_release_version(args.release) and not comparebranch and not basebranch: + log.warning("Test results not published on release version. Faulty AB configuration ?") regression_base, regression_target = get_regression_base_and_target(basebranch, comparebranch, args.release, targetrepodir) if regression_base and regression_target: From patchwork Wed Jun 14 08:56:14 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: 25560 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 C3975EB64DC for ; Wed, 14 Jun 2023 08:56:13 +0000 (UTC) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by mx.groups.io with SMTP id smtpd.web10.6781.1686732965304981169 for ; Wed, 14 Jun 2023 01:56:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=JixyPNJH; spf=pass (domain: bootlin.com, ip: 217.70.183.195, mailfrom: alexis.lothore@bootlin.com) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686732963; 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=349/iuiS4WmQg9TZWQKg6HXWyB0fmBwccOzakvbrEzc=; b=JixyPNJH3GeszCYNOv/VoSA/y7OUjekmgJula1cz30dMpIRQzx+Vqp+utlr0oy7vY9MDsX LpkFDbOKAakZXb0NoE/yTYfGkUrl1DQ1lJVwo9Z8PkRmZV33u53MY7F3Nhc+dcCvaxLojM 2sOCESDnBDYLXiQq3nuOaSRK2xWSqTdxdtPvafjhlTJdNaxIPPVeZhhcbfcX4lqgWd74xa vDdfEa7RdcxYcc2mBK3a2H4M+3Dn+OJqoHdbcEmbTglZkZ36gcFtBnfOvqULm+vMszbntY eMfFKx1FChR6Uz8iqdACAfEUIYxt1NKy3kZO0BGm2EK9slZuY2UxK1b7FGlLFw== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id ADC266000B; Wed, 14 Jun 2023 08:56:03 +0000 (UTC) From: alexis.lothore@bootlin.com To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][PATCH 3/3] config.json: add mickledore as direct push branch for test results Date: Wed, 14 Jun 2023 10:56:14 +0200 Message-ID: <20230614085614.27951-4-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614085614.27951-1-alexis.lothore@bootlin.com> References: <20230614085614.27951-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 ; Wed, 14 Jun 2023 08:56:13 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/60291 From: Alexis Lothoré Now that mickledore is released, builds are executed on mickeldore release branch. If not properly described in config.json, it will be considered a "work" branch, and as a consequence test results will not be pushed onto test results git repository Add mickeldore entry in config.json to fix test results storage Signed-off-by: Alexis Lothoré --- Example of such failure is AB build 5212 (https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/5212/steps/29/logs/stdio) for yocto-4.2 (mickledore release), which lead to empty regression report for 4.3_M1.rc1 since it was compared to 4.2 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 7fe2baea3428..e7f308d0a3f6 100644 --- a/config.json +++ b/config.json @@ -5,7 +5,7 @@ "BUILD_HISTORY_DIR" : "buildhistory", "BUILD_HISTORY_REPO" : "ssh://git@push.yoctoproject.org/poky-buildhistory", - "BUILD_HISTORY_DIRECTPUSH" : ["poky:morty", "poky:pyro", "poky:rocko", "poky:sumo", "poky:thud", "poky:warrior", "poky:zeus", "poky:dunfell", "poky:gatesgarth", "poky:hardknott", "poky:honister", "poky:kirkstone", "poky:langdale", "poky:master"], + "BUILD_HISTORY_DIRECTPUSH" : ["poky:morty", "poky:pyro", "poky:rocko", "poky:sumo", "poky:thud", "poky:warrior", "poky:zeus", "poky:dunfell", "poky:gatesgarth", "poky:hardknott", "poky:honister", "poky:kirkstone", "poky:langdale", "poky:mickledore", "poky:master"], "BUILD_HISTORY_FORKPUSH" : {"poky-contrib:ross/mut" : "poky:master", "poky-contrib:abelloni/master-next": "poky:master", "poky:master-next" : "poky:master"}, "BUILDTOOLS_URL_TEMPLOCAL" : "/srv/autobuilder/autobuilder.yocto.io/pub/non-release/20210214-8/buildtools/x86_64-buildtools-extended-nativesdk-standalone-3.2+snapshot-7d38cc8e749aedb8435ee71847e04b353cca541d.sh",