From patchwork Wed Oct 18 19:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marlon Rodriguez Garcia X-Patchwork-Id: 32544 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 37E67CDB483 for ; Wed, 18 Oct 2023 19:46:15 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web10.10760.1697658371703906125 for ; Wed, 18 Oct 2023 12:46:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=iS7LabuW; spf=pass (domain: savoirfairelinux.com, ip: 208.88.110.44, mailfrom: marlon.rodriguez-garcia@savoirfairelinux.com) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 30E639C2CC3 for ; Wed, 18 Oct 2023 15:46:10 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id hJeCZk7odeBH; Wed, 18 Oct 2023 15:46:09 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 4920F9C31D0; Wed, 18 Oct 2023 15:46:09 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 4920F9C31D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1697658369; bh=XRWnOIteylIgRo5+sufAPUnD3BIZ47aoEBlFsSl8S4s=; h=From:To:Date:Message-Id:MIME-Version; b=iS7LabuWZQlU/IGJ2OiLD6IQWrOZUbC29elFV4zReysrhgqCwuT+LhhCF6bkuVyxg Eb+hAEG3l9YOqL6NyC+p8gJYb0ktYRI4hosZQI30OBXisWdHnOpH3uUN/slqhMu5+v zrl+mN1shXjtigswwkRjvNF+jjGwVcn0jxQERIgVdwVF+ZEhK5s+3w+BeNo7ehuaRH /QrVECziYnGn2Uwgs3txdR13dpR/BGc0do1iwAmp8SLs/J268AmwPdAvE8MJ0Ka6oy 5fBkR2Ij5chMpg+XKI4hVGc4lHQEtA6LPRJPqhvBK976UtfyHEur7JrTQOiNFhw0nP 55YcuvyJN3WBg== 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 5UqCmki8iGaM; Wed, 18 Oct 2023 15:46:09 -0400 (EDT) Received: from savoirfairelinux.mtl.sfl (unknown [192.168.51.254]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 2CFEC9C2CC3; Wed, 18 Oct 2023 15:46:09 -0400 (EDT) From: Marlon Rodriguez Garcia To: toaster@lists.yoctoproject.org Cc: Marlon Rodriguez Garcia Subject: [PATCH] toaster: add tox.ini file to execute flake8 and test suite Date: Wed, 18 Oct 2023 15:46:05 -0400 Message-Id: <20231018194605.2710214-1-marlon.rodriguez-garcia@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 ; Wed, 18 Oct 2023 19:46:15 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5873 Added configuration file for tox https://tox.wiki/en/4.11.3/ that includes flake8 and the test suite. This file can be execute using the command 'tox tox.ini' and can be used in autobuilder. By adding flake8 to the validation of toaster the following aspects have to be take into consideration: Objective - To comply with PEP8 standards, we propose to utilize a linting tool(Flake8) that checks toaster's codebase for errors, styling issues and complexity Ruleset - See complete list of rules : https://www.flake8rules.com/ Assumptions - We are aware that not all Flake8 rules can be applied to current codebase (those determined to be more troublesome can be excluded). - The patches can be integrated gradually by sections and/or rules. - The tox.ini will include the execution of the test suite. Pros - Standardized codebase for future integrations. - Majority of the patches will be syntax modifications and not affecting application logic. Cons - Major refactor of the codebase. Signed-off-by: Marlon Rodriguez Garcia --- lib/toaster/tox.ini | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/toaster/tox.ini diff --git a/lib/toaster/tox.ini b/lib/toaster/tox.ini new file mode 100644 index 00000000..bcdfdb4f --- /dev/null +++ b/lib/toaster/tox.ini @@ -0,0 +1,25 @@ +[tox] +envlist = py310 +skipsdist = True +toxworkdir = {env:TOX_WORKDIR:.tox} +passenv = * + +[testenv] +setenv = + DJANGO_SETTINGS_MODULE=toastermain.settings_test + TOASTER_BUILDSERVER=1 + EVENTREPLAY_DIR={toxinidir}/../../../build/ + BUILDDIR={toxinidir}/../../../build/ +commands = + flake8 + python3 {toxinidir}/manage.py test tests.db tests.commands tests.builds tests.browser tests.functional tests.views +deps = + -r ../../toaster-requirements.txt + -r {toxinidir}/tests/toaster-tests-requirements.txt + flake8 + +[flake8] +ignore = E501, F403 + +[testenv:chrome] +commands={[testenv]commands} --splinter-webdriver=chrome \ No newline at end of file