From patchwork Fri Feb 10 13:39:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 19336 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 129BDC636D4 for ; Fri, 10 Feb 2023 13:39:46 +0000 (UTC) Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) by mx.groups.io with SMTP id smtpd.web11.14536.1676036378903985717 for ; Fri, 10 Feb 2023 05:39:39 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@myneves.com header.s=protonmail header.b=OcLbxt9Z; spf=pass (domain: myneves.com, ip: 185.70.43.17, mailfrom: paulo@myneves.com) Date: Fri, 10 Feb 2023 13:39:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myneves.com; s=protonmail; t=1676036375; x=1676295575; bh=xRpanUN3+ZS604yK7epgoSd8VsAiBy9OE8XMTnEZTBE=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=OcLbxt9ZKw8Nfgeqxj9YYZcTYQ+ExkUhDlXS7d/Tjp6TX068qmc3Gg4hmj268mQOA uD4RID/aYORE8jA4wPCDyrNOV3JzD6j+LH0KkucdnUl5bydH6rI6qkPQlhxt+fgDUG 1F76EzEU8gtpeZnQEkekcex0gMLv9i2cNGOmf7h0EzuCf1InqQCgJeGwLBhGoqCPve pL6bOjuAiYG8RrDCjLaCRbLvWJ9hbFEd4d+V4F7UdtIqCW+kzEqT5TIPuVaYlvW1ji VK3cMnTSYFgVy6ZZPuYWWk1pnzZGaVxBfd8jGdksCJpy2EyXZuZcZdBYRG8sdYHMRe VwQ4PRFo9r31A== To: bitbake-devel@lists.openembedded.org From: Paulo Neves Cc: Paulo Neves Subject: [PATCH 1/3] tests: Remove redundant lfs=1 URI paramter Message-ID: <20230210133921.1268885-1-paulo@myneves.com> Feedback-ID: 59941854:user:proton 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, 10 Feb 2023 13:39:46 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14391 lfs=1 is assumed unless explicitly disabled with lfs=0 This way we test the implicit case, which is also the default for most users. Signed-off-by: Paulo Neves --- lib/bb/tests/fetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.34.1 diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index f3890321d..122d7e05f 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -2235,7 +2235,7 @@ class GitLfsTest(FetcherTest): def test_lfs_enabled(self): import shutil - uri = 'git://%s;protocol=file;lfs=1;branch=master' % self.srcdir + uri = 'git://%s;protocol=file;branch=master' % self.srcdir self.d.setVar('SRC_URI', uri) # Careful: suppress initial attempt at downloading until From patchwork Fri Feb 10 13:39:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 19337 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 EE1B3C636CD for ; Fri, 10 Feb 2023 13:39:45 +0000 (UTC) Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) by mx.groups.io with SMTP id smtpd.web11.14540.1676036385011596810 for ; Fri, 10 Feb 2023 05:39:45 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@myneves.com header.s=protonmail header.b=k3o1FosU; spf=pass (domain: myneves.com, ip: 185.70.40.18, mailfrom: paulo@myneves.com) Date: Fri, 10 Feb 2023 13:39:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myneves.com; s=protonmail; t=1676036382; x=1676295582; bh=kUyhV8wUriS8tbyUxh3tqvE0sMd2pZ7QJXaB0BxkGZg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=k3o1FosU8kyUKN9ct3WG2e4b/vMGPisHQrBApnkqyHylJ6xSAzanecC6ADfAO4Qml cvJZ9tJ12+kgxL4RqftIQaDZJmcRPfJE3WunWORbtMVA/sen8yCew/1pQGSNChgO9f 39vdGCz7/5p+MOAjD8TTKGnpdoN5KNM9Ut+YrrjIS5IRq98mrOweKWJE77wFHMPosm phlaIE6q7UnSKsxIx0IiQv7gnkuRAcXcSOfIzfUMiT2Zx2Z97zUGSQMiRtXczGqqVg YqriH1vg8QUMwW9Guyy6CBoQX9Vm88nvVjZAWEQPFI1bUmx5IYLM6FqqGGHJzI+cCA OJF0pH7PJ0kcA== To: bitbake-devel@lists.openembedded.org From: Paulo Neves Cc: Paulo Neves Subject: [PATCH 2/3] tests: Make test_lfs_enabled actually test git-lfs Message-ID: <20230210133921.1268885-2-paulo@myneves.com> In-Reply-To: <20230210133921.1268885-1-paulo@myneves.com> References: <20230210133921.1268885-1-paulo@myneves.com> Feedback-ID: 59941854:user:proton 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, 10 Feb 2023 13:39:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14392 Due to the datastore not having the PATH variable set, _find_git_lfs would never return true and thus fetcher's git lfs test logic was unreachable. Now we set PATH on the datastore of the test and if the test host has git-lfs the test will actually test git-lfs logic. Signed-off-by: Paulo Neves --- lib/bb/tests/fetch.py | 1 + 1 file changed, 1 insertion(+) -- 2.34.1 diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index 122d7e05f..a9ad247d9 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -2237,6 +2237,7 @@ class GitLfsTest(FetcherTest): uri = 'git://%s;protocol=file;branch=master' % self.srcdir self.d.setVar('SRC_URI', uri) + self.d.setVar('PATH', os.environ.get('PATH')) # Careful: suppress initial attempt at downloading until # we know whether git-lfs is installed. From patchwork Fri Feb 10 13:39:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 19338 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 D8237C05027 for ; Fri, 10 Feb 2023 13:39:55 +0000 (UTC) Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) by mx.groups.io with SMTP id smtpd.web11.14545.1676036390875516840 for ; Fri, 10 Feb 2023 05:39:51 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@myneves.com header.s=protonmail header.b=m/0ej24P; spf=pass (domain: myneves.com, ip: 185.70.40.18, mailfrom: paulo@myneves.com) Date: Fri, 10 Feb 2023 13:39:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myneves.com; s=protonmail; t=1676036389; x=1676295589; bh=czVpG46lY1GrlnQ034Q45SgYoLYdlSOAzJs+ZgGrK0U=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=m/0ej24PqtbK4NPmlHtXLa8RGGEbzTbCf+LqBW+iNYkc+sdIhs0AfYNg1P4wMHrQ8 cCJdu+piLIog0rkTnq6HmuXXC8MaE87ry6Hol0lAdXxD179scL/yfUFhCeXfzReay1 4klla8eeqjk+8HGpHBEgqdWL9toA+txHM1tH89GU01cI+ePY4gBayuU4J3MSWP6RUq IK1xYVvOL65PVamJnImJmVc7O906ym1M+pnOCgBlHQ+V2v7qyyXueJjZ49g4BMxx5T EvNQk4NGz+3AA8DwyqlGChhzne323u2RHuG3XUf+O6piEMN3qTprsPYJqUd3Grod2d 01iiYA2FsYluA== To: bitbake-devel@lists.openembedded.org From: Paulo Neves Cc: Paulo Neves Subject: [PATCH 3/3] tests: Make sure test_lfs_enabled is ran with git lfs available Message-ID: <20230210133921.1268885-3-paulo@myneves.com> In-Reply-To: <20230210133921.1268885-1-paulo@myneves.com> References: <20230210133921.1268885-1-paulo@myneves.com> Feedback-ID: 59941854:user:proton 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, 10 Feb 2023 13:39:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/14393 If git lfs does not exist in the host the test does not run all the code paths possible, thus is not reproducile Signed-off-by: Paulo Neves --- lib/bb/tests/fetch.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 2.34.1 diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index a9ad247d9..9b18f159d 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -2243,13 +2243,12 @@ class GitLfsTest(FetcherTest): # we know whether git-lfs is installed. fetcher, ud = self.fetch(uri=None, download=False) self.assertIsNotNone(ud.method._find_git_lfs) + self.assertTrue(ud.method._find_git_lfs(self.d), + msg="git-lfs not found. Cannot test git-lfs without git-lfs in the PATH") - # If git-lfs can be found, the unpack should be successful. Only - # attempt this with the real live copy of git-lfs installed. - if ud.method._find_git_lfs(self.d): - fetcher.download() - shutil.rmtree(self.gitdir, ignore_errors=True) - fetcher.unpack(self.d.getVar('WORKDIR')) + fetcher.download() + shutil.rmtree(self.gitdir, ignore_errors=True) + fetcher.unpack(self.d.getVar('WORKDIR')) # If git-lfs cannot be found, the unpack should throw an error with self.assertRaises(bb.fetch2.FetchError):