On Thu, 2011-09-01 at 09:23 -0400, Chris Lalancette wrote:
On 08/31/11 - 10:49:36AM, James Laska wrote:
>
> Greetings,
>
> I've been looking into integrating existing oz unittests with jenkins. It
> wasn't hard to have them run in jenkins as is, but I was looking give jenkins a
> better idea for pass/fail data over time. One way to do this was to convert
> the tests to use py.test (or unittest -- but that's a little crusty). Py.test
> can emit junit XML test output, which is jenkins friendly, and has much less
> stock test class/method bloat. I've modified the existing oz unittests to be
> py.test friendly.
>
> Another annoyance with running tests in jenkins is that the nodes need to be
> manually setup with appropriate dependencies ahead of time. While this isn't
> hard, it's maintenance and one more thing to forget/fail when testing. The new
> test driver (runtests.sh) will setup a python virtualenv and install required
> dependencies there. This is intended to handle deps installation during
> unittest execution.
>
> > .gitignore | 6 +
> > Makefile | 6 +-
> > tests/dependencies.txt | 2 +
> > tests/factory/run.sh | 5 -
> > tests/factory/test_factory.py | 311
+++++++++++++++++++++--------------------
> > tests/runtests.sh | 90 ++++++++++++
> > tests/tdl/run.sh | 128 -----------------
> > tests/tdl/test.cfg | 135 ++++++++++++++++++
> > tests/tdl/test_tdl.py | 131 +++++++++++++++++-
> > 9 files changed, 524 insertions(+), 290 deletions(-)
Arg. I know I said I was willing to entertain these patches, and I was, but
I have to say that I am not a fan. It turns what is simple bash and python
unittests into a morass of config files, scripts, and magic. Plus it adds 3
new dependencies to run the unittests, which is an additional barrier to entry
for new contributors.
FWIW, I like what OpenStack's glance has done with their unit tests
using virtualenv and nose. Maybe look at that?
https://github.com/openstack/glance
Cheers,
Mark.