Testing products: Testing all in one batch
Has anybody set up a batch job to test all installed Products in a zope instance? Seems like the only *useful* way I can get it to run is with a loop that does "bin/zopectl test" once for each subdirectory of Products that I actually care about, taking care to ignore problematic third-party products. Which is OK I guess, but I'd prefer not to have to skip anything. I think you *should* be able to simply do "./bin/zopectl test" and that will run everything, but with real-world products this seems to be a huge mess that spews a lot of red herring errors: - Some otherwise excellent third-party products have tests with dependencies that the product itself does not have, and which I do not want to install. (I will contact the author(s) privately.) - Some third-party products (e.g. CMF) ship with tests that just plain fail. If I install CMF 1.4.8 and nothing else, and run ./bin/zopectl test, I get 1 error and 1 failure. This is a bit surprising from a stable release, I'd expect not to get any... will forward those to the CMF list and follow up there, if there are not already issues filed for these. - Some of my own Product tests run fine in isolation but break when run alongside other installed product tests. That's its own issue which I will take up in a separate thread. I guess my overall questions are.... - Does this jibe with others' experience? - Is there a better (or best) way to run all my Product tests? - *Should* we expect that ./bin/zopectl test will run all installed Products tests, and if so, what can we do as a community to get authors to fix their products? p.s. you may notice a series of messages from me re. testing... i'm trying to sort out a bunch of issues at once, and want to try to keep the issues separate. -- Paul Winkler http://www.slinkp.com
Paul Winkler wrote:
Has anybody set up a batch job to test all installed Products in a zope instance?
Yes ;-)
Seems like the only *useful* way I can get it to run is with a loop that does "bin/zopectl test" once for each subdirectory of Products that I actually care about, taking care to ignore problematic third-party products. Which is OK I guess, but I'd prefer not to have to skip anything.
I have a python script that builds a big command line to test.py of the form: bin/zopectl test Products/Product1|Products/Products2|etc ...it's not pretty, but it does work, and lets you exclude geb0rken products like Archetypes from test runs...
- Some otherwise excellent third-party products have tests with dependencies that the product itself does not have, and which I do not want to install. (I will contact the author(s) privately.)
Yep, I exclude them too ;-)
- Some third-party products (e.g. CMF) ship with tests that just plain fail.
Really? That's not been the case for a long time. When trying to test a Plohn setup, I found some of the Plohn tests were causing CMF tests to fail if the CMF tests were run in the same batch, 'cos they no doubt leave lots of crap lying around :-(
If I install CMF 1.4.8 and nothing else, and run ./bin/zopectl test, I get 1 error and 1 failure.
Why are you using something so ancient? ;-)
- Some of my own Product tests run fine in isolation but break when run alongside other installed product tests.
Then either your tests or the other tests are leaving turds...
- Does this jibe with others' experience?
Yes.
- Is there a better (or best) way to run all my Product tests?
If you find it, let me know! :-)
- *Should* we expect that ./bin/zopectl test will run all installed Products tests, and if so, what can we do as a community to get authors to fix their products?
Beat them with sticks, embarass them in public, etc... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers said:
Paul Winkler wrote:
Seems like the only *useful* way I can get it to run is with a loop that does "bin/zopectl test" once for each subdirectory of Products that I actually care about, taking care to ignore problematic third-party products. Which is OK I guess, but I'd prefer not to have to skip anything.
I have a python script that builds a big command line to test.py of the form:
bin/zopectl test Products/Product1|Products/Products2|etc
...it's not pretty, but it does work, and lets you exclude geb0rken products like Archetypes from test runs...
Aha, that's much like what I'm doing except that yours runs in one go and thus exposes tests that don't clean up after themselves. Which is a Good Thing if I can just find and fix all the nasty things...
- Some third-party products (e.g. CMF) ship with tests that just plain fail.
Really? That's not been the case for a long time. When trying to test a Plohn setup, I found some of the Plohn tests were causing CMF tests to fail if the CMF tests were run in the same batch, 'cos they no doubt leave lots of crap lying around :-(
If I install CMF 1.4.8 and nothing else, and run ./bin/zopectl test, I get 1 error and 1 failure.
Why are you using something so ancient? ;-)
Irrelevant to this discussion, but A) it's hardly ancient, and B) upgrading to 1.5.x has been postponed indefinitely as it breaks a lot of old things (some mine, some third-party) and I have not had any time to devote a day or three to resolving the incompatibilities. Anyway, as somebody replied to me in zope-cmf list last night, the breakage is fixed on the 1.4 branch and there will likely be a 1.4.9 release.
- Some of my own Product tests run fine in isolation but break when run alongside other installed product tests.
Then either your tests or the other tests are leaving turds...
Indeed. I wish it was easier to diagnose and resolve problems like this. The problem is that tests seem to be run in alphabetical order, I don't know of a way to force another order, and so I'm left with adding and removing things from Products to see what minimal set of products will trigger the error - which is a crude technique since some products' tests will not run at all unless some other product is present (e.g. you can't run CMFDefault tests if CMFCore is not present).
- Does this jibe with others' experience?
Yes.
Thanks. I'm always hoping that things like this are just me doing something stupid and the problem will go away with some trivial tweak I've overlooked... sadly, no such luck.
- Is there a better (or best) way to run all my Product tests?
If you find it, let me know! :-)
Will do :) -- Paul Winkler http://www.slinkp.com
Paul Winkler wrote:
I have a python script that builds a big command line to test.py of the form:
bin/zopectl test Products/Product1|Products/Products2|etc
...it's not pretty, but it does work, and lets you exclude geb0rken products like Archetypes from test runs...
Aha, that's much like what I'm doing except that yours runs in one go and thus exposes tests that don't clean up after themselves. Which is a Good Thing if I can just find and fix all the nasty things...
No, no, we have several "batches" above, where each batch contains only products that don't screw up each others' tests. There were some products, mainly from Plone, which we just had to remove from the test run altogether, because "THEY SUCK!" ;-)
Irrelevant to this discussion, but A) it's hardly ancient,
But CMF 1.6 is on the horizon now ;-)
and B) upgrading to 1.5.x has been postponed indefinitely as it breaks a lot of old things (some mine, some third-party) and I have not had any time to devote a day or three to resolving the incompatibilities.
Ah, the compatability trap :-S
- Some of my own Product tests run fine in isolation but break when run alongside other installed product tests.
Then either your tests or the other tests are leaving turds...
Indeed. I wish it was easier to diagnose and resolve problems like this.
Yup, I know of no other way that goign through case-by-case...
The problem is that tests seem to be run in alphabetical order, I don't know of a way to force another order,
go and get inside unittest.py and have a play... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On 4 Oct 2005, at 23:21, Paul Winkler wrote:
Has anybody set up a batch job to test all installed Products in a zope instance?
bin/zopectl test --dir Products/ from the instance home will test all products in that instance home. jens
Jens Vagelpohl said:
On 4 Oct 2005, at 23:21, Paul Winkler wrote:
Has anybody set up a batch job to test all installed Products in a zope instance?
bin/zopectl test --dir Products/
from the instance home will test all products in that instance home.
Well, so will bin/zopectl test without the --dir argument, but I guess you didn't read the rest of my message ;-) Thanks anyway. -- Paul Winkler http://www.slinkp.com
On 5 Oct 2005, at 14:44, Paul Winkler wrote:
bin/zopectl test --dir Products/
from the instance home will test all products in that instance home.
Well, so will bin/zopectl test without the --dir argument, but I guess you didn't read the rest of my message ;-)
I answered one of the questions you asked, that's all. The issue you are having with tests failing when you run them is separate. It's a combination of lack of quality control (products whose tests fail "out of the box" when you run them separately) or lack of cleanup in testing code. jens
Paul Winkler wrote:
- Some third-party products (e.g. CMF) ship with tests that just plain fail. If I install CMF 1.4.8 and nothing else, and run ./bin/zopectl test, I get 1 error and 1 failure. This is a bit surprising from a stable release, I'd expect not to get any... will forward those to the CMF list and follow up there, if there are not already issues filed for these.
CMF 1.4 tests were not designed to be run through bin/zopectl test. This was changed in CMF 1.5. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
participants (4)
-
Chris Withers -
Florent Guillaume -
Jens Vagelpohl -
Paul Winkler