From: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
To: toaster@lists.yoctoproject.org
Cc: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
Subject: [PATCH] toaster: add tox.ini file to execute flake8 and test suite
Date: Wed, 18 Oct 2023 15:46:05 -0400 [thread overview]
Message-ID: <20231018194605.2710214-1-marlon.rodriguez-garcia@savoirfairelinux.com> (raw)
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 <marlon.rodriguez-garcia@savoirfairelinux.com>
---
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
--
2.34.1
next reply other threads:[~2023-10-18 19:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 19:46 Marlon Rodriguez Garcia [this message]
2023-10-18 19:51 ` [Toaster] [PATCH] toaster: add tox.ini file to execute flake8 and test suite Tim Orling
2023-10-18 19:57 ` Marlon Rodriguez Garcia
2023-10-18 20:06 ` [Toaster] " Tim Orling
2023-10-18 20:07 ` Tim Orling
2023-10-18 20:57 ` [bitbake-devel] " Richard Purdie
2023-10-18 21:04 ` Tim Orling
2023-10-23 18:28 ` Tim Orling
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=20231018194605.2710214-1-marlon.rodriguez-garcia@savoirfairelinux.com \
--to=marlon.rodriguez-garcia@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 read-only IMAP folder(s) and NNTP newsgroup(s).