summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-11-09 16:55:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-09 17:01:18 +0000
commit20705f46af4edb101892b355350265d1c37ba1a2 (patch)
tree4b96a1a6718cdf85af400351964b97449029febd
parentf8ee2cb52eeda3ba70fad17677b258586592e9e1 (diff)
downloadpoky-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.py6
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
15import re 15import re
16 16
17from tests.browser.selenium_helpers_base import SeleniumTestCaseBase 17from tests.browser.selenium_helpers_base import SeleniumTestCaseBase
18from tests.builds.buildtest import load_build_environment
19from bldcontrol.models import BuildEnvironment
20from selenium.webdriver.common.by import By 18from selenium.webdriver.common.by import By
21from selenium.common.exceptions import NoSuchElementException 19from 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(