[elbe-devel] [PATCH 0/3] unittests start

Torben Hohn torben.hohn at linutronix.de
Wed Mar 11 18:13:41 CET 2020


On Wed, Mar 11, 2020 at 12:45:40PM -0400, Olivier Dion wrote:
> On Wed, 11 Mar 2020, Torben Hohn <torben.hohn at linutronix.de> wrote:
> > On Thu, Mar 05, 2020 at 05:38:33PM -0500, Olivier Dion wrote:
> >> On Thu, 05 Mar 2020, Torben Hohn <torben.hohn at linutronix.de> wrote:
> >> > This is a first go on unittests.
> >> >
> >> > Olivier is supposed to implement unittests soon. And we
> >> > have a few problems hiding in the copy_filelist() implementation
> >> > regarding symlinks.
> >> >
> >> > This is not yet ready to be merged, but it already points us
> >> > to the problems we currently see.
> >> >
> >> > Tests can be run using:
> >> >
> >> > python -m unittest discover
> >> > or 
> >> > python3 -m unittest discover
> >> >
> >> > note that python3 complains about the missing python3-spyne, while
> >> > scanning the soap modules.
> >> >
> >> > To lxcvs:linutronix/elbe/elbe
> >> >  * [new branch]          devel/torbenh/unittests -> devel/torbenh/unittests
> >> >
> >> >
> >> > Torben Hohn (3):
> >> >   tests: start with unittests by simply verifying the version
> >> >   tests efilesystem: add a test for copy_fileslist and usrmerge
> >> >   tests efilesystem: add deeplinks test for copy_filelist()
> >> >
> >> >  elbepack/tests/__init__.py         |  0
> >> >  elbepack/tests/test_efilesystem.py | 64 ++++++++++++++++++++++++++++++
> >> >  elbepack/tests/test_version.py     |  8 ++++
> >> >  3 files changed, 72 insertions(+)
> >> >  create mode 100644 elbepack/tests/__init__.py
> >> >  create mode 100644 elbepack/tests/test_efilesystem.py
> >> >  create mode 100644 elbepack/tests/test_version.py
> >> 
> >> I made some changes to your unit tests.  I've also fixed the
> >> copy_filelist, which should now handle nested symlinks.
> >> 
> >> git at lxcvs:linutronix/elbe/elbe.git devel/dion/unittests d4560a59..ce9d072f
> >
> > please use prefixes with : in the first line of the commit log.
> >
> > Basically the module name (efilesystem: for copy_filelist patches.)
> >
> > Or "tests efilesystem:"
> >
> > I am not happy with the removal of the test_ prefix, because the 
> > commandline to start the tests gets more complicated.
> >
> >
> > https://docs.python.org/3/library/unittest.html#load-tests-protocol
> >
> > is there, and it should be possible, to remove the test_ prefix and
> > still use "python3 -m unittest discover"
> 
> I had in mind to have a command, something like './elbe check', that
> wrap the discovery invocation.

lets use the load-tests protocol.

> 
> > I am still not conviced, that i like test modules without a prefix.
> > I mean, of course, they would still be in different directories.
> > But we would end up with identical filenames.
> 
> I honeslty don't care if the tests are prefix with test_.  I just find
> it redundant to have informations in the name of a file when the
> filesystem can do that for you with hierarchy.  I guess the only
> advantage is for fuzzy searching and perhaps for the discovery of tests.

yeah.
So i think we should keep the test_ prefix for now.

> 
> -- 
> Olivier Dion
> Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list