Commit Graph

19 Commits

Author SHA1 Message Date
Richard Purdie
d17f42ec12 bitbake: toaster/tests/functional/basic: Improve the projects table selection to a common function
The project page selection code is race prone. Create a common function to resolve
the race issue and use it from all the call sites rather than duplicate code.

(Bitbake rev: f2bd615b97a6ff3944fa9c1d89a0ea996a12943d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
fa2ca6f1f9 bitbake: toaster/tests/function/basic: Make element detection more specific
The tests would race and potentially fail as the elements on the
page being waited for were not specific enough.

Add suitable elements to wait for and drop the remainder of the poll
parameters since these are no longer needed since we no longer need
to sleep for things to appear.

(Bitbake rev: 9db2fd8534610ad8db90a7a696fa7b748b497d15)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
b04308f670 bitbake: toaster/tests/function/basic: Improve exception handling for error readability
The 'fail' calls are useful for find() failures but not for wrapping existing asserts
where they hide more useful error messages. Rework the code flow to give more readable
error reporting.

(Bitbake rev: 1a7a9af418874d3112aa6f148b30e5a4d3d176f3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Richard Purdie
d4288a7785 bitbake: toaster/tests/functional_basic: Reuse common project creation code
Switch this test module to use the common project creation code which contains
race fixes. That code requires the database access wrapper be dropped and
we no longer have ordering constraints.

(Bitbake rev: f015d96e28d89fd0aef76ff127ebde8613125a66)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-24 11:24:03 +01:00
Alassane Yattara
6a67f24773 bitbake: toaster/tests: bug-fix An element matching "#projectstable" should be visible
(Bitbake rev: 1edb97f741a48481b1b9f26c5cb31acd9059f07f)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-01 23:13:50 +00:00
Alassane Yattara
98214f1bc2 bitbake: toaster/tests: Bug-fix test_functional_basic, delay driver actions
The errors causing faileds on functional_basic are dû to the delay between actions,
increase between driver actions.

(Bitbake rev: e8f8f6203b63c46249673e80872fea40475f6875)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 12:02:07 +00:00
Alassane Yattara
ad2ffefb14 bitbake: toaster/tests: Update tests/functional/functional_helpers test_functional_basic
- Remove unused import time functional_helpers
- Delay driver actions from test_functional_basic

(Bitbake rev: c7a305f0ff3cd32875e2eb80bc0848f533209745)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15 14:37:28 +00:00
Alassane Yattara
c8382b35e8 bitbake: toaster/tests: Removed all time.sleep occurrence
Use wait_until_visible instead of time.sleep to delay driver actions
(Bitbake rev: 96bf461d5860dad2377963c8dad6c754670738a6)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-15 14:37:28 +00:00
Richard Purdie
4d14176aa6 bitbake: toaster: Update to use qemux86-64 machine by default
Toaster currently uses qemux86 as the default, update to match the
local.conf default changes, i.e. qemux86-64.

(Bitbake rev: 27fbba9ee15994a69284a7f8579c22d85e0ce863)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 10:04:12 +00:00
Alassane Yattara
8b957cf1fe bitbake: toaster: fixed: Tests fail when executed one after the other out of sequence
As mentionned in earlier commit, pytest-django takes a conservative approach
to enabling database access. By default our tests will fail if they try to access
the database, Only if we explicitly request database access will this be allowed,
using pytest marks to tell pytest-django our test needs database access.

A side effect of pytest mark, is test_case method marked is execute out of
scope of its module class, which create an inconsistance sequence and make fails
followings tests.

The scope of the ordering is global per default, e.g. tests with lower ordinal
numbers are always executed before tests with higher numbers in the same test session,
regardless of the module and class they reside in. This can be changed by using
the --order-scope option from module pytest-order.

To fix that i added execution order to tests suite using pytest-order.

(Bitbake rev: 8bf32459ab6d8ce7632fca0a4ce0f3aecc7495c2)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-09 17:01:18 +00:00
Alassane Yattara
dcb6a5cca6 bitbake: toaster: fixed pytest error: Database access not allowed, use the "django_db"
Pytest failed on functional/test_functional_basic because database access not allowed
- we should use "django_db" fixture to allowed db access

Note: Pytest-django takes a conservative approach to enabling database access.
By default your tests will fail if they try to access the database.
Only if you explicitly request database access will this be allowed.

https://pytest-django.readthedocs.io/en/latest/helpers.html#pytest-mark-django-db-request-database-access

(Bitbake rev: 5f92a6b13cdea26b26ff939e9a3f746f7d0937b7)

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-09 17:01:18 +00:00
Marlon Rodriguez Garcia
480aeaff08 bitbake: toaster: fixed functional test
Updated functional test file to fix url access and added waiting time after click operations
to allow following elements to be available for tests, this will needed to be revisited
when autobuilder is ready

(Bitbake rev: fa30af75b3b7d37215f2615aa4b458525fce509e)

Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-17 11:41:33 +01:00
Marlon Rodriguez Garcia
3ac4694fc3 bitbake: toaster: update selenium version and code syntax
Updated selenium version to latest 4.13.0, changed selenum specific version syntax elements to accomplish test success

(Bitbake rev: 868c88a249ef4b9fe5a891e76e25e054e4fcd994)

Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-06 11:42:46 +01:00
Frazer Clews
0ac5174c7d bitbake: lib: remove unused imports
removed unused imports which made the code harder to read, and slightly
but less efficient

(Bitbake rev: 4367692a932ac135c5aa4f9f2a4e4f0150f76697)

Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19 13:31:05 +00:00
Robert Yang
1337766521 bitbake: bitbake: toaster:tests: python -> python3
(Bitbake rev: 683c24788d96176699a585055eb62d8a71830a12)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-28 13:29:04 +01:00
Richard Purdie
9501864db8 bitbake: bitbake: Strip old editor directives from file headers
There are much better ways to handle this and most editors shouldn't need this
in modern times, drop the noise from the files. Its not consitently applied
anyway.

(Bitbake rev: 5e43070e3087d09aea2f459b033d035c5ef747d0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04 10:44:10 +01:00
Richard Purdie
cf9c0be3f6 bitbake: bitbake: Drop duplicate license boilerplace text
With the introduction of SPDX-License-Identifier headers, we don't need a ton
of header boilerplate in every file. Simplify the files and rely on the top
level for the full licence text.

(Bitbake rev: 695d84397b68cc003186e22f395caa378b06bc75)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04 10:44:10 +01:00
Richard Purdie
79834a7144 bitbake: bitbake: Add initial pass of SPDX license headers to source code
This adds the SPDX-License-Identifier license headers to the majority of
our source files to make it clearer exactly which license files are under.

The bulk of the files are under GPL v2.0 with one found to be under V2.0
or later, some under MIT and some have dual license. There are some files
which are potentially harder to classify where we've imported upstream code
and those can be handled specifically in later commits.

The COPYING file is replaced with LICENSE.X files which contain the full
license texts.

(Bitbake rev: ff237c33337f4da2ca06c3a2c49699bc26608a6b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04 10:44:04 +01:00
David Reyna
123ec6ebc2 bitbake: toaster:test:Create selenium tests for project dashboard page
Added 7 new testcases that verify the UI interface and elements of the project detail page.
This testcases can be found on testopia in the links:

Verifies that the project is created and that you get redirected to the configuration page
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1514

Verifies that the left side bar menu, all links are clickable and they show on the UI
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1515

Verifies that after creating a project the default project configuration is created
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1516

Verifies that the default machine is set, once creating the project
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1517

Verifies the built recipes information of the project detail page
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1518

Verifies the default release information of the project
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1519

Verifies that the default layers are assigned to the project
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1520

Verifies that the links to the Configuration, Builds, Import layer and New Custom Image are present and work.

[YOCTO #9808]

(Bitbake rev: eaeddaf96efb8079b307652eac208f4ab5019ad4)

Signed-off-by: Libertad Cruz <libertad.cruz@intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-10 23:00:32 +01:00