New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dist/tools/compile_and_test_for_board: add basic checks for script #10837
dist/tools/compile_and_test_for_board: add basic checks for script #10837
Conversation
Use [tox](https://tox.readthedocs.io/en/latest/) to run basic checks on the | ||
script: | ||
|
||
$ tox compile_and_test_for_board.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it have the script as argument ?
Every script could need its own tox
file as the script may have its dependencies anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it have the script as argument ?
I find this more generic this way. We could reuse this tox config file for any python script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But a script that has dependencies or special targets needs his own file anyway. So I prefer it the new way :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested to add this file so am obviously for it.
I would however prefer not running it with tox script_name
but just tox
as it is the normal usage for tox
.
I like having 3 commits.
Otherwise it conflicts with pytest automatic parsing which tries to execute all classes with name beginning with Test
a43e857
to
b7b8055
Compare
I changed that, let me know what you think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, is good for me right now. Also I tested all 4 cases.
Can you squash and enable murdock when done ? |
tox.ini configures 3 checks on the python script: doctest (via pytest), pylint and flake8
Provide some notes on how to perform basic checks on the script using tox
b7b8055
to
613e05f
Compare
just did that |
CI is green, let's merge! |
Contribution description
This PR is adding basic Python checks for the
compile_and_test_for_board.py
script. The checks are run using Tox. Performed are:To avoid issues with pytest automatic parsing, I renamed the
TestError
exception toErrorInTest
.Testing procedure
Install tox:
pip install tox --user
Use it:
cd dist/tools/compile_and_test_for_board
tox compile_and_test_for_board.py
Issues/PRs references
Follow-up of #10818 and idea suggested by @cladmi