From: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
To: toaster@lists.yoctoproject.org
Cc: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Subject: [PATCH v4 3/7] Toaster: Bug-fix pytest and Failed: Database access not allowed
Date: Thu, 9 Nov 2023 18:15:31 +0100 [thread overview]
Message-ID: <20231109171535.207464-3-alassane.yattara@savoirfairelinux.com> (raw)
In-Reply-To: <20231109171535.207464-1-alassane.yattara@savoirfairelinux.com>
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.
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
lib/toaster/tests/functional/functional_helpers.py | 6 ------
1 file changed, 6 deletions(-)
diff --git a/lib/toaster/tests/functional/functional_helpers.py b/lib/toaster/tests/functional/functional_helpers.py
index c3191f66..b80d403b 100644
--- a/lib/toaster/tests/functional/functional_helpers.py
+++ b/lib/toaster/tests/functional/functional_helpers.py
@@ -15,8 +15,6 @@ import time
import re
from tests.browser.selenium_helpers_base import SeleniumTestCaseBase
-from tests.builds.buildtest import load_build_environment
-from bldcontrol.models import BuildEnvironment
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@@ -33,10 +31,6 @@ class SeleniumFunctionalTestCase(SeleniumTestCaseBase):
raise RuntimeError("Please initialise django with the tests settings: " \
"DJANGO_SETTINGS_MODULE='toastermain.settings_test'")
- if BuildEnvironment.objects.count() == 0:
- BuildEnvironment.objects.create(betype=BuildEnvironment.TYPE_LOCAL)
- load_build_environment()
-
# start toaster
cmd = "bash -c 'source toaster start'"
p = subprocess.Popen(
--
2.34.1
next prev parent reply other threads:[~2023-11-09 17:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 17:15 [PATCH v4 1/7] Toaster: Update toaster-requirements.txt and Added pytest.ini Alassane Yattara
2023-11-09 17:15 ` [PATCH v4 2/7] Toaster: Update orm.models to catch error ProcessLookupError Alassane Yattara
2023-11-09 17:15 ` Alassane Yattara [this message]
2023-11-09 17:15 ` [PATCH v4 4/7] Toaster: fixed pytest error: Database access not allowed, use the "django_db" Alassane Yattara
2023-11-09 17:15 ` [PATCH v4 5/7] Toaster: Bug-fix django.db.utils.IntegrityError: Problem installing fixture Alassane Yattara
2023-11-09 17:15 ` [PATCH v4 6/7] Toaster: Move toaster tests requirements in bitbake/lib/toaster/toaster-tests-requirements Alassane Yattara
2023-11-09 17:15 ` [PATCH v4 7/7] Toaster: fixed: Tests fail when executed one after the other out of sequence Alassane Yattara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231109171535.207464-3-alassane.yattara@savoirfairelinux.com \
--to=alassane.yattara@savoirfairelinux.com \
--cc=toaster@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).