diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2023-11-09 16:55:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 17:01:18 +0000 |
commit | 20705f46af4edb101892b355350265d1c37ba1a2 (patch) | |
tree | 4b96a1a6718cdf85af400351964b97449029febd | |
parent | f8ee2cb52eeda3ba70fad17677b258586592e9e1 (diff) | |
download | poky-20705f46af4edb101892b355350265d1c37ba1a2.tar.gz |
bitbake: toaster: Bug-fix pytest and Failed: Database access not allowed
Remove load and create build environment from tests/functional/functional_helpers
- Testcases in the FunctionalTestCase do not require a build process,
- Also marked setUpClass or class with pytest django_db, db ... not
working, as declared above of file functional_helpers.py, The database access
process runs as an external process, separate from the test case process
and outside the context of pytest.
(Bitbake rev: 35c02c26541c05a8d147f41d0855e09d8fba1a83)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/toaster/tests/functional/functional_helpers.py | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/tests/functional/functional_helpers.py b/bitbake/lib/toaster/tests/functional/functional_helpers.py index c3191f664a..b80d403bec 100644 --- a/bitbake/lib/toaster/tests/functional/functional_helpers.py +++ b/bitbake/lib/toaster/tests/functional/functional_helpers.py | |||
@@ -15,8 +15,6 @@ import time | |||
15 | import re | 15 | import re |
16 | 16 | ||
17 | from tests.browser.selenium_helpers_base import SeleniumTestCaseBase | 17 | from tests.browser.selenium_helpers_base import SeleniumTestCaseBase |
18 | from tests.builds.buildtest import load_build_environment | ||
19 | from bldcontrol.models import BuildEnvironment | ||
20 | from selenium.webdriver.common.by import By | 18 | from selenium.webdriver.common.by import By |
21 | from selenium.common.exceptions import NoSuchElementException | 19 | from selenium.common.exceptions import NoSuchElementException |
22 | 20 | ||
@@ -33,10 +31,6 @@ class SeleniumFunctionalTestCase(SeleniumTestCaseBase): | |||
33 | raise RuntimeError("Please initialise django with the tests settings: " \ | 31 | raise RuntimeError("Please initialise django with the tests settings: " \ |
34 | "DJANGO_SETTINGS_MODULE='toastermain.settings_test'") | 32 | "DJANGO_SETTINGS_MODULE='toastermain.settings_test'") |
35 | 33 | ||
36 | if BuildEnvironment.objects.count() == 0: | ||
37 | BuildEnvironment.objects.create(betype=BuildEnvironment.TYPE_LOCAL) | ||
38 | load_build_environment() | ||
39 | |||
40 | # start toaster | 34 | # start toaster |
41 | cmd = "bash -c 'source toaster start'" | 35 | cmd = "bash -c 'source toaster start'" |
42 | p = subprocess.Popen( | 36 | p = subprocess.Popen( |