diff mbox series

lib/bb/tests: use bb.build.listtasks() instead of __BBTASKS

Message ID 20241204101911.1218039-1-ross.burton@arm.com
State Accepted, archived
Commit 452289efc6d3608ceca321286fd5bf417a6e1bed
Headers show
Series lib/bb/tests: use bb.build.listtasks() instead of __BBTASKS | expand

Commit Message

Ross Burton Dec. 4, 2024, 10:19 a.m. UTC
Use the new listtasks() function (introduced in 185c4b) to avoid
accessing a private variable.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 bitbake/lib/bb/tests/parse.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mathieu Dubois-Briand Dec. 4, 2024, 5:29 p.m. UTC | #1
On Wed Dec 4, 2024 at 11:19 AM CET, Ross Burton via lists.openembedded.org wrote:
> Use the new listtasks() function (introduced in 185c4b) to avoid
> accessing a private variable.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---

Hi Ross,

I believe some oe-selftest will need update after this modification. I
have the following error on the autobuilder:

FAIL: test_parse_addtask_deltask (bb.tests.parse.ParseTest.test_parse_addtask_deltask)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/tests/parse.py", line 204, in test_parse_addtask_deltask
    self.assertEqual(['do_fetch2', 'do_patch2', 'do_myplaintask', 'do_mytask', 'do_mytask2', 'do_mytask5'], bb.build.listtasks(d))
AssertionError: ['do_fetch2', 'do_patch2', 'do_myplaintas[39 chars]sk5'] != ('do_fetch2', 'do_patch2', 'do_myplaintas[39 chars]sk5')

https://valkyrie.yoctoproject.org/#/builders/48/builds/502/steps/11/logs/stdio
Ross Burton Dec. 4, 2024, 5:46 p.m. UTC | #2
On 4 Dec 2024, at 17:29, Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> wrote:
> 
> On Wed Dec 4, 2024 at 11:19 AM CET, Ross Burton via lists.openembedded.org wrote:
>> Use the new listtasks() function (introduced in 185c4b) to avoid
>> accessing a private variable.
>> 
>> Signed-off-by: Ross Burton <ross.burton@arm.com>
>> ---
> 
> Hi Ross,
> 
> I believe some oe-selftest will need update after this modification. I
> have the following error on the autobuilder:
> 
> FAIL: test_parse_addtask_deltask (bb.tests.parse.ParseTest.test_parse_addtask_deltask)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/srv/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/tests/parse.py", line 204, in test_parse_addtask_deltask
>    self.assertEqual(['do_fetch2', 'do_patch2', 'do_myplaintask', 'do_mytask', 'do_mytask2', 'do_mytask5'], bb.build.listtasks(d))
> AssertionError: ['do_fetch2', 'do_patch2', 'do_myplaintas[39 chars]sk5'] != ('do_fetch2', 'do_patch2', 'do_myplaintas[39 chars]sk5’)

I thought I’d ran the test suite but it looks like it’s moaning about the type of the container.  Sorry, I’ll fix up.

Ross
diff mbox series

Patch

diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index 410679d5a1b..c31ece3d75c 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/lib/bb/tests/parse.py
@@ -201,7 +201,7 @@  deltask ${EMPTYVAR}
         f = self.parsehelper(self.addtask_deltask)
         d = bb.parse.handle(f.name, self.d)['']
 
-        self.assertEqual(['do_fetch2', 'do_patch2', 'do_myplaintask', 'do_mytask', 'do_mytask2', 'do_mytask5'], d.getVar("__BBTASKS"))
+        self.assertEqual(['do_fetch2', 'do_patch2', 'do_myplaintask', 'do_mytask', 'do_mytask2', 'do_mytask5'], bb.build.listtasks(d))
         self.assertEqual(['do_mytask'], d.getVarFlag("do_mytask5", "deps"))
 
     broken_multiline_comment = """