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 D8395C4332F for ; Wed, 13 Dec 2023 14:13:42 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.37035.1702476813695198749 for ; Wed, 13 Dec 2023 06:13:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=Tnx7UvNY; spf=pass (domain: savoirfairelinux.com, ip: 208.88.110.44, mailfrom: alassane.yattara@savoirfairelinux.com) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 5E4979C2A93; Wed, 13 Dec 2023 09:13:32 -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 NY6q_84xbheH; Wed, 13 Dec 2023 09:13:31 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 85BE39C34E7; Wed, 13 Dec 2023 09:13:31 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 85BE39C34E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1702476811; bh=rIrZOLCEVFxBE1VSZL3jHtwGCT5LIL+a4o33bzxfHEs=; h=Date:From:To:Message-ID:MIME-Version; b=Tnx7UvNYLDX63DH4LMU0QTwJtIZ9omOe4DTJz/bj908WJTecdqsjFCIDBBeds4W0B wozPK2uwtCrAAfhP+ZycVb/oBbWL3N0LHM3qhYu0ziGGxn02Yq/AjQyIeLebcby1aw bAi/JmES6OtqDAHXcqDohAghxw1PCi+hXqUJURXGFSmDsdVuIfD2WGo/ocvfYO9LIV bQGZpCb39p57NLP22NW7jFPKQ5TmaEyUdi/NPIPvXGNENC69hFQEOHRhFT2RcLc3N7 G+UQrjAkMOKiHH+8pgX6O59iZBm6ampUhVieaLQht/RPpwkca+sLxqUY0xai6Lu/fL onMSJRoim34tQ== 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 Sa2-ubLe9OAb; Wed, 13 Dec 2023 09:13:31 -0500 (EST) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [192.168.48.237]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 6A0799C2A93; Wed, 13 Dec 2023 09:13:31 -0500 (EST) Date: Wed, 13 Dec 2023 09:13:31 -0500 (EST) From: Alassane Yattara To: Richard Purdie Cc: bitbake-devel Message-ID: <1058701702.76412.1702476811264.JavaMail.zimbra@savoirfairelinux.com> In-Reply-To: References: <20231212141708.19395-1-alassane.yattara@savoirfairelinux.com> <20231212141708.19395-4-alassane.yattara@savoirfairelinux.com> Subject: Re: [bitbake-devel] [PATCH 4/4] toaster/test: Fixes functional tests warning on autobuilder MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 8.8.15_GA_4562 (ZimbraWebClient - GC119 (Linux)/8.8.15_GA_4570) Thread-Topic: toaster/test: Fixes functional tests warning on autobuilder Thread-Index: 233KWwKHJIZtHbS8GrR0DHE6EJHetA== 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 ; Wed, 13 Dec 2023 14:13:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/15661 Richard, Yes, you're right skiptest is another way, in fact I preferred this method = in a testcase,=20 but to avoid 2 or more skipping inside tests, I chose if condition. Alassane ----- Mail original ----- De: "Richard Purdie" =C3=80: "Alassane Yattara" , "bitbak= e-devel" Envoy=C3=A9: Mercredi 13 D=C3=A9cembre 2023 14:58:24 Objet: Re: [bitbake-devel] [PATCH 4/4] toaster/test: Fixes functional tests= warning on autobuilder On Tue, 2023-12-12 at 15:17 +0100, Alassane Yattara wrote: > tests/functional/test_project_config.py::TestProjectConfig::test_set_down= load_dir > /home/pokybuild/yocto-worker/toaster/build/buildtools/sysroots/x86_64-p= okysdk-linux/usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: I= t is deprecated to return a value that is not None from a test case (= >) > return self.run(*args, **kwds) >=20 > tests/functional/test_project_config.py::TestProjectConfig::test_set_ssta= te_dir > /home/pokybuild/yocto-worker/toaster/build/buildtools/sysroots/x86_64-p= okysdk-linux/usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: I= t is deprecated to return a value that is not None from a test case (>) > return self.run(*args, **kwds) >=20 > Signed-off-by: Alassane Yattara > --- > .../tests/functional/test_project_config.py | 164 +++++++++--------- > 1 file changed, 85 insertions(+), 79 deletions(-) >=20 > diff --git a/lib/toaster/tests/functional/test_project_config.py b/lib/to= aster/tests/functional/test_project_config.py > index 2d162d81..dbee36aa 100644 > --- a/lib/toaster/tests/functional/test_project_config.py > +++ b/lib/toaster/tests/functional/test_project_config.py > @@ -163,51 +163,53 @@ class TestProjectConfig(SeleniumFunctionalTestCase)= : > change_dl_dir_btn =3D self.wait_until_visible('#change-dl_di= r-icon', poll=3D2) > except TimeoutException: > # If download dir is not displayed, test is skipped > - return True > - change_dl_dir_btn =3D self.wait_until_visible('#change-dl_dir-ic= on', poll=3D2) > - change_dl_dir_btn.click() > + change_dl_dir_btn =3D None > =20 > - # downloads dir path doesn't start with / or ${...} > - input_field =3D self.wait_until_visible('#new-dl_dir', poll=3D2) > - input_field.clear() > - self.enter_text('#new-dl_dir', 'home/foo') > - element =3D self.wait_until_visible('#hintError-initialChar-dl_d= ir', poll=3D2) > + if change_dl_dir_btn: > + change_dl_dir_btn =3D self.wait_until_visible('#change-dl_di= r-icon', poll=3D2) > + change_dl_dir_btn.click() > + > + # downloads dir path doesn't start with / or ${...} > + input_field =3D self.wait_until_visible('#new-dl_dir', poll= =3D2) > + input_field.clear() > + self.enter_text('#new-dl_dir', 'home/foo') > + element =3D self.wait_until_visible('#hintError-initialChar-= dl_dir', poll=3D2) > =20 > - msg =3D 'downloads directory path starts with invalid character = but ' \ > - 'treated as valid' > - self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), = msg) > + msg =3D 'downloads directory path starts with invalid charac= ter but ' \ > + 'treated as valid' > + self.assertTrue((self.INVALID_PATH_START_TEXT in element.tex= t), msg) > =20 > - # downloads dir path has a space > - self.driver.find_element(By.ID, 'new-dl_dir').clear() > - self.enter_text('#new-dl_dir', '/foo/bar a') > + # downloads dir path has a space > + self.driver.find_element(By.ID, 'new-dl_dir').clear() > + self.enter_text('#new-dl_dir', '/foo/bar a') > =20 > - element =3D self.wait_until_visible('#hintError-dl_dir', poll=3D= 2) > - msg =3D 'downloads directory path characters invalid but treated= as valid' > - self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), m= sg) > + element =3D self.wait_until_visible('#hintError-dl_dir', pol= l=3D2) > + msg =3D 'downloads directory path characters invalid but tre= ated as valid' > + self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text= ), msg) > =20 > - # downloads dir path starts with ${...} but has a space > - self.driver.find_element(By.ID,'new-dl_dir').clear() > - self.enter_text('#new-dl_dir', '${TOPDIR}/down foo') > + # downloads dir path starts with ${...} but has a space > + self.driver.find_element(By.ID,'new-dl_dir').clear() > + self.enter_text('#new-dl_dir', '${TOPDIR}/down foo') > =20 > - element =3D self.wait_until_visible('#hintError-dl_dir', poll=3D= 2) > - msg =3D 'downloads directory path characters invalid but treated= as valid' > - self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), m= sg) > + element =3D self.wait_until_visible('#hintError-dl_dir', pol= l=3D2) > + msg =3D 'downloads directory path characters invalid but tre= ated as valid' > + self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text= ), msg) > =20 > - # downloads dir path starts with / > - self.driver.find_element(By.ID,'new-dl_dir').clear() > - self.enter_text('#new-dl_dir', '/bar/foo') > + # downloads dir path starts with / > + self.driver.find_element(By.ID,'new-dl_dir').clear() > + self.enter_text('#new-dl_dir', '/bar/foo') > =20 > - hidden_element =3D self.driver.find_element(By.ID,'hintError-dl_= dir') > - self.assertEqual(hidden_element.is_displayed(), False, > - 'downloads directory path valid but treated as invalid') > + hidden_element =3D self.driver.find_element(By.ID,'hintError= -dl_dir') > + self.assertEqual(hidden_element.is_displayed(), False, > + 'downloads directory path valid but treated as invalid') > =20 > - # downloads dir path starts with ${...} > - self.driver.find_element(By.ID,'new-dl_dir').clear() > - self.enter_text('#new-dl_dir', '${TOPDIR}/down') > + # downloads dir path starts with ${...} > + self.driver.find_element(By.ID,'new-dl_dir').clear() > + self.enter_text('#new-dl_dir', '${TOPDIR}/down') > =20 > - hidden_element =3D self.driver.find_element(By.ID,'hintError-dl_= dir') > - self.assertEqual(hidden_element.is_displayed(), False, > - 'downloads directory path valid but treated as invalid') > + hidden_element =3D self.driver.find_element(By.ID,'hintError= -dl_dir') > + self.assertEqual(hidden_element.is_displayed(), False, > + 'downloads directory path valid but treated as invalid') > =20 > def test_set_sstate_dir(self): > """ > @@ -217,53 +219,57 @@ class TestProjectConfig(SeleniumFunctionalTestCase)= : > self._navigate_bbv_page() > =20 > try: > - self.wait_until_visible('#change-sstate_dir-icon', poll=3D2) > + btn_chg_sstate_dir =3D self.wait_until_visible( > + '#change-sstate_dir-icon', > + poll=3D2 > + ) > self.click('#change-sstate_dir-icon') > except TimeoutException: > # If sstate_dir is not displayed, test is skipped > - return True > - Wouldn't it be easier to do something like a self.skipTest("Some reason") here?=C2=A0 That would mean the rest of the code didn't need to change? Cheers, Richard -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Links: You receive all messages sent to this group. View/Reply Online (#15660): https://lists.openembedded.org/g/bitbake-devel/= message/15660 Mute This Topic: https://lists.openembedded.org/mt/103130087/7896845 Group Owner: bitbake-devel+owner@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/leave/12674735/= 7896845/557127541/xyzzy [alassane.yattara@savoirfairelinux.com] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-