From patchwork Thu Nov 30 13:59:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lussier-Cullen X-Patchwork-Id: 35443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72CD9C4167B for ; Thu, 30 Nov 2023 14:00:03 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.72703.1701352796082211071 for ; Thu, 30 Nov 2023 05:59:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=jJ8pC75P; spf=pass (domain: savoirfairelinux.com, ip: 208.88.110.44, mailfrom: alexander.lussier-cullen@savoirfairelinux.com) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 116109C320B for ; Thu, 30 Nov 2023 08:59:54 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id BMyAmrcRzcxA; Thu, 30 Nov 2023 08:59:53 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 709679C32B7; Thu, 30 Nov 2023 08:59:53 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 709679C32B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1701352793; bh=2JLCuig6l33KK8spcSPVXYKDOTt9vhWvEF9k+A5JfUg=; h=From:To:Date:Message-Id:MIME-Version; b=jJ8pC75PumPZIxPiRsG27b2jZ1dU1uQfuWj0pZsopZTEoAU3aDbc/ONb0DsfTqalZ Z/OZPrOzrHtUjHYjBEM5+3GhWVQ2XX8cb86SoYLuO7wh/jgWSNbk7gj1Xex+7jxz5T YPq+1EVM/DNLCrhSQtrLAHD9Lb/9VnY3LGB2BOHaVRwdFlgTEP23J/8PvR0V975hrd LXE2e32xNr7Cu2DWrgpQ8ppnlidcy/7D5qP9bAF77LYtrq07kOyuouiQXrdQLrTi+N kFEHNtTlk0cT7/aKirevgEgcFzueNBd/+tdpl+Zrk+DSr9U2fgqcDF0QbxHZEHSrAj LBLv49Alg2cXA== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id Gl11NrSfIpU1; Thu, 30 Nov 2023 08:59:53 -0500 (EST) Received: from alex-GA-78LMT-USB3.home (bras-base-mtrlpq427kw-grc-24-184-147-255-35.dsl.bell.ca [184.147.255.35]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 528209C320B; Thu, 30 Nov 2023 08:59:53 -0500 (EST) From: Alexander Lussier-Cullen To: toaster@lists.yoctoproject.org Cc: Alexander Lussier-Cullen Subject: [Toaster] bitbake: toaster: fix pytest build test execution and test discovery Date: Thu, 30 Nov 2023 08:59:43 -0500 Message-Id: <20231130135943.3775-1-alexander.lussier-cullen@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 30 Nov 2023 14:00:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6034 Signed-off-by: Alexander Lussier-Cullen --- bitbake/lib/toaster/pytest.ini | 5 +---- bitbake/lib/toaster/tests/builds/test_core_image_min.py | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/pytest.ini b/bitbake/lib/toaster/pytest.ini index f07076b7ea..071c65fcd5 100644 --- a/bitbake/lib/toaster/pytest.ini +++ b/bitbake/lib/toaster/pytest.ini @@ -1,9 +1,5 @@ # -- FILE: pytest.ini (or tox.ini) [pytest] -DJANGO_SETTINGS_MODULE = toastermain.settings_test - -python_files = db/test_*.py commands/test_*.py views/test_*.py browser/test_*.py functional/test_*.py - # --create-db - force re creation of the test database # https://pytest-django.readthedocs.io/en/latest/database.html#create-db-force-re-creation-of-the-test-database @@ -17,3 +13,4 @@ addopts = --create-db --html="Toaster Tests Report.html" --self-contained-html # https://pypi.org/project/pytest-env/ env = TOASTER_BUILDSERVER=1 + DJANGO_SETTINGS_MODULE=toastermain.settings_test diff --git a/bitbake/lib/toaster/tests/builds/test_core_image_min.py b/bitbake/lib/toaster/tests/builds/test_core_image_min.py index 9cdaa15f98..ca388eabe7 100644 --- a/bitbake/lib/toaster/tests/builds/test_core_image_min.py +++ b/bitbake/lib/toaster/tests/builds/test_core_image_min.py @@ -10,6 +10,7 @@ # Ionut Chisanovici, Paul Eggleton and Cristian Iorga import os +import pytest from django.db.models import Q @@ -21,6 +22,7 @@ from orm.models import CustomImagePackage from tests.builds.buildtest import BuildTest +@pytest.mark.django_db(True) class BuildCoreImageMinimal(BuildTest): """Build core-image-minimal and test the results"""