aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster
AgeCommit message (Collapse)Author
2024-01-10toaster/tests: Bug-fix ToasterTable show_rows testcasesAlassane Yattara
Test if some rows are visible in table instead of compare row to row_to_show, because sometime full avaiblable content did not display Failed: https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/147/steps/12/logs/stdio Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-10toaster/tests: Bug-fix "element not interactable" in ↵Alassane Yattara
TestLayerDetailsPage::test_edit_layerdetails Failed: https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/143/steps/12/logs/stdio Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-10toaster/tests: bug-fix "#hint-error-project-name" should be visibleAlassane Yattara
Failed: https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/142 Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-10toaster/tests: Setup delay after driver action self.get(url)Alassane Yattara
Recurring test failures result from insufficient delays in driver actions. Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-07toaster/tests: Delay driver first action on create new project pageAlassane Yattara
Wait for element visible on create new project page Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-07toaster/tests: Bug-fix element click interceptedAlassane Yattara
Fix "element click intercepted" on TestProjectConfigTab::test_project_config_tab_right_section Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-07toaster/tests: Bug-fix on TestProjectConfigTab::test_image_recipe_show_rowsAlassane Yattara
Check some rows are visible in table instead of compare table row to row_to_show, because recipe image table sometime doesn't display full avaiblable images Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-04toaster/toastergui: Bug-fix verify given layer path only if import/add local ↵Alassane Yattara
layer Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-01toaster/tests: Bug-fix "#project-created-notification" should be visibleAlassane Yattara
Added more delay between click on create project but and when notification is displayed Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-01toaster/tests: Skip to show more then 100 item in ToasterTableAlassane Yattara
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-01toaster/tests: bug-fix An element matching "#lastest_builds" should be on ↵Alassane Yattara
the page Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-01toaster/tests: bug-fix An element matching "#projectstable" should be visibleAlassane Yattara
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20toastergui: verify that an existing layer path is givenMarta Rybczynska
Verify that an existing layer path was given when adding a new layer. Manually using the shell for globbing is unnecessary, use the glob function instead for cleaner code. Signed-off-by: Marta Rybczynska <marta.rybczynska@syslinbit.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20toaster/tests: Bug-fix test_functional_basic, delay driver actionsAlassane Yattara
The errors causing faileds on functional_basic are dû to the delay between actions, increase between driver actions. Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-16toaster: Added validation to stop import if there is a build in progressMarlon Rodriguez Garcia
Added validation to prevent simultaneous imports from running because the database fails at runtime. The option to create a queue was taken into consideration. However, it will require the use of Celery https://pypi.org/project/celery/ or Background Task https://pypi.org/project/django-background-tasks/ which require the use of external services and multiple dependencies. If required we could explore the alternative in the future. Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: Fixes functional tests warning on autobuilderAlassane Yattara
tests/functional/test_project_config.py::TestProjectConfig::test_set_download_dir /home/pokybuild/yocto-worker/toaster/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method TestProjectConfig.test_set_download_dir of <toaster.tests.functional.test_project_config.TestProjectConfig testMethod=test_set_download_dir>>) return self.run(*args, **kwds) tests/functional/test_project_config.py::TestProjectConfig::test_set_sstate_dir /home/pokybuild/yocto-worker/toaster/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method TestProjectConfig.test_set_sstate_dir of <toaster.tests.functional.test_project_config.TestProjectConfig testMethod=test_set_sstate_dir>>) return self.run(*args, **kwds) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: Update tests/functional/functional_helpers test_functional_basicAlassane Yattara
- Remove unused import time functional_helpers - Delay driver actions from test_functional_basic Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: bug-fix element click intercepted in ↵Alassane Yattara
browser/test_layerdetails_page.py selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: Bug-Fix testcase functional/test_project_page_tab_config.pyAlassane Yattara
All issues and failures stemmed from a specific test case: test_project_config_tab_right_section in the file bitbake/lib/toaster/tests/functional/test_project_page_tab_config.py. This test was designed to verify whether the "Most built recipes" section on the project page correctly displays the latest and oldest recipes built by the user, irrespective of the build outcome (failed, cancelled, succeeded, or errored). The errors and failures arose because the build process did not terminate as expected, particularly when attempting to build recipe images such as "core-image-minimal" or "bash." It was discovered that building a real recipe/image was unnecessary for the test's purpose. Instead, building a fake recipe like "foo" provided a reliable way to ensure the build would fail or be interrupted. Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: Removed all time.sleep occurrenceAlassane Yattara
Use wait_until_visible instead of time.sleep to delay driver actions Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: logging warning in console, trying to kill unavailable ↵Alassane Yattara
Runbuilds process Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: fix chrome argument syntax and wait for driver exitAlexander Lussier-Cullen
The chrome driver sometimes fails with a page crash for a full suite of tests, pointing to a failure in the setup of the driver due to resource limitations. To mitigate these crashes, add a wait between driver driven tests to ensure resources are freed. Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: fix functional tests setup and teardownAlexander Lussier-Cullen
Functional tests sometimes do not properly wait for previous tests to close their instance of Toaster before launching their own, which causes failures. Track test created Toaster processes globally and wait for them to be exited before executing further tests which need a Toaster instance to fix this. Additionally, quit Toaster in the teardown using the stop command with a fallback of manually killing the processes in case of documented stalling problem. Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15toaster/tests: Exit tests on chromedriver creation failureAlexander Lussier-Cullen
When failing to create the web driver session for selenium tests, a cascade of erroring tests will follow. To avoid processing these unnecessarily, exit the tests completely in this case. Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13toaster: Commandline build import table improvementsMarlon Rodriguez Garcia
Added dataTables library to include sorting and pagination for table element Added jquery.dataTables to customize table rendering in section "Import eventlogs". This library includes the following: sorting, pagination, search and CSS styles. Default to ascending order and 50 builds per page. Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-12bitbake: toaster: add functional testing toaster error detailsAlexander Lussier-Cullen
Functional tests can sometimes fail to initialize toaster. Most often this is due to a conflict on port 8000. Add command information about whichever other process is running on that port to better describe the initialization failure. Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-12toaster: remove test and update setup to avoid rebuilding imageMarlon Rodriguez Garcia
Update build test to fix setUp, by including the built, the system was rebuilding the image on every test, causing the database to lock Delete test for unique order, this test was the only test using the self.built element and breaking the system. Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-12toaster/test: fix CopyrightAlassane Yattara
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-12toaster: Add verbose printout for missing chrome(driver) dependenciesAlexander Lussier-Cullen
If the chrome driver binary is missing dependencies, it was near impossible to work out which ones from just the logs. Add code to help debug things if this happens by including the ldd output. Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-12toaster: Added new feature to import eventlogs from command line into ↵Marlon Rodriguez Garcia
toaster using replay functionality Added a new button on the base template to access a new template. Added a model register the information on the builds and generate access links Added a form to include the option to load specific files Added jquery and ajax functions to block screen and redirect to build page when import eventlogs is trigger Added a new button on landing page linked to import build page, and set min-height of buttons in landing page for uniformity Removed test assertion to check command line build in content, because new button contains text Updated toaster_eventreplay to use library Fix test in test_layerdetails_page Rebased from master This feature uses the value from the variable BB_DEFAULT_EVENTLOG to read the files created by bitbake Exclude listing of files that don't contain the allvariables definitions used to replay builds This part of the feature should be revisited. Over a long period of time, the BB_DEFAULT_EVENTLOG will exponentially increase the size of the log file and cause bottlenecks when importing. Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09toaster/tests/builds: Add BB_HASHSERVE passthroughRichard Purdie
As well as BB_HASHSERVE_UPSTREAM, ensure BB_HASHSERVE is passed through to allow sstate resuse on the autobuilder. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09toaster: Update to use qemux86-64 machine by defaultRichard Purdie
Toaster currently uses qemux86 as the default, update to match the local.conf default changes, i.e. qemux86-64. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08toaster/tests: bug-fix tests writing files into /tmp on the autobuildersAlassane Yattara
- Use build directory instead of /tmp - Better handle delay between driver actions Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08toaster/tests: Fixes warnings in autobuilderAlassane Yattara
../bitbake/lib/toaster/tests/functional/functional_helpers.py:66 /home/pokybuild/yocto-worker/toaster/build/bitbake/lib/toaster/tests/functional/functional_helpers.py:66: DeprecationWarning: invalid escape sequence '\s' project_url=re.search("(projectPageUrl\s:\s\")(.*)(\",)",rc) Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/home/pokybuild/yocto-worker/toaster/build/bitbake/lib/toaster/tests/commands/test_runbuilds.py", line 39, in run os.kill(int(pid), signal.SIGTERM) ProcessLookupError: [Errno 3] No such process Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08toaster/tests: Bug fixes, functional tests dependent on each otherAlassane Yattara
refactor test_create_project and test_project_page to remove their dependencies Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08toaster/tests: Refactorize tests/functionalAlassane Yattara
- Split testcases from test_project_page_tab_config into tow files - Added new testcases in test_project_config - Test changing distro variable - Test setting IMAGE_INSTALL:append variable - Test setting PACKAGE_CLASSES variable - Test creating new bitbake variable Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08toaster/tests: Added functional/utils, contains useful methods using by ↵Alassane Yattara
functional tests Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08toaster/tests: Ensure to kill toaster process create for tests functionalAlassane Yattara
Toaster background task runbuilds continu running when even if tests is done Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08toaster/tests: Update build testMarlon Rodriguez Garcia
Updated build tests in toaster, added SSTATE_MIRROR to package build, changed build directory and update test order This builds include the core-minimal-image, on the test enviroment a smaller package was use to run the test for time purposes Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06toaster: fix pytest build test execution and test discoveryAlexander Lussier-Cullen
Ensure the proper django settings are used by moving the variable to the environment assignment. Remove python file specifier as this works relative to the working directory, which can vary. The test file directory can instead be specified when executing the pytest command. Add annotations required to allow database access with pytest to the build tests. Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com> CC: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06toastergui: Fix regex markup issuesRichard Purdie
lib/toaster/toastergui/templatetags/projecttags.py:170: DeprecationWarning: invalid escape sequence '\$' value=re.sub('_\$.*', '', value) tests/views/test_views.py::ViewTests::test_custom_incomplete_params lib/toaster/toastergui/urls.py:211: DeprecationWarning: invalid escape sequence '\d' '/packages/(?P<package_id>\d+|)$', Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06toastermain/settings: Avoid python filehandle closure warningsRichard Purdie
Switch to using with blocks when accessing files to ensure file descriptors are closed and avoid python warnings. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06toaster: Fix assertRegexpMatches deprecation warningsRichard Purdie
Fix: DeprecationWarning: Please use assertRegex instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06bb/toaster: Fix assertEquals deprecation warningsRichard Purdie
Fix: DeprecationWarning: Please use assertEqual instead Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06toaster/test: delay driver action until elements to appearAlassane Yattara
Update tests/browser/(test_landing_page.py and test_layerdetails_page.py) to delay driver actions until for elements to appear Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06toaster/test: from test_no_builds_message.py wait for the empty state div to ↵Alassane Yattara
appear >From tests/browser/test_sample.py wait for the empty state div to appear Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06toaster/test: bug-fix on tests/browser/test_all_builds_pageAlassane Yattara
- Bug-fix on table filtering on (CompletedOn, filter failed task) - Better handle testcase used time.sleep and remove it Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02toaster/tests: Test single recipe pageAlassane Yattara
Test recipe page - Check if title is displayed - Check add recipe layer displayed - Check left section is displayed - Check recipe: name, summary, description, Version, Section, License, Approx. packages included, Approx. size, Recipe file Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02toaster/tests: Test single layer pageAlassane Yattara
Test layer page - Check if title is displayed - Check add/remove layer button works - Check tabs(layers, recipes, machines) are displayed - Check left section is displayed - Check layer name - Check layer summary - Check layer description Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-02toaster/tests: Bug-fix on tests/functional/test_project_pageAlassane Yattara
- Generate a random name for create project while test - Set timeout on method _wait_until_build - update test_machines_page, test_softwareRecipe_page and test_single_layer_page to fix exception "element not interactable" Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>