[openstack-dev] Recent Changes in os-testr and migrating to stestr

Matthew Treinish mtreinish at kortar.org
Wed Sep 13 19:40:42 UTC 2017

Hi Everyone,

People might have noticed the recently os-testr 1.0.0 was recently released and
made some pretty big changes to the internals of the ostestr script. ostestr was
originally created to replace the local pretty_tox.sh scripts in all the projects
with a consistent interface. Because of that the script originally literally just
would use subprocess to run testr. However, in the 1.0.0 release this has changed
and now uses stestr's python interface to run tests. [1]

stestr[2][3] is a fork of testr I started several months ago. The testrepository
project is pretty much completely inactive at this point and has several long
standing bugs. stestr was started to address these bugs, but also limits the scope
to just a parallel python test runner. (instead of a generic test runner runner
like testr is) The best example of the improvements stestr brings fixes the dbm
issue between python versions so you don't have to delete the times.dbm file
anymore between. (but there are a lot of other improvements so far)

So what does this mean for current ostestr users, in most cases not much. The
only external differences are that the repository by default is are to .stestr
instead of .testrepository and ostestr will emit a warning until a .stestr.conf
file is created. This probably means .stestr/ should be added to .gitignore
before too long, but it's not really a blocker. There is an issue with neutron
(and networking-*) functional tests because their post-test-hook runs chmod on
.testrepository unconditionally. This will need to be updated for things to
with the new ostestr version pass.

As for the warning about the .stestr.conf ostestr parses the .testr.conf and
tries to guess the parameters it needs to run, but it's not a perfect process
and that's why adding a .stestr.conf is best. I've seen a couple of cases where
projects were setting custom env variable in the .testr.conf where this process
didn't work and creating a .stestr.conf and adding the env vars to tox.ini was
the only way to address this.

Moving forward I'd like to get everything switched over to using stestr, either
directly or indirectly via ostestr. (although longer term I'd like to see the
ostestr script go away because it doesn't really do anything anymore) This way
we can get everything using an actively maintained test runner.

I'd also like to apologize for the timing of this transition, we originally
intended to just test the waters during the PTG while people were f2f and debug
issues. But, we wanted to wait until after the PTG (for obvious reasons) to make
the big cut over. But, things ballooned kinda quickly and we're now using the new
version of ostestr. I'll be around all week at the PTG or on irc to help people
that might be having issues related to the new os-testr release.


-Matt Treinish

[1] https://review.openstack.org/#/c/488441/
[2] https://github.com/mtreinish/stestr
[3] http://stestr.readthedocs.io/en/latest/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170913/30bb589a/attachment.sig>

More information about the OpenStack-dev mailing list