[Mailman-Developers] MM3 REST API testing [was: Python 3]

Florian Fuchs flo.fuchs at gmail.com
Sat Dec 27 13:16:51 CET 2014

Am 26.12.2014 um 16:38 schrieb Aurelien Bompard:
> And mailman.client must be ported too, since it does import stuff from
> mailman for testing purposes. I think Postorious is safe, but that must be
> verified (I believe it imports the testing framework from mailman.client
> and thus must be ported too).

I think, this is worth another thread.

So far we haven't found a perfect solution for testing packages that
rely heavily on the MM3 REST API. As far as mailman.client, Postorius
and HK are concerned, testing without *some* core integration doesn't
make too much sense IMO, because any changes in the API would go unnoticed.

The first solution for that was to start the core (out of process) with
a temporary configuration and on a different port before running the
tests and tearing it down afterwards. That way mailman.client/Postorius
would be tested with a real MM core underneath it. Compatibility with
the API was guaranteed, but it was painfully slow and also a little
unstable. It's not fun when every typo is punished with a 10 or 20s penalty!

That's why I was extremely happy when Aurélien came up with a much
better idea a while ago. His solution made use of the webtest package,
which made it possible to test the MM3 API wsgi app without the HTTP
overhead or the need to start/stop the main MM process. Much faster,
more stable, a real delight compared to the situation we had before.

Unfortunately, this now means direct "from mailman" imports which will
break with incompatible Python versions. Too bad, we didn't think about
this (I, for one, was aware of the fact that Barry plans to do a
monolingual port at some point in the future. So I could have thought
about that earlier. :-/ meh...).

Of course, in order to make our tests work with a py3 MM core, we could
go back to the slow and no-fun way of testing that we had before. But
maybe there's better way...

Any ideas?


More information about the Mailman-Developers mailing list