[U-Boot] [PATCHv2 00/13] Moving test/py to Python 3

Tom Rini
2019-10-23T03:19:57Z

Hey all,

So, here's the second pass at moving our test/py code over to Python 3.
This time, I think it's ready to merge as I've resovled the WORKAROUND /
HACK patches. In terms of what I was calling a WORKAROUND, I'm
comfortable saying this is a feature / intentional change in how and
when we instantiate a virtualenv for python and use python3 there. The
HACK patches have been dropped and we now have the same or better
test.py coverage in CI (test_fs tests are still skipped in Travis, but
run in GitLab so I'm going to put fixing Travis on the TODO list).

The first two patches can go in any time and I will
probably pull them soon as well. The next patch is an old one from
Marek that I deferred at the time, but it's time now so I've updated it
slightly to cover the new cases of the same code he fixed before. For
migrating the pytest code itself, I've left the conversion split in a
few commits. This isn't bisectable but certainly for review it's
better. I'm honestly not sure if it's more important for history to
keep this bisectable or to have the changes broken out like this.

In terms of changes from v1 to v2, as noted above I've fixed the test_fs
tests so that they run. I've also fixed the EFI tests (which was
failing due to regex strings needing to be raw strings now), and fix
that same issue in other places where it was non-fatal. I've also
introduced another patch that has a pip "requirements.txt" file that
describes all of the python modules that our tests require and the
versions there-of. This will help make things more reproducible long
term and is something that needs to be refreshed from time to time. The
other big change is that I've changed how test/py/test.py (which
currently is a wrapper around calling py.test) so that it instead calls
the pytest module directly (which is what py.test does). This will
eliminate the problem of "python2-pytest was invoked, everything failed"
as test/py/test.py is using python3. It still provides a user-friendly
error when pytest is not available.

--
Tom