* [wrynose][PATCH 2/2] oeqa/selftest/devtool: cover update-recipe --initial-rev
2026-10-02 1:08 [wrynose][PATCH 1/2] devtool: standard: fix update-recipe/finish --initial-rev override Babanpreet Singh
@ 2026-10-02 1:08 ` Babanpreet Singh
0 siblings, 0 replies; 2+ messages in thread
From: Babanpreet Singh @ 2026-10-02 1:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Yoann Congal, Julien Stephan, Babanpreet Singh
The --initial-rev option had no selftest coverage. Extend
test_devtool_update_recipe to run update-recipe with --initial-rev
set to the recorded initial revision, which should match the default
output, and to a revision partway through the local commits, which
should export only the commits after it.
AI-Generated: Uses Claude (claude-fable-5)
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 171af3b2915dd076c8d1b205ff75eac1ebd5a586)
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
meta/lib/oeqa/selftest/cases/devtool.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 5ed69aee1b..b485d752e7 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1219,6 +1219,28 @@ class DevtoolUpdateTests(DevtoolBase):
self._check_repo_status(os.path.dirname(recipefile), expected_status)
result = runCmd(cleanup_cmd)
self._check_repo_status(os.path.dirname(recipefile), [])
+ # Now try the same passing --initial-rev: the recorded initial
+ # revision must give the same result as not passing the option, and a
+ # later revision must export only the commits after it
+ result = runCmd('git rev-parse devtool-base', cwd=tempdir)
+ initial_rev = result.output.strip()
+ result = runCmd('devtool update-recipe --initial-rev %s %s' % (initial_rev, testrecipe))
+ result = runCmd('git add minicom', cwd=os.path.dirname(recipefile))
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ ('A ', '.*/0001-Change-the-README.patch$'),
+ ('A ', '.*/0002-Add-a-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ result = runCmd(cleanup_cmd)
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ result = runCmd('git rev-parse HEAD~1', cwd=tempdir)
+ midpoint_rev = result.output.strip()
+ result = runCmd('devtool update-recipe --initial-rev %s %s' % (midpoint_rev, testrecipe))
+ result = runCmd('git add minicom', cwd=os.path.dirname(recipefile))
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ ('A ', '.*/0001-Add-a-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ result = runCmd(cleanup_cmd)
+ self._check_repo_status(os.path.dirname(recipefile), [])
def test_devtool_update_recipe_git(self):
# Check preconditions
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread