From patchwork Fri Jun 20 15:14:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 65359 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 A67A8C77B7A for ; Fri, 20 Jun 2025 15:14:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.2677.1750432484143206348 for ; Fri, 20 Jun 2025 08:14:44 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 45C8F16F2; Fri, 20 Jun 2025 08:14:24 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4F9693F673; Fri, 20 Jun 2025 08:14:43 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: christian.lindeberg@axis.com Subject: [PATCH 12/12] oeqa/selftest/devtool: update create_go test to match the new behaviour Date: Fri, 20 Jun 2025 16:14:29 +0100 Message-ID: <20250620151429.3210879-12-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250620151429.3210879-1-ross.burton@arm.com> References: <20250620151429.3210879-1-ross.burton@arm.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 ; Fri, 20 Jun 2025 15:14:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219139 Update the test now that the recipe uses go-mod-update-modules. Signed-off-by: Ross Burton --- meta/lib/oeqa/selftest/cases/recipetool.py | 33 +++++++--------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 36557f270fb..6097865b3eb 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -757,13 +757,12 @@ class RecipetoolCreateTests(RecipetoolBase): def test_recipetool_create_go(self): # Basic test to check go recipe generation + self.maxDiff = None + temprecipe = os.path.join(self.tempdir, 'recipe') os.makedirs(temprecipe) recipefile = os.path.join(temprecipe, 'recipetool-go-test_git.bb') - deps_require_file = os.path.join(temprecipe, 'recipetool-go-test', 'recipetool-go-test-modules.inc') - lics_require_file = os.path.join(temprecipe, 'recipetool-go-test', 'recipetool-go-test-licenses.inc') - modules_txt_file = os.path.join(temprecipe, 'recipetool-go-test', 'modules.txt') srcuri = 'https://git.yoctoproject.org/recipetool-go-test.git' srcrev = "c3e213c01b6c1406b430df03ef0d1ae77de5d2f7" @@ -771,13 +770,11 @@ class RecipetoolCreateTests(RecipetoolBase): result = runCmd('recipetool create -o %s %s -S %s -B %s' % (temprecipe, srcuri, srcrev, srcbranch)) - self.maxDiff = None - inherits = ['go-vendor'] + inherits = ['go-mod', 'go-mod-update-modules'] checkvars = {} checkvars['GO_IMPORT'] = "git.yoctoproject.org/recipetool-go-test" - checkvars['SRC_URI'] = {'git://${GO_IMPORT};destsuffix=git/src/${GO_IMPORT};nobranch=1;name=${BPN};protocol=https', - 'file://modules.txt'} + checkvars['SRC_URI'] = {'git://${GO_IMPORT};protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}'} checkvars['LIC_FILES_CHKSUM'] = { 'file://src/${GO_IMPORT}/LICENSE;md5=4e3933dd47afbf115e484d11385fb3bd', 'file://src/${GO_IMPORT}/is/LICENSE;md5=62beaee5a116dd1e80161667b1df39ab' @@ -786,26 +783,16 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) self.assertNotIn('Traceback', result.output) + lics_require_file = os.path.join(temprecipe, 'recipetool-go-test-licenses.inc') + self.assertFileExists(lics_require_file) checkvars = {} - checkvars['VENDORED_LIC_FILES_CHKSUM'] = set( - ['file://src/${GO_IMPORT}/vendor/github.com/godbus/dbus/v5/LICENSE;md5=09042bd5c6c96a2b9e45ddf1bc517eed', - 'file://src/${GO_IMPORT}/vendor/github.com/matryer/is/LICENSE;md5=62beaee5a116dd1e80161667b1df39ab']) - self.assertTrue(os.path.isfile(lics_require_file)) + checkvars['LIC_FILES_CHKSUM'] = {'file://pkg/mod/github.com/godbus/dbus/v5@v5.1.0/LICENSE;md5=09042bd5c6c96a2b9e45ddf1bc517eed;spdx=BSD-2-Clause'} self._test_recipe_contents(lics_require_file, checkvars, []) - # make sure that dependencies don't mention local directory ./matryer/is - dependencies = \ - [ ('github.com/godbus/dbus','v5.1.0', 'github.com/godbus/dbus/v5', '/v5', ''), - ] - - src_uri = set() - for d in dependencies: - src_uri.add(self._go_urifiy(*d)) - + deps_require_file = os.path.join(temprecipe, 'recipetool-go-test-go-mods.inc') + self.assertFileExists(deps_require_file) checkvars = {} - checkvars['GO_DEPENDENCIES_SRC_URI'] = src_uri - - self.assertTrue(os.path.isfile(deps_require_file)) + checkvars['SRC_URI'] = {'gomod://github.com/godbus/dbus/v5;version=v5.1.0;sha256sum=03dfa8e71089a6f477310d15c4d3a036d82d028532881b50fee254358e782ad9'} self._test_recipe_contents(deps_require_file, checkvars, []) class RecipetoolTests(RecipetoolBase):