Maurits van Rees | 1 Mar 2010 11:46
Picon
Favicon
Gravatar

Re: Plone 4.0a5 registration through overlay form not working

Kees Hink, on 2010-02-23:
> http://dev.plone.org/plone/ticket/10257	

Fixed by Steve McMahon during the Plone TuneUp.  Thanks, Steve!

--

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
What are you going to create today?

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Plone Tests Summarizer | 1 Mar 2010 12:59
Picon

Plone Tests: 4 OK, 1 Failed

Summary of messages to the testbot list.
Period Sun Feb 28 12:00:00 2010 UTC to Mon Mar  1 12:00:00 2010 UTC.
There were 5 messages: 1 from ATContentTypes Tests, 1 from Archetypes Tests, 1 from Plone Libraries Tests,
1 from Plone Products Tests, 1 from Plone Tests.

Test failures
-------------

Subject: FAILED (90 packages, 3 failures) : Plone-4.0 Zope-2.12 Python-2.6.4
From: Plone Tests
Date: Mon Mar  1 02:43:02 UTC 2010
URL: http://lists.plone.org/pipermail/testbot/2010-March/015770.html

Tests passed OK
---------------

Subject: OK : Plone-3.3 Zope-2.10 Python-2.4.6
From: Plone Products Tests
Date: Mon Mar  1 02:20:18 UTC 2010
URL: http://lists.plone.org/pipermail/testbot/2010-March/015766.html

Subject: OK : Plone-3.3 Zope-2.10 Python-2.4.6
From: Plone Libraries Tests
Date: Mon Mar  1 02:25:19 UTC 2010
URL: http://lists.plone.org/pipermail/testbot/2010-March/015767.html

Subject: OK : AT-1.5 Plone-3.3 Zope-2.10 Python-2.4.6
From: Archetypes Tests
Date: Mon Mar  1 02:31:35 UTC 2010
URL: http://lists.plone.org/pipermail/testbot/2010-March/015768.html
(Continue reading)

Alexander Limi | 1 Mar 2010 14:09
Favicon
Gravatar

Reminder: Plone 4 beta deadline is Wednesday this week

Just in case you forgot. :)

--
Alexander Limi · http://limi.net

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Martin Aspeli | 1 Mar 2010 14:13
Picon

Towards a better testing infrastructure

Hi,

I've been talking to a few people on IRC about this over the past few 
days, but I wanted to put some of it down in writing, to see if there's 
any interest in people helping to take this forward.

In short, I think ZopeTestCase and PloneTestCase have become too 
unwieldly. There are too many ways to set up test suites, too many base 
classes, and too much is set up even for relatively simple tests. In 
projects where I work with people who're not Plone experts, I've all but 
given up on trying to set up test layers and minimal test fixtures. 
We're lucky if we do a few "plain unittest.TestCase" tests. 90% of tests 
are full PloneTestCase integration tests, and most people in my teams 
(and, I'd wager, out there in the community) have only a vague 
understanding about what PloneTestCase is doing and how it affects their 
test environment. Leakage between tests happens, and when it happens, 
it's hard to track down.

I don't think we should try to "fix" ZTC/PTC, because the BBB 
implications would be heinous. Instead, I think we can create some new, 
simpler, better documented (!) test infrastructure. New packages can opt 
into this instead of using ZTC/PTC. Old packages will not need to move.

I envisage us ending up with two packages: plone.testing, and 
plone.app.testing. The former would be a good test dependency for 
plone.* type packages, that do not depend on "Plone-the-application", 
and the latter for plone.app.* type packages, that do.

The key to all this, I think, is layers. We should end up with a couple 
of useful base classes for tests, and then a set of well-defined, 
well-documented layers that people can use and extend for their own 
purposes.

Below, I'll outline a few thoughts on what could go in each of these 
fictitious packages.

Use cases
---------

I see the following "valid" types of tests. I think we should have 
exactly one documented way to do each one of these.

  - A unittest.TestCase-style unit test (I'll call this a Python unit 
test from now on, as distinct from a doctest)

  - A doctest file

  - Doctests in docstrings in a module

Layers
------

For each of these, I see the following layers being available:

  - No layer - just a plain unit test

  - No layer, but full teardown of the ZCA after each test. This makes 
it safe to use e.g. provideAdapter() in a test.

  - A minimal ZCA layer that hooks up things like the object event 
redispatcher.

  - A basic ZCA layer that also registers the core ZCML directives 
(those in the zope and browser namespaces)

  - A Zope 2 layer that wires up Zope 2's configuration, but not to the 
point of setting up users or a ZODB root.

  - A basic ZODB layer that makes a ZODB root available.

  - A combination of the minimal Zope 2 layer + basic ZODB layer, with a 
default user installed. This would be more or less like a vanilla Zope 2 
installation.

  - A Plone layer that configures the minimum possible to get a full 
Plone site. In particular, this should *not* auto-load site.zcml or all 
of Products.* or anything included with z3c.autoinclude's plugin 
mechanism. It also should not install any content or create any users. 
As far as possible, this should be isolated from the possibly-changing 
Plone default policies, e.g. it should use a well-defined (or not) 
workflow. This would probably also need before-test and after-test hooks 
so that we could do things like set the site hook.

  - A ZServer layer that starts up a ZServer for things like Selenium or 
Windmill testing. This would probably be used in combination with either 
the "vanilla" Zope 2 layer or the Plone site layer.

Helpers
-------

In addition, I think we should have collective.testcaselayer-style 
infrastructure for defining and adding layers, including some layer 
helpers for doing common things like adding users or installing 
products. I've made some suggestions below. These will obviously only 
make sense in some layers, and sometimes be more useful in tests than in 
layers (though I think they should be available in both).

  - Load the ZCML for a package

  - Install a Zope 2-style product (is that still necessary?) - no 
difference between "products" and "packages"!

  - Add a user to the root user folder

  - Add a user to the user folder in a Plone site.

  - Apply an extension profile (maybe easier to just use portal_setup 
directly)

  - Set roles for a user

  - Set a current authenticated user

  - Clear the current authenticated user

Setup
-----

Right now, there's a lot of confusion around how to properly create 
layers, how to register test suites (think ZopeDocFileSuite vs. 
DocFileSuite ), etc. I think we want a few basic patterns. This may be 
more about documentation that code, though.

  - Create a suite of all TestCase-style tests in a module 
(unittest.defaultTestLoader helps here)

  - Create a suite of all doctests in another module, with a layer (in 
one call)

  - Create a doctest with a layer (in one call)

  - ZODB sandboxing for functional tests. It needs to be quite clear 
where transaction rollback and other forms of sandboxing is happening. 
We have to support both the normal case, where transactions are rolled 
back for each test, and the more complex scenario where we have 
functional tests using things like testbrowser, Selenium, Windmill that 
execute several requests that may result in commits.

Okay, I think that's enough for now. I'm quite interested in helping 
with this effort (obviously), in particular around quality control - 
making sure the approaches are consistent, obvious and well documented 
enough to be useful. I'm also willing to help with code, although I 
think others (like Stefan and Ross) are better able to interpret the 
basic infrastructure.

We're all affected by this, and I'm sure that if we added up the time we 
all spend looking up code samples and hunting down poorly constrained 
tests, we could easily justify spending a bit of time making a better 
toolset for ourselves. :)

