qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 21/25] python: add avocado-framework and tests


From: Cleber Rosa
Subject: Re: [PATCH v6 21/25] python: add avocado-framework and tests
Date: Tue, 25 May 2021 14:58:56 -0400

On Wed, May 12, 2021 at 07:12:37PM -0400, John Snow wrote:
> Try using avocado to manage our various tests; even though right now
> they're only invoking shell scripts and not really running any
> python-native code.
> 
> Create tests/, and add shell scripts which call out to mypy, flake8,
> pylint and isort to enforce the standards in this directory.
> 
> Add avocado-framework to the setup.cfg development dependencies, and add
> avocado.cfg to store some preferences for how we'd like the test output
> to look.
> 
> Finally, add avocado-framework to the Pipfile environment and lock the
> new dependencies. We are using avocado >= 87.0 here to take advantage of
> some features that Cleber has helpfully added to make the test output
> here *very* friendly and easy to read for developers that might chance
> upon the output in Gitlab CI.
> 
> [Note: ALL of the dependencies get updated to the most modern versions
> that exist at the time of this writing. No way around it that I have
> seen. Not ideal, but so it goes.]
> 
> Provided you have the right development dependencies (mypy, flake8,
> isort, pylint, and now avocado-framework) You should be able to run
> "avocado --config avocado.cfg run tests/" from the python folder to run
> all of these linters with the correct arguments.
> 
> (A forthcoming commit adds the much easier 'make check'.)
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/README.rst      |   2 +
>  python/Pipfile.lock    | 104 ++++++++++++++++++++++-------------------
>  python/avocado.cfg     |  10 ++++
>  python/setup.cfg       |   1 +
>  python/tests/flake8.sh |   2 +
>  python/tests/isort.sh  |   2 +
>  python/tests/mypy.sh   |   2 +
>  python/tests/pylint.sh |   2 +
>  8 files changed, 77 insertions(+), 48 deletions(-)
>  create mode 100644 python/avocado.cfg
>  create mode 100755 python/tests/flake8.sh
>  create mode 100755 python/tests/isort.sh
>  create mode 100755 python/tests/mypy.sh
>  create mode 100755 python/tests/pylint.sh
> 

With the patches from your "Python: delint python library" series:

   $ pipenv run avocado --config avocado.cfg run tests/
   JOB ID     : b27b48eded8b405c6672e61e3d1561407fca9d5e
   JOB LOG    : 
/home/cleber/avocado/job-results/job-2021-05-25T14.56-b27b48e/job.log
    (1/4) tests/flake8.sh: PASS (0.67 s)
    (2/4) tests/isort.sh: PASS (0.37 s)
    (3/4) tests/mypy.sh: PASS (0.39 s)
    (4/4) tests/pylint.sh: PASS (4.85 s)
   RESULTS    : PASS 4 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | 
CANCEL 0
   JOB TIME   : 6.75 s

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]