Bug 16073 - toaster: Test using broken hard coded value : 7
Summary: toaster: Test using broken hard coded value : 7
Status: NEW
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 0.0.0
Assignee: David Reyna
QA Contact: Toaster default assignee
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-11-20 08:42 UTC by Mathieu Dubois-Briand
Modified: 2025-11-25 16:12 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Dubois-Briand 2025-11-20 08:42:26 UTC
Some new error that seems to happen frequently. Not sure if its on each build so far. I first added this to the generic AB-INT ticket [1], but I believe a dedicated ticket make sense here.

It might be linked with recent toaster changes.

[1]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15659

=================================== FAILURES ===================================
____________ TestCreateNewProject.test_create_new_project_kirkstone ____________

self = <toaster.tests.functional.test_create_new_project.TestCreateNewProject testMethod=test_create_new_project_kirkstone>

    def test_create_new_project_kirkstone(self):
        """ Test create new project using:
          - Project Name: Any string
          - Release: Yocto Project 4.0 "Kirkstone" (option value: 6)
          - Merge Toaster settings: True
        """
        release = '7'
        release_title = 'Yocto Project 4.0 "Kirkstone"'
        project_name = 'projectkirkstone'
>       self.create_new_project(
            project_name,
            release,
            release_title,
            True,
        )

../layers/bitbake/lib/toaster/tests/functional/test_create_new_project.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../layers/bitbake/lib/toaster/tests/functional/functional_helpers.py:175: in create_new_project
    select.select_by_value(release)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.support.select.Select object at 0x7544c5b35df0>
value = '7'

    def select_by_value(self, value: str) -> None:
        """Select all options that have a value matching the argument. That is,
        when given "foo" this would select an option like:
    
        <option value="foo">Bar</option>
    
        Args:
            value: The value to match against
    
        Raises:
            NoSuchElementException: If there is no option with specified value in SELECT
        """
        css = f"option[value ={self._escape_string(value)}]"
        opts = self._el.find_elements(By.CSS_SELECTOR, css)
        matched = False
        for opt in opts:
            self._set_selected(opt)
            if not self.is_multiple:
                return
            matched = True
        if not matched:
>           raise NoSuchElementException(f"Cannot locate option with value: {value}")
E           selenium.common.exceptions.NoSuchElementException: Message: Cannot locate option with value: 7; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
Comment 1 Mathieu Dubois-Briand 2025-11-20 08:43:55 UTC
toaster ubuntu2404-vk-3 master completed at 2025-11-20 03:12:53+00:00
E           selenium.common.exceptions.NoSuchElementException: Message: Cannot locate option with value: 7; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
https://autobuilder.yoctoproject.org/valkyrie/#/builders/88/builds/518/steps/12/logs/stdio
Comment 2 David Reyna 2025-11-20 09:01:14 UTC
With the removal of "Styhead", "Kirkstone" now in drops to the absolute position  "6". This is the normal size of the "supported" release table. 

This position should be stable for "Kirkstone" until "Kirkstone" is itself removed.

Here is the evidence. Look at the file "/layers/bitbake/lib/toaster/orm/fixtures/poky.xml":

  <object model="orm.bitbakeversion" pk="6">
    <field type="CharField" name="name">kirkstone</field>
    <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
    <field type="CharField" name="branch">2.0</field>
    <field type="CharField" name="dirpath"></field>
  </object>

I recommend that you update the test scripts for this new position.
Comment 3 David Reyna 2025-11-20 09:03:12 UTC
If possible, I recommend that the position for "Kirkstone" be programmatically derived from "/layers/bitbake/lib/toaster/orm/fixtures/poky.xml" so that there are no brittle hard coded values.

Hope this helps.
Comment 4 David Reyna 2025-11-20 09:21:21 UTC
Alternatively, if one goes to the Toaster page "toastergui/newproject/" and examines the ID "projectversion", they should find:

   <option value="6">Yocto Project 4.0 "Kirkstone"</option>
Comment 5 Mathieu Dubois-Briand 2025-11-25 09:37:59 UTC
toaster ubuntu2204-vk-4 master completed at 2025-11-20 08:55:24+00:00
E           selenium.common.exceptions.NoSuchElementException: Message: Cannot locate option with value: 7; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
https://autobuilder.yoctoproject.org/valkyrie/#/builders/88/builds/519/steps/12/logs/stdio

toaster ubuntu2404-vk-2 master completed at 2025-11-21 03:13:41+00:00
E           selenium.common.exceptions.NoSuchElementException: Message: Cannot locate option with value: 7; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception
https://autobuilder.yoctoproject.org/valkyrie/#/builders/88/builds/520/steps/12/logs/stdio
Comment 6 David Reyna 2025-11-25 11:41:19 UTC
This is a test defect, not a Toaster defect, per my comments.
Comment 7 Mathieu Dubois-Briand 2025-11-25 12:25:45 UTC
David, I'm not sure what was your intent, but this ticket was somehow assigned to myself. Resetting to default owner, please fix it if needed.
Comment 8 David Reyna 2025-11-25 16:12:11 UTC
It appears that Richard fixed this issue a few days ago:

[toaster]$ git show 80761fe2062464035033b5a7681709b4fc308198
commit 80761fe2062464035033b5a7681709b4fc308198
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Fri Nov 21 09:29:41 2025 +0000

    toaster: Fix test after styhead removal

    The styhead removal changed the indexing, update the tests to match. We really
    need to remove these hardcoded values.

    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/lib/toaster/tests/functional/test_create_new_project.py b/lib/toaster/tests/functional/test_create_new_project.py
index 66213c736..51c8c1203 100644
--- a/lib/toaster/tests/functional/test_create_new_project.py
+++ b/lib/toaster/tests/functional/test_create_new_project.py
@@ -53,7 +53,7 @@ class TestCreateNewProject(SeleniumFunctionalTestCase):
           - Release: Yocto Project 4.0 "Kirkstone" (option value: 6)
           - Merge Toaster settings: True
         """
-        release = '7'
+        release = '6'
         release_title = 'Yocto Project 4.0 "Kirkstone"'
         project_name = 'projectkirkstone'
         self.create_new_project(
[toaster]$