From: Paul Barker <paul@pbarker.dev>
To: Jamin Lin <jamin_lin@aspeedtech.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>,
"alex.kanavin@gmail.com" <alex.kanavin@gmail.com>,
"mathieu.dubois-briand@bootlin.com"
<mathieu.dubois-briand@bootlin.com>
Cc: Troy Lee <troy_lee@aspeedtech.com>
Subject: Re: [PATCH v4 5/5] oeqa/selftest/devtool: Add test for multiple nested git destsuffix repos
Date: Sun, 16 Aug 2026 12:08:53 +0100 [thread overview]
Message-ID: <a9062529d1d715e7a7054b75a86f726a5149185c.camel@pbarker.dev> (raw)
In-Reply-To: <20260731092634.1127862-6-jamin_lin@aspeedtech.com>
On Fri, 2026-07-31 at 09:26 +0000, Jamin Lin wrote:
> Add test_devtool_modify_multi_git_destsuffix_standalone to verify that
> devtool modify converts all nested git repos (from multiple SRC_URI git
> entries with different destsuffix values, including a repo nested inside
> another repo's own working tree) to standalone clones so the workspace
> survives 'bitbake -c cleanall'.
>
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
> meta/lib/oeqa/selftest/cases/devtool.py | 64 +++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
> index a10eb0c784..de73a2e620 100644
> --- a/meta/lib/oeqa/selftest/cases/devtool.py
> +++ b/meta/lib/oeqa/selftest/cases/devtool.py
> @@ -1265,6 +1265,70 @@ class DevtoolModifyTests(DevtoolBase):
> self.assertExists(os.path.join(source_repo_gitsm_gitmodules, 'bitbake'), 'Submodule not found')
> self.assertExists(os.path.join(source_repo_gitsm_gitmodules, 'bitbake-gitsm-test1'), 'Submodule not found')
>
> + def test_devtool_modify_multi_git_destsuffix_standalone(self):
> + """
> + Verify that devtool modify converts all nested git repos (from multiple
> + SRC_URI git entries with different destsuffix values) to standalone clones
> + so that 'bitbake -c cleanall' does not break the devtool workspace.
> +
> + The recipe (devtool-test-multi-destsuffix) has three git SRC_URI entries
> + with S = ${UNPACKDIR}, each nested inside the previous repo's own
> + working tree:
> + destsuffix=level1 -> srcdir/level1/
> + destsuffix=level1/level2 -> srcdir/level1/level2/
> + destsuffix=level1/level2/level3 -> srcdir/level1/level2/level3/
> +
> + This mirrors real-world recipes that embed multiple module repos
> + as nested subdirectories of the primary source tree, including the
> + case where one repo's checkout lives inside another repo's working
> + tree rather than merely under a shared plain directory.
> + """
> + testrecipe = 'devtool-test-multi-destsuffix'
> + src_uri = get_bb_var('SRC_URI', testrecipe)
> + self.assertIn('git://', src_uri,
> + 'This test expects %s to have git SRC_URI entries' % testrecipe)
> + self.track_for_cleanup(self.workspacedir)
> + self.add_command_to_tearDown('devtool reset %s' % testrecipe)
> + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
> + result = runCmd('devtool modify %s' % testrecipe)
> + self.assertEqual(result.status, 0,
> + 'devtool modify failed: %s' % result.output)
> + srcdir = os.path.join(self.workspacedir, 'sources', testrecipe)
> + nested_paths = [
> + ('level1', 'level1'),
> + ('level2', 'level1/level2'),
> + ('level3', 'level1/level2/level3'),
> + ]
> +
> + for name, subpath in nested_paths:
> + repo_path = os.path.join(srcdir, subpath)
> + self.assertExists(os.path.join(repo_path, '.git'),
> + 'Repo %s (.git) not found in devtool workspace' % name)
> +
> + # Key assertion: no nested repo should retain a git alternates file.
> + # devtool modify must repack objects locally so the workspace does not
> + # depend on the downloads cache, which 'bitbake -c cleanall' will delete.
> + for name, subpath in nested_paths:
> + repo_path = os.path.join(srcdir, subpath)
> + alternates_file = os.path.join(repo_path, '.git', 'objects',
> + 'info', 'alternates')
> + self.assertNotExists(alternates_file,
> + 'Repo %s still has a git alternates file after '
> + 'devtool modify' % name)
> +
> + # Verify the workspace survives cleanall, which removes the shared
> + # objects in the downloads cache that alternates would reference.
> + bitbake('%s -c cleanall' % testrecipe)
We can't use cleanall here as it deletes data from the main downloads
directory. Is the above check for an alternates file not sufficient? If
not then this test needs to use an isolated downloads directory.
Best regards,
--
Paul Barker
next prev parent reply other threads:[~2026-08-16 11:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 9:26 [PATCH v4 0/5] devtool: fix standalone clone conversion for nested git repos Jamin Lin
2026-07-31 9:26 ` [PATCH v4 1/5] oe/patch: Skip commitIgnored when nothing is actually staged Jamin Lin
2026-08-16 10:50 ` Paul Barker
2026-08-17 3:57 ` Jamin Lin
2026-07-31 9:26 ` [PATCH v4 2/5] devtool: Register nested git repos before the initial commit Jamin Lin
2026-08-16 10:59 ` Paul Barker
2026-08-17 3:58 ` Jamin Lin
2026-07-31 9:26 ` [PATCH v4 3/5] devtool-source: Make nested destsuffix git repos standalone Jamin Lin
2026-08-16 11:05 ` Paul Barker
2026-07-31 9:26 ` [PATCH v4 4/5] meta-selftest: Add devtool-test-multi-destsuffix recipe Jamin Lin
2026-07-31 9:26 ` [PATCH v4 5/5] oeqa/selftest/devtool: Add test for multiple nested git destsuffix repos Jamin Lin
2026-08-16 11:08 ` Paul Barker [this message]
2026-08-17 4:01 ` Jamin Lin
2026-08-17 6:43 ` [PATCH v4 0/5] devtool: fix standalone clone conversion for nested git repos Jamin Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a9062529d1d715e7a7054b75a86f726a5149185c.camel@pbarker.dev \
--to=paul@pbarker.dev \
--cc=alex.kanavin@gmail.com \
--cc=jamin_lin@aspeedtech.com \
--cc=mathieu.dubois-briand@bootlin.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=troy_lee@aspeedtech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox