Not-really-unit-testing ideas.
I noticed on the unit tests I'm currently working on, that most of my time is wasted waiting for sites to be created. So I've been thinking of ways to solve this. Basically, I'd like to create a site once, and use it for all subsequent tests, until I made a change that means the site needs to be recreated. But how? Well, I'm not sure. How, for example, could I use a normal ZODB, with a specific name (so as not to interfere with the normal ZODB) in the unit tests? If I could do that, I could implement a switch to either rebuild the ZODB, or use the existing one. This would shave some 50% of the unit testing time. Ideas? Or am I just stupid? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
On 11/23/05, Lennart Regebro <regebro@gmail.com> wrote:
Basically, I'd like to create a site once, and use it for all subsequent tests, until I made a change that means the site needs to be recreated. But how? Well, I'm not sure. How, for example, could I
Jim's "new test runner" includes support for "layers", which solves this issue. I think the Zope 2 trunk is already using the new test runner; you can also use it on the Zope 3 trunk. We're using test layers extensively here, and it really helps. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "There is no wealth but life." --John Ruskin
On 11/23/05, Fred Drake <fdrake@gmail.com> wrote:
On 11/23/05, Lennart Regebro <regebro@gmail.com> wrote:
Basically, I'd like to create a site once, and use it for all subsequent tests, until I made a change that means the site needs to be recreated. But how? Well, I'm not sure. How, for example, could I
Jim's "new test runner" includes support for "layers", which solves this issue.
Well, cool!
I think the Zope 2 trunk is already using the new test runner; you can also use it on the Zope 3 trunk. We're using test layers extensively here, and it really helps.
Too bad I'm on 2.7.old.beta.something here... :-( -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
Fred Drake wrote:
On 11/23/05, Lennart Regebro <regebro@gmail.com> wrote:
Basically, I'd like to create a site once, and use it for all subsequent tests, until I made a change that means the site needs to be recreated. But how? Well, I'm not sure. How, for example, could I
Jim's "new test runner" includes support for "layers", which solves this issue. I think the Zope 2 trunk is already using the new test runner; you can also use it on the Zope 3 trunk. We're using test layers extensively here, and it really helps.
Cool, how does a Zope 2.8.4 developer go about findout out about these layers and using them? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
Fred Drake wrote:
On 11/23/05, Lennart Regebro <regebro@gmail.com> wrote:
Basically, I'd like to create a site once, and use it for all subsequent tests, until I made a change that means the site needs to be recreated. But how? Well, I'm not sure. How, for example, could I
Jim's "new test runner" includes support for "layers", which solves this issue. I think the Zope 2 trunk is already using the new test runner; you can also use it on the Zope 3 trunk. We're using test layers extensively here, and it really helps.
Cool, how does a Zope 2.8.4 developer go about findout out about these layers and using them?
Look at http://svn.zope.org/zope.testing/trunk/src/zope/testing/. Unfortunately, there isn't really documentation on what layers are for or how to write them. This is a an ommission that needs to be addressed. You should be able to use the new test runner in 2.8. We use it with 3.1. It is included in 2.9 and 3.2. To see how layers are are used, look at zope.app.testing.functional on the Z3 trunk. The Zope 3 functional tests are now provided via a layer. In the coming months we'll be releasing packages that use layers to provide independent functional tests. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
participants (4)
-
Chris Withers -
Fred Drake -
Jim Fulton -
Lennart Regebro