Hi, I am running a set of unit tests for a custom product nightly via a buildbot installation, via bin/zopectl test -s Products.MyProduct in zope 2.9. Sorry in advance that this looks complicated - my query is actually pretty straightforward! Recently, I introduced a bug in the __init__.py of the product, which caused the product installation to fail in zope. The following was written to stdout: 2007-04-12 10:05:34 ERROR Zope Couldn't install CMFMyProduct Traceback (most recent call last): File "/usr/local/Zope-2.9.5/lib/python/OFS/Application.py", line 783, in install_product initmethod(context) File "/home/buildslave/buildslaves/astrodon/build/Zope-2.9.5/Products/CMFMyProduct/__init__.py", line 227, in initialize context.registerClass(MyModule.MyClass, NameError: global name 'MyModule' is not defined The trivial error was that MyModule was not imported earlier in __init__.py However, having logged this, the testrunner proceeded to run all my tests correctly, and so the buildbot reported a pass. I expected the testrunner to bomb out on encountering this error, but it didn't - however if I start zope with zopectl fg, the bug I introduced causes it to fail to start. I'm a bit concerned that there was a false test pass. Is there a way to stop the testrunner in this case, in the same way as running in fg mode? Thanks, Miles
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12 Apr 2007, at 13:35, Miles wrote:
However, having logged this, the testrunner proceeded to run all my tests correctly, and so the buildbot reported a pass. I expected the testrunner to bomb out on encountering this error, but it didn't - however if I start zope with zopectl fg, the bug I introduced causes it to fail to start.
I'm a bit concerned that there was a false test pass. Is there a way to stop the testrunner in this case, in the same way as running in fg mode?
If I remember correctly the startup success/failure with a defective product present is governed by debug mode. If you turn it on in zope.conf and attempt to start Zope via "zopectl start" it should fail as desired. "zopectl fg" forces debug mode to be switched on. jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFGHiRPRAx5nvEhZLIRAg9+AJ9/Rc5iXyl3HNasxXcojJ0VrFi7AACbBaui LxCX4H/TRbg7G8NN8MZqcsE= =y1FY -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jens Vagelpohl wrote:
On 12 Apr 2007, at 13:35, Miles wrote:
However, having logged this, the testrunner proceeded to run all my tests correctly, and so the buildbot reported a pass. I expected the testrunner to bomb out on encountering this error, but it didn't - however if I start zope with zopectl fg, the bug I introduced causes it to fail to start.
I'm a bit concerned that there was a false test pass. Is there a way to stop the testrunner in this case, in the same way as running in fg mode?
If I remember correctly the startup success/failure with a defective product present is governed by debug mode. If you turn it on in zope.conf and attempt to start Zope via "zopectl start" it should fail as desired. "zopectl fg" forces debug mode to be switched on.
Correct. The reason the OP's tests are passing is likely that they are real unit tests, and therefore don't depend on having the product's 'initialize' method run (if they did, they would be *integration* or *functional* tests). Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGHkR9+gerLs4ltQ4RAng/AJ41pLpp8Ro89oxpkdCcSmtAC/9CvQCgnEzL 6jt0KI9fah8uPiJum901HD8= =ZpeV -----END PGP SIGNATURE-----
participants (3)
-
Jens Vagelpohl -
Miles -
Tres Seaver