From patchwork Fri Feb 9 09:37:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 39102 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 9362EC4828F for ; Fri, 9 Feb 2024 09:37:35 +0000 (UTC) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mx.groups.io with SMTP id smtpd.web10.8033.1707471445952325085 for ; Fri, 09 Feb 2024 01:37:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=gC0WWcdd; spf=pass (domain: linuxfoundation.org, ip: 209.85.167.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-51165a488baso905434e87.2 for ; Fri, 09 Feb 2024 01:37:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1707471444; x=1708076244; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Rjqh2BkVF2vIITFyXHKHWmMNQmqrYTgHKw9RVuzECIk=; b=gC0WWcddhUpuv8bDpO4WNK0nCDBfSg2o0Gbumnn07pr4LXu4CUbLD3bUZ7e//r/dtg TaH6ID+NZtqmpJfjVOf35Jgo9VTLAntUfynEwLtEwwcL4RTzqG/a45LwpEJEq7LB7tit +CAzo4RZKuTIjqa0Ci2pqxRSzvuLCTDR+YJAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707471444; x=1708076244; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Rjqh2BkVF2vIITFyXHKHWmMNQmqrYTgHKw9RVuzECIk=; b=gwdvd9h7z8cJkUmy6OLuU6hA90Kh0oG6fYRjutCecnQgJrLleLDUSdi43OYnuRnbSO mvt2xCnvVQ38QDOgI1ZYL3HHDVI0fDgG33F62AAbWsw2wf+MmvZlI4WpGF9BST2nIxQC HuwBKwfy7Ypjx6NdVM8zCOkYhYgKoOmPmUEtNibRteI68rvApRb/sKvKBKZy680Ur0HD 6dZt7+MnobE6dsrRQRieKkjni09AKKN3AiklPAkn7cmD1D7QcZV8x7rqyqN9gAGgw+9C H+/nYPxdFPbOmD/LByDbn7yT8toGnFPtdy5If5MBN/skFoLHakDKYnWGOfjKubr8f0VU LakQ== X-Gm-Message-State: AOJu0Ywv0LyBxtv9FWbyAmKnVQ2n1tTaPGsTA6LtErVd0fMqmWhBa3VP k6ix0T26IEBmFLtTMomuuWJO2DA0/Box3sUJpJlsIiKqu7uRrvvqpKoZfOQQ/zu0qk/fz+ySmbL r X-Google-Smtp-Source: AGHT+IH75vjW65D6qcJ4sC2Z1Je3GKxD0za3+v1UjbWqjxkeCZlHDnwOS8jkdEA7bwP708q1IPdI2A== X-Received: by 2002:ac2:5551:0:b0:511:3c74:cd1c with SMTP id l17-20020ac25551000000b005113c74cd1cmr629342lfk.23.1707471443322; Fri, 09 Feb 2024 01:37:23 -0800 (PST) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:47e1:ee11:154c:e6b3]) by smtp.gmail.com with ESMTPSA id g12-20020a5d554c000000b0033b5ee36963sm1330764wrw.23.2024.02.09.01.37.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 01:37:22 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/3] selftest/recipetool: Factor tomllib test to a function Date: Fri, 9 Feb 2024 09:37:20 +0000 Message-Id: <20240209093722.3363011-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 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 ; Fri, 09 Feb 2024 09:37:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195192 As more tests start to need this codeblock, factor it into a common function. Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/recipetool.py | 65 +++++++--------------- 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 39114c67622..780e25b6c82 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -28,6 +28,16 @@ def tearDownModule(): runCmd('rm -rf %s' % templayerdir) +def needTomllib(test): + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + try: + import tomllib + except ImportError: + try: + import tomli + except ImportError: + test.skipTest('Test requires python 3.11 or above for tomllib module or tomli module') + class RecipetoolBase(devtool.DevtoolTestCase): def setUpLocal(self): @@ -554,15 +564,8 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_python3_pep517_setuptools_build_meta(self): - # This test require python 3.11 or above for the tomllib module - # or tomli module to be installed - try: - import tomllib - except ImportError: - try: - import tomli - except ImportError: - self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module') + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + needTomllib(self) # Test creating python3 package from tarball (using setuptools.build_meta class) temprecipe = os.path.join(self.tempdir, 'recipe') @@ -583,15 +586,8 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_python3_pep517_poetry_core_masonry_api(self): - # This test require python 3.11 or above for the tomllib module - # or tomli module to be installed - try: - import tomllib - except ImportError: - try: - import tomli - except ImportError: - self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module') + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + needTomllib(self) # Test creating python3 package from tarball (using poetry.core.masonry.api class) temprecipe = os.path.join(self.tempdir, 'recipe') @@ -612,15 +608,8 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_python3_pep517_flit_core_buildapi(self): - # This test require python 3.11 or above for the tomllib module - # or tomli module to be installed - try: - import tomllib - except ImportError: - try: - import tomli - except ImportError: - self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module') + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + needTomllib(self) # Test creating python3 package from tarball (using flit_core.buildapi class) temprecipe = os.path.join(self.tempdir, 'recipe') @@ -641,15 +630,8 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_python3_pep517_hatchling(self): - # This test require python 3.11 or above for the tomllib module - # or tomli module to be installed - try: - import tomllib - except ImportError: - try: - import tomli - except ImportError: - self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module') + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + needTomllib(self) # Test creating python3 package from tarball (using hatchling class) temprecipe = os.path.join(self.tempdir, 'recipe') @@ -671,15 +653,8 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_python3_pep517_maturin(self): - # This test require python 3.11 or above for the tomllib module - # or tomli module to be installed - try: - import tomllib - except ImportError: - try: - import tomli - except ImportError: - self.skipTest('Test requires python 3.11 or above for tomllib module or tomli module') + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + needTomllib(self) # Test creating python3 package from tarball (using maturin class) temprecipe = os.path.join(self.tempdir, 'recipe') From patchwork Fri Feb 9 09:37:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 39101 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 9497BC4829C for ; Fri, 9 Feb 2024 09:37:35 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web11.7873.1707471446375272921 for ; Fri, 09 Feb 2024 01:37:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=IWQwUiBc; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4101fc00832so6104535e9.3 for ; Fri, 09 Feb 2024 01:37:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1707471444; x=1708076244; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=V1EbSNVP4H7lDQwQpNkeqHbX2Vhtc0ss4nB4wHfAiiY=; b=IWQwUiBcZXW4jeOPfmmp7MInD8HlljGHK8+f3PPhezPy9oGBKlKVMOwCUbGCHvZel9 57sCelIgVgOHClxdJXF2r222vY430DErW2mCXYW6fRlfWFG2+lFHB2/I6CdEnna8RBjF JgVsAS49opbEcCcrNs6hnOpn98GxkXZwOlO9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707471444; x=1708076244; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V1EbSNVP4H7lDQwQpNkeqHbX2Vhtc0ss4nB4wHfAiiY=; b=mJuaNggalC3U67Li97WUTk+wnWA1tWaEau5GwHiYeZ2k864i+Y7sn9y6jvj+9/c35m uUWejrT4ihY4lMo0rWnc0Ec4ojQg1coUEu4LVVFQOkQ0pr8TmakAjbPiU4bT3KR6Tl1+ gE6wTFLA0cnKtnNmCzWW0RDjdhTvfoRaOmlbbQRkyvSxlun/zjgf/n2uENboj9iN29uv cY19NpVCRxmNlXY5Xe8I+Z+dc20f+k2D+LpiS0rToORHXgSuk8YsxXjOhVzkskDY2eou ZIHE2bPT1vKOaMoCOzr7laOP7dCcz2R19Vyvs9OqauuueryNh/SuDYj9mz+xta4at2m/ 922g== X-Gm-Message-State: AOJu0YzGmd7uj/wKCz+Im3M0pOPa1HoB9mHmbJJmiwfh9mWW1F7iLThN R9Kmotkk4+M/rrI9IDS/mfKKMnLblxa/Em8xfYEVqNtZUcXV4FFPO8qqhs99GVWRlav1YXXTeas 1 X-Google-Smtp-Source: AGHT+IECCZtAfdA7blfaVnkeSkxq6z1xORFoxp0FFroH02niUWXHbcdFa8ZYWw1HcRa7ocM7nJYsVg== X-Received: by 2002:a05:600c:310e:b0:40e:e6ce:71ff with SMTP id g14-20020a05600c310e00b0040ee6ce71ffmr736654wmo.41.1707471444104; Fri, 09 Feb 2024 01:37:24 -0800 (PST) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:47e1:ee11:154c:e6b3]) by smtp.gmail.com with ESMTPSA id g12-20020a5d554c000000b0033b5ee36963sm1330764wrw.23.2024.02.09.01.37.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 01:37:23 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/3] selftest/recipetool: Mark two extra tests as needing tomllib Date: Fri, 9 Feb 2024 09:37:21 +0000 Message-Id: <20240209093722.3363011-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240209093722.3363011-1-richard.purdie@linuxfoundation.org> References: <20240209093722.3363011-1-richard.purdie@linuxfoundation.org> 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 ; Fri, 09 Feb 2024 09:37:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195194 These two tests now fail if tomllib isn't present. Mark them accordingly. Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/recipetool.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 780e25b6c82..9deafcda0d9 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -451,6 +451,9 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_github(self): + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + needTomllib(self) + # Basic test to see if github URL mangling works temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) @@ -675,6 +678,9 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_github_tarball(self): + # This test require python 3.11 or above for the tomllib module or tomli module to be installed + needTomllib(self) + # Basic test to ensure github URL mangling doesn't apply to release tarballs temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) From patchwork Fri Feb 9 09:37:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 39103 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 D3EC6C4829E for ; Fri, 9 Feb 2024 09:37:35 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web10.8034.1707471446469475865 for ; Fri, 09 Feb 2024 01:37:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=gLP4B0TK; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40ef3f351d2so10203585e9.1 for ; Fri, 09 Feb 2024 01:37:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1707471445; x=1708076245; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=o8p1ybia84d/21vqEbW/ZHvt8zzN+2PNqQxBlVbwSBo=; b=gLP4B0TKBjotQLD5Hm681ktE1mFrR7XQSOVx7Xm613or4+zfdtYhncEB0Qeah0Fa+o xmNmlREUNk4mBEGXtZ0gM9+bFCmf7OmbLf2hSxAp4BMIhMJNgCtpGDkmEdsrDJwShpvb 98Skd1x4d5G7nwHZYDinN555NLWGjiC5+d+JI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707471445; x=1708076245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o8p1ybia84d/21vqEbW/ZHvt8zzN+2PNqQxBlVbwSBo=; b=Bsrp0SRj1zI/WvZk6jHPVRxMJ36iNMi0SL6ZGH81aburKDycLnvalVx760rzRSXgJf stIOM37Dcx1q1dxbgeFqy0RlEyojvK8ssfWo+qtuH7nRBFG4xqe7pxSLY9gaZStYsNUc fU28fM9eZ/amPcAjSntyOI6z/E7RKxhJnX/slqCj/CxlUjdqo01RIJfs4VwT6ZsoXaJu hDhwAOSVCJMarv7KrEKKjqJ/NJ7qvrf20z+DX19AQ/pN0XYxczhoYe29HSPMlhHfgg8s CtGGya4thmT59TFivEGBx9AXor4qYZ5kL2gYT7M1n2ux6pFuYUasERyLOOSSLVjS+yei ex0Q== X-Gm-Message-State: AOJu0YyUyccPxKpi6icSh0jXWzd9VHFbjVtRAvnyqYdAxuuKU/OYLe3I cuBnrWPujliWcJs76U+HKjSkwW+MgFQYUg1U9aOOsmsFkMA0ypUZQlc3t1mEy3ZRkRMYL8plzDc y X-Google-Smtp-Source: AGHT+IEd441Vewsci0EMCTw3Evkdpsy7Glv4FoDF6M0pa4U7znvawrkcjyy9IRxHAGECellVJryfjg== X-Received: by 2002:a05:600c:1c8b:b0:40f:b0d9:632a with SMTP id k11-20020a05600c1c8b00b0040fb0d9632amr490559wms.14.1707471444866; Fri, 09 Feb 2024 01:37:24 -0800 (PST) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:47e1:ee11:154c:e6b3]) by smtp.gmail.com with ESMTPSA id g12-20020a5d554c000000b0033b5ee36963sm1330764wrw.23.2024.02.09.01.37.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 01:37:24 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/3] selftest/recipetool: Improve test failure output Date: Fri, 9 Feb 2024 09:37:22 +0000 Message-Id: <20240209093722.3363011-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240209093722.3363011-1-richard.purdie@linuxfoundation.org> References: <20240209093722.3363011-1-richard.purdie@linuxfoundation.org> 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 ; Fri, 09 Feb 2024 09:37:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/195193 When the test fails, it simply says the file doesn't exist. This isn't helpful so improve the output. Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/recipetool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 9deafcda0d9..6a8d0302f71 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -459,8 +459,9 @@ class RecipetoolCreateTests(RecipetoolBase): os.makedirs(temprecipe) recipefile = os.path.join(temprecipe, 'meson_git.bb') srcuri = 'https://github.com/mesonbuild/meson;rev=1.3.1' - result = runCmd(['recipetool', 'create', '-o', temprecipe, srcuri]) - self.assertTrue(os.path.isfile(recipefile)) + cmd = ['recipetool', 'create', '-o', temprecipe, srcuri] + result = runCmd(cmd) + self.assertTrue(os.path.isfile(recipefile), msg="recipe %s not created for command %s, output %s" % (recipefile, " ".join(cmd), result.output)) checkvars = {} checkvars['LICENSE'] = set(['Apache-2.0', 'Proprietary', 'Unknown']) checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https;branch=1.3'