From mboxrd@z Thu Jan 1 00:00:00 1970 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 759B4C4167B for ; Thu, 30 Nov 2023 22:57:52 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web11.9582.1701385063156649859 for ; Thu, 30 Nov 2023 14:57:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=eFJvIoHo; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-332fd78fa9dso1117562f8f.3 for ; Thu, 30 Nov 2023 14:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1701385061; x=1701989861; darn=lists.yoctoproject.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Ml1vvjFIeFR8uGv2NtbwcktXCvf+V2RcHlvS8S05R0c=; b=eFJvIoHoZ63kPZ6ijIqPKanoJLOW2ZuJcD5l5ftXaUetQrBqbLoLO4rSWWqS34QUQW 6plU+rrcLdK6nwZYSCPDbJbflPtm1ktlf3Sa9mxgZKvGvqdat7afPUNhCfGvp1sxTSUE FXJhoARJSY2hSm8h/JYTgsy3/TBw6jFMHnrlQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701385061; x=1701989861; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ml1vvjFIeFR8uGv2NtbwcktXCvf+V2RcHlvS8S05R0c=; b=cQzcTMt+xyBjYHj2+3jPJnNsBbU8kbRwlWRAnL0Q7TeySCTLvJJL5uaMraEvuIhKsL /+jtQs1qjs59F0HnB9l1sh1qRaU4cKmKl7dWw9qs8wcTNbcq742ZahSSE4wTclShR+MC adVWikOS6VoxEhswYBVJv+beEErCOGWe6NzVluQSCmikSSL1kXCmWh4rKDZOdK/x2oBx W1pb+w4b7uUf/Pm7HxSM8g3fk5pkKAPOUmhG+l9hiLa+Fjg3VNQn5s34xFCzoAa3zDwd rufubEM8bmKzwH4zymA0wbbkaMeM0hZ6kX+ZFBoSfKhSv0wxUBwOfjYSatIrRW/7A8na RyJw== X-Gm-Message-State: AOJu0YzJaF4gRWNOq/LNmZ1obXBabCxOOJNwAD8VW+fhDIj5LbN7F9rI KbI9etxW60wcwbA00rOcv+TemQ== X-Google-Smtp-Source: AGHT+IFvnpabE5UgsA+oXrnR9jgJDqYTxUHw7AYiOPqlPqI/i+E5tFPJbOSU85Cf0V/5i4Zzz+BE8Q== X-Received: by 2002:adf:e690:0:b0:333:3117:c471 with SMTP id r16-20020adfe690000000b003333117c471mr37964wrm.258.1701385060669; Thu, 30 Nov 2023 14:57:40 -0800 (PST) Received: from ?IPv6:2001:8b0:aba:5f3c:201d:dd04:f9b4:3c83? ([2001:8b0:aba:5f3c:201d:dd04:f9b4:3c83]) by smtp.gmail.com with ESMTPSA id z12-20020a5d44cc000000b00332c6a52040sm2586676wrr.100.2023.11.30.14.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 14:57:40 -0800 (PST) Message-ID: <6616a576608e94158ee6b6da6ef8d92657f3dd97.camel@linuxfoundation.org> Subject: Re: [Toaster] bitbake: toaster: fix pytest build test execution and test discovery From: Richard Purdie To: Alexander Lussier-Cullen , toaster@lists.yoctoproject.org Date: Thu, 30 Nov 2023 22:57:39 +0000 In-Reply-To: <20231130135943.3775-1-alexander.lussier-cullen@savoirfairelinux.com> References: <20231130135943.3775-1-alexander.lussier-cullen@savoirfairelinux.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1-0ubuntu1 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 22:57:52 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6042 Hi Alexander, On Thu, 2023-11-30 at 08:59 -0500, Alexander Lussier-Cullen wrote: > 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(-) >=20 > 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 =3D toastermain.settings_test > - > -python_files =3D 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 > =20 > @@ -17,3 +13,4 @@ addopts =3D --create-db --html=3D"Toaster Tests Report.= html" --self-contained-html > # https://pypi.org/project/pytest-env/ > env =3D > TOASTER_BUILDSERVER=3D1 > + DJANGO_SETTINGS_MODULE=3Dtoastermain.settings_test I tested this patch and it definitely seems to help. https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/12/steps= /11/logs/stdio I replied to Alassane earlier about some of the failures in test run but I think this did fix several of them. Can I ask that you tweak the commit message to explain what is being fixed here, just so we have the context in the commit logs please. > diff --git a/bitbake/lib/toaster/tests/builds/test_core_image_min.py b/bi= tbake/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 > =20 > import os > +import pytest > =20 > from django.db.models import Q > =20 > @@ -21,6 +22,7 @@ from orm.models import CustomImagePackage > from tests.builds.buildtest import BuildTest > =20 > =20 > +@pytest.mark.django_db(True) > class BuildCoreImageMinimal(BuildTest): > """Build core-image-minimal and test the results""" > =20 I'd suggest this part of then change be split into a separate patch with an explanation of what is being fixed. It does appear to fix the database locked issues we were seeing which is great. Cheers, Richard