Martin

--

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Wichert Akkerman | 1 Mar 2010 14:45
Gravatar

Re: Towards a better testing infrastructure

On 3/1/10 14:13 , Martin Aspeli wrote:
> Hi,
>
> I've been talking to a few people on IRC about this over the past few
> days, but I wanted to put some of it down in writing, to see if there's
> any interest in people helping to take this forward.

I'ld very much welcome such an effort. I have no time to play a part in 
this myself though.

Wichert.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
robert rottermann | 1 Mar 2010 15:33
Picon
Favicon

Re: Towards a better testing infrastructure

Am 01.03.2010 14:13, schrieb Martin Aspeli:
> Hi,
> 
> I've been talking to a few people on IRC about this over the past few 
> days, but I wanted to put some of it down in writing, to see if there's 
> any interest in people helping to take this forward.
> 

I would love this.

robert

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Martin Aspeli | 1 Mar 2010 16:51
Picon

Re: Towards a better testing infrastructure

robert rottermann wrote:
> Am 01.03.2010 14:13, schrieb Martin Aspeli:
>> Hi,
>>
>> I've been talking to a few people on IRC about this over the past few
>> days, but I wanted to put some of it down in writing, to see if there's
>> any interest in people helping to take this forward.
>>
>
> I would love this.

To the point of contributing? :)

Martin

--

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
robert rottermann | 1 Mar 2010 17:04
Picon
Favicon

Re: Towards a better testing infrastructure

Am 01.03.2010 16:51, schrieb Martin Aspeli:
> robert rottermann wrote:
>   
>> Am 01.03.2010 14:13, schrieb Martin Aspeli:
>>     
>>> Hi,
>>>
>>> I've been talking to a few people on IRC about this over the past few
>>> days, but I wanted to put some of it down in writing, to see if there's
>>> any interest in people helping to take this forward.
>>>
>>>       
>> I would love this.
>>     
> To the point of contributing? :)
>
> Martin
>
>   
yes.
it is only that I need clear instructions what to do, as I did never dig
into the zope testing structure and have only a sketchy idea what a
layer or such things would be ..

robert

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Wichert Akkerman | 1 Mar 2010 17:06
Gravatar

Re: Towards a better testing infrastructure

On 3/1/10 17:04 , robert rottermann wrote:
> Am 01.03.2010 16:51, schrieb Martin Aspeli:
>> robert rottermann wrote:
>>
>>> Am 01.03.2010 14:13, schrieb Martin Aspeli:
>>>
>>>> Hi,
>>>>
>>>> I've been talking to a few people on IRC about this over the past few
>>>> days, but I wanted to put some of it down in writing, to see if there's
>>>> any interest in people helping to take this forward.
>>>>
>>>>
>>> I would love this.
>>>
>> To the point of contributing? :)
>>
>> Martin
>>
>>
> yes.
> it is only that I need clear instructions what to do, as I did never dig
> into the zope testing structure and have only a sketchy idea what a
> layer or such things would be ..

I suspect the main goal is to avoid most of the existing Zope testing 
infrastructure, so that may be a good quality to have :)

Wichert.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Patrick Gerken | 1 Mar 2010 18:28

Re: Towards a better testing infrastructure

On Mon, Mar 1, 2010 at 14:13, Martin Aspeli
<optilude+lists@...> wrote:
> I don't think we should try to "fix" ZTC/PTC, because the BBB
> implications would be heinous. Instead, I think we can create some new,
> simpler, better documented (!) test infrastructure. New packages can opt
> into this instead of using ZTC/PTC. Old packages will not need to move.
>
> I envisage us ending up with two packages: plone.testing, and
> plone.app.testing. The former would be a good test dependency for
> plone.* type packages, that do not depend on "Plone-the-application",
> and the latter for plone.app.* type packages, that do.
>
> The key to all this, I think, is layers. We should end up with a couple
> of useful base classes for tests, and then a set of well-defined,
> well-documented layers that people can use and extend for their own
> purposes.

Thats not an itch thats scratching me.

This is an open wound I would like to bandage, but don't know where
and how to start.

I am willing to contribute, reasonable amounts of time I will have
available in april.

Best regards,

         Patrick

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

Gmane