Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Babanpreet Singh <bbnpreetsingh@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Randy MacLeod <randy.macleod@windriver.com>,
	Gyorgy Sarvari <skandigraun@gmail.com>,
	Chris Laplante <chris.laplante@agilent.com>,
	Adrian Freihofer <adrian.freihofer@siemens.com>,
	Peter Kjellerstedt <pkj@axis.com>,
	Babanpreet Singh <bbnpreetsingh@gmail.com>
Subject: [PATCH 2/2] oeqa/selftest/devtool: add test for finishing a recipe using AUTOREV
Date: Mon, 13 Jul 2026 06:04:44 +0000	[thread overview]
Message-ID: <20260713060444.7-3-bbnpreetsingh@gmail.com> (raw)
In-Reply-To: <20260713060444.7-1-bbnpreetsingh@gmail.com>

Add a test checking that a recipe created with devtool add --autorev
can be finished into a layer, that the finished recipe still uses
SRCREV = "${AUTOREV}", and that no spurious patch files are generated.

Before the previous commit, devtool finish failed on such recipes with:

    fatal: bad revision 'AUTOINC'

Test requested by Randy MacLeod in the bug report.

[YOCTO #16354]

AI-Generated: Uses Claude (claude-sonnet-5)
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
 meta/lib/oeqa/selftest/cases/devtool.py | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index b2cd13e9a5..a3c7c293c5 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -469,6 +469,38 @@ class DevtoolAddTests(DevtoolBase):
         checkvars['DEPENDS'] = set(['dbus'])
         self._test_recipe_contents(recipefile, checkvars, [])
 
+    def test_devtool_add_git_autorev_finish(self):
+        # Test that a recipe created by devtool add --autorev can be finished
+        # into a layer; this used to fail with "fatal: bad revision 'AUTOINC'"
+        # because the unresolved AUTOREV placeholder was used as the git
+        # revision to export patches from [YOCTO #16354]
+        pn = 'dbus-wait'
+        url = 'git://git.yoctoproject.org/dbus-wait;protocol=https;branch=master'
+        self.track_for_cleanup(self.workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        result = runCmd("devtool add --autorev %s '%s'" % (pn, url))
+        recipefile = os.path.join(self.workspacedir, 'recipes', pn, '%s_git.bb' % pn)
+        self.assertExists(recipefile, 'Recipe not created by devtool add')
+        checkvars = {}
+        checkvars['SRCREV'] = '${AUTOREV}'
+        self._test_recipe_contents(recipefile, checkvars, [])
+        # Finish the recipe into a temporary layer
+        templayerdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(templayerdir)
+        self._create_temp_layer(templayerdir, False, 'selftestautorev')
+        result = runCmd('devtool finish %s %s' % (pn, templayerdir))
+        result = runCmd('devtool status')
+        self.assertNotIn(pn, result.output, 'Recipe should have been reset by finish but wasn\'t')
+        newrecipefiles = glob.glob(os.path.join(templayerdir, 'recipes-*', pn, '%s_git.bb' % pn))
+        self.assertEqual(len(newrecipefiles), 1, 'Recipe not moved into destination layer by devtool finish')
+        # The recipe should still use a floating revision and no patch
+        # files should have been created
+        checkvars = {}
+        checkvars['SRCREV'] = '${AUTOREV}'
+        self._test_recipe_contents(newrecipefiles[0], checkvars, [])
+        patchfiles = glob.glob(os.path.join(templayerdir, 'recipes-*', pn, '*', '*.patch'))
+        self.assertEqual(patchfiles, [], 'Unexpected patch files generated by devtool finish')
+
     def test_devtool_add_git_style1(self):
         version = 'v3.1.0'
         pn = 'mbedtls'
-- 
2.43.0



  parent reply	other threads:[~2026-07-13  6:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  6:04 [PATCH 0/2] devtool: fix finish for recipes using AUTOREV Babanpreet Singh
2026-07-13  6:04 ` [PATCH 1/2] devtool: standard: fix finish/update-recipe " Babanpreet Singh
2026-07-13  6:04 ` Babanpreet Singh [this message]
2026-07-13 13:22   ` [OE-core] [PATCH 2/2] oeqa/selftest/devtool: add test for finishing a recipe " Alexander Kanavin
2026-07-14  2:32     ` Babanpreet Singh
2026-07-14  3:20 ` [PATCH v2 1/2] devtool: standard: fix finish/update-recipe for recipes " Babanpreet Singh
2026-07-14  3:20   ` [PATCH v2 2/2] oeqa/selftest/devtool: exercise devtool finish on an AUTOREV recipe Babanpreet Singh
2026-07-14 10:16     ` Alexander Kanavin

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=20260713060444.7-3-bbnpreetsingh@gmail.com \
    --to=bbnpreetsingh@gmail.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=chris.laplante@agilent.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pkj@axis.com \
    --cc=randy.macleod@windriver.com \
    --cc=skandigraun@gmail.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