Re: [Zope-dev] [PATCH] subunit output for zope.testing

2010-03-11 Thread Jonathan Lange
On Thu, Mar 11, 2010 at 9:17 PM, Marius Gedminas  wrote:
> On Thu, Mar 11, 2010 at 08:52:11PM +, Jonathan Lange wrote:
>> For a long time, I've wanted to have a subunit output formatter for
>> zope.testing. Subunit is a language-generic streaming protocol for
>> test results. Once a test runner can display subunit output, it
>> becomes much easier to write tools to process output programmatically.
>> We want to use it in the Launchpad project for analyzing test results
>> and for distributing our test runs across multiple machines. Other
>> projects use it to get Hudson integration, or to glue their
>> multi-language test suite into one result.
>
> I like this.
>

Thanks.

> Incidentally, how do you integrate it with Hudson?  subunit2junitxml, I
> assume?  How exactly do you combine bin/test with subunit2junitxml -- I
> assume some care with respect to exit codes?
>

I haven't tried myself, but from analogy with other subunit tools:
  ./bin/test --subunit | subunit2junitxml

The formatter doesn't control exit codes, so I didn't really think
about them in this patch. Should I produce a follow up?

>> === modified file 'src/zope/testing/testrunner/formatter.py'
>> --- src/zope/testing/testrunner/formatter.py  2009-12-23 21:21:53 +
>> +++ src/zope/testing/testrunner/formatter.py  2010-03-11 20:29:26 +
> ...
>> +    def __init__(self, options):
>> +        if subunit is None:
>> +            raise Exception("Requires subunit 0.0.4 or better")
>> +        if content is None:
>> +            raise Exception("Requires testtools XXX or better")
>
> This seems a mite imprecise (unless testtools uses roman numerals for
> version numbering).
>

Oops :) I've changed it to say 0.9.2, and subunit to say 0.0.5, which
is the actual version I've tested with.

>> === modified file 'src/zope/testing/testrunner/testrunner-leaks.txt'
>> --- src/zope/testing/testrunner/testrunner-leaks.txt  2008-05-05 18:50:48 
>> +
>> +++ src/zope/testing/testrunner/testrunner-leaks.txt  2010-02-20 22:23:32 
>> +
>> @@ -16,7 +16,7 @@
>>      >>> from zope.testing import testrunner
>>
>>      >>> sys.argv = 'test --layer Layer11$ --layer Layer12$ -N4 -r'.split()
>> -    >>> _ = testrunner.run(defaults)
>> +    >>> _ = testrunner.run_internal(defaults)
>
> I'm curious about this change.
>

Sidnei explained it correctly. This particular file is only tested if
you're running a Python with --with-pydebug set, so it's easy to miss
when you make a change.

jml
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [PATCH] subunit output for zope.testing

2010-03-11 Thread Sidnei da Silva
Hi Jonathan,

On Thu, Mar 11, 2010 at 5:52 PM, Jonathan Lange  wrote:
> Hello,
>
> For a long time, I've wanted to have a subunit output formatter for
> zope.testing. Subunit is a language-generic streaming protocol for
> test results. Once a test runner can display subunit output, it
> becomes much easier to write tools to process output programmatically.
> We want to use it in the Launchpad project for analyzing test results
> and for distributing our test runs across multiple machines. Other
> projects use it to get Hudson integration, or to glue their
> multi-language test suite into one result. More information on subunit
> can be found at http://launchpad.net/subunit.
>
> I've written a patch that adds subunit support to zope.testing by
> adding a new formatter object. The patch comes complete with tests and
> a willingness to jump through whatever legal hoops might be required
> to get it to land. The patch is attached, and can also be found as a
> merge proposal on Launchpad at
> https://code.edge.launchpad.net/~jml/zope.testing/subunit-output-formatter/+merge/19825
>
> I look forward to your replies.

The patch looks great to me, specially the testing coverage and the
fact it is completely optional to use subunit. Big +1 from me.

@Marius: re: run() vs run_internal(), the former would cause a
sys.exit() at some point, so run_internal() was added. I didn't spot
this change, but it looks fine to me.

I volunteer for commiting this patch and making a new major release,
if no one else volunteers.

-- Sidnei
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [PATCH] subunit output for zope.testing

2010-03-11 Thread Marius Gedminas
On Thu, Mar 11, 2010 at 08:52:11PM +, Jonathan Lange wrote:
> For a long time, I've wanted to have a subunit output formatter for
> zope.testing. Subunit is a language-generic streaming protocol for
> test results. Once a test runner can display subunit output, it
> becomes much easier to write tools to process output programmatically.
> We want to use it in the Launchpad project for analyzing test results
> and for distributing our test runs across multiple machines. Other
> projects use it to get Hudson integration, or to glue their
> multi-language test suite into one result.

I like this.

Incidentally, how do you integrate it with Hudson?  subunit2junitxml, I
assume?  How exactly do you combine bin/test with subunit2junitxml -- I
assume some care with respect to exit codes?

> === modified file 'src/zope/testing/testrunner/formatter.py'
> --- src/zope/testing/testrunner/formatter.py  2009-12-23 21:21:53 +
> +++ src/zope/testing/testrunner/formatter.py  2010-03-11 20:29:26 +
...
> +def __init__(self, options):
> +if subunit is None:
> +raise Exception("Requires subunit 0.0.4 or better")
> +if content is None:
> +raise Exception("Requires testtools XXX or better")

This seems a mite imprecise (unless testtools uses roman numerals for
version numbering).

> === modified file 'src/zope/testing/testrunner/testrunner-leaks.txt'
> --- src/zope/testing/testrunner/testrunner-leaks.txt  2008-05-05 18:50:48 
> +
> +++ src/zope/testing/testrunner/testrunner-leaks.txt  2010-02-20 22:23:32 
> +
> @@ -16,7 +16,7 @@
>  >>> from zope.testing import testrunner
>  
>  >>> sys.argv = 'test --layer Layer11$ --layer Layer12$ -N4 -r'.split()
> ->>> _ = testrunner.run(defaults)
> +>>> _ = testrunner.run_internal(defaults)

I'm curious about this change.

>  Running samplelayers.Layer11 tests:
>Set up samplelayers.Layer1 in 0.000 seconds.
>Set up samplelayers.Layer11 in 0.000 seconds.
> @@ -60,7 +60,7 @@
>  Let's look at an example test that leaks:
>  
>  >>> sys.argv = 'test --tests-pattern leak -N4 -r'.split()
> ->>> _ = testrunner.run(defaults)
> +>>> _ = testrunner.run_internal(defaults)
>  Running zope.testing.testrunner.layer.UnitTests tests:...
>  Iteration 1
>Ran 1 tests with 0 failures and 0 errors in 0.000 seconds.
> @@ -81,7 +81,7 @@
>  type (or class):
>  
>  >>> sys.argv = 'test --tests-pattern leak -N5 -r -v'.split()
> ->>> _ = testrunner.run(defaults)
> +>>> _ = testrunner.run_internal(defaults)
>  Running tests at level 1
>  Running zope.testing.testrunner.layer.UnitTests tests:...
>  Iteration 1

+1 for the rest.

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3 consulting and development


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Zope-Checkins] SVN: Zope/branches/tseaver-clarify_install_docs/doc/ Split out docs for 'normal' installation from those using 'zc.buildout'.

2010-03-11 Thread Chris Withers
Tres Seaver wrote:
>>> I recommend virtualenv to anybody who just wants to install and run the
>>> Zope2 appserver, without needing to drink a lot of "kool-aid":
>> How do you get them using the set of eggs specified in the appropriate 
>> versions.cfg using this recommendation?
> 
> You install from the index built from that same set of known good versions:
> 
>   $ /path/to/virtualenv --no-site-packages /tmp/z2123
>   $ /tmp/z2123/bin/easy_install \
> -i http://download.zope.org/Zope2/index/2.12.3/  Zope2
>   $ /tmp/z2123/bin/mkzopeinstance -d /tmp/instance -u admin:123
>   $ /tmp/instance/bin/zopectl fg

Right, and how how do I get my own packages into the mix, with specific, 
locked versions, in an easily reproducible fashion?

>>> The self-contained mode is likely *perfect* for developers who produce a
>>> highly-customized bundle o Zope, 3rd party software, and custom code.
>>> It just isn't right as the "first choice" for somebody installing Zope
>>> for the first time.
>> I fail to see why not. It's a simple 2 step recipe for them:
>>
>> - checkout
>> - run buildout
> 
> Checkiog Zope out from SVN is not part of an appropriate installation
> model for folks who are not interested in hackin on Zope itself.

Meh, by checkout, I really meant "write a buildout.cfg and put it in en 
empty directory with a copy of bootstrap.py". There's no need to check 
anything of svn, the eggs on PyPI are just fine...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Zope-Checkins] SVN: Zope/branches/tseaver-clarify_install_docs/doc/ Split out docs for 'normal' installation from those using 'zc.buildout'.

2010-03-11 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris Withers wrote:
> Tres Seaver wrote:
>> I recommend virtualenv to anybody who just wants to install and run the
>> Zope2 appserver, without needing to drink a lot of "kool-aid":
> 
> How do you get them using the set of eggs specified in the appropriate 
> versions.cfg using this recommendation?

You install from the index built from that same set of known good versions:

  $ /path/to/virtualenv --no-site-packages /tmp/z2123
  $ /tmp/z2123/bin/easy_install \
-i http://download.zope.org/Zope2/index/2.12.3/  Zope2
  $ /tmp/z2123/bin/mkzopeinstance -d /tmp/instance -u admin:123
  $ /tmp/instance/bin/zopectl fg


>> Activate is a completely unnecessary attractive nuisacne:  I *never* use
>> it, and I routinely see people who *do* use it end up running from
>> different environments than the ones they think they are running.
> 
> Right, so how do I avoid it? Is that in your new Zope 2 docs?

You just use the scripts in the 'bin' directory, as above.  Sourcing
'activate' pollutes your shell's environment for the dubious benefit of
saving a couple of keystrokes.

>> The self-contained mode is likely *perfect* for developers who produce a
>> highly-customized bundle o Zope, 3rd party software, and custom code.
>> It just isn't right as the "first choice" for somebody installing Zope
>> for the first time.
> 
> I fail to see why not. It's a simple 2 step recipe for them:
> 
> - checkout
> - run buildout

Checkiog Zope out from SVN is not part of an appropriate installation
model for folks who are not interested in hackin on Zope itself.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuZCRQACgkQ+gerLs4ltQ6qjQCdH0QLW73sU2XKufa2oThHtzqw
KxIAniIKtGyuc7svGfP/LiHF2NRsnyVV
=8hwt
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Optional C extensions

2010-03-11 Thread Lennart Regebro
On Thu, Mar 11, 2010 at 00:46, Jim Fulton  wrote:
> On Wed, Mar 10, 2010 at 7:17 AM, Tim Hoffman  wrote:
> ...
>> Unfortunately I needed deferredimport and was completely unsure how
>> else to proceed at the time.
>> I use code generation for gae based models, and the unfortunately
>> reference entities need actual models/classes which means you can very
>> easily create
>> cyclic dependancies.  Storm allows references to be defined "strings"
>> such as "model.MyClass"  but gae doesn't implement such a thing,
>> so deferredimport was the next best thing.
>
> I thought about this a bit and realized that I could implement
> deferred import without using proxies. I don't know why I didn't think
> of this before.
>
> Then I looked at the "Importing" project, which provides the
> peak.util.imports package:
>
>  http://peak.telecommunity.com/DevCenter/Importing
>
> This looks like a good alternative to zope.deferredimport.  Maybe we
> should deprecate zope.deferredimport in favor of Importing.  If there
> are interesting things that depend on zope.deferredimport that we
> don't want to update, we could reimplement zope.deferredimport using
> Importing.

+1 for Not Invented Here things.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Zope-Checkins] SVN: Zope/branches/tseaver-clarify_install_docs/doc/ Split out docs for 'normal' installation from those using 'zc.buildout'.

2010-03-11 Thread Chris Withers
Tres Seaver wrote:
> I recommend virtualenv to anybody who just wants to install and run the
> Zope2 appserver, without needing to drink a lot of "kool-aid":

How do you get them using the set of eggs specified in the appropriate 
versions.cfg using this recommendation?

> Activate is a completely unnecessary attractive nuisacne:  I *never* use
> it, and I routinely see people who *do* use it end up running from
> different environments than the ones they think they are running.

Right, so how do I avoid it? Is that in your new Zope 2 docs?

> The self-contained mode is likely *perfect* for developers who produce a
> highly-customized bundle o Zope, 3rd party software, and custom code.
> It just isn't right as the "first choice" for somebody installing Zope
> for the first time.

I fail to see why not. It's a simple 2 step recipe for them:

- checkout
- run buildout

I was even going to wrap this up into a zope2instance.py script, but I 
ran out of time...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Zope-Checkins] SVN: Zope/branches/tseaver-clarify_install_docs/doc/ Split out docs for 'normal' installation from those using 'zc.buildout'.

2010-03-11 Thread Chris Withers
yuppie wrote:
> Hi Chris!
> 
> 
> Chris Withers wrote:
>> yuppie wrote:
>>> I consider the self-contained scenario still as experimental.
>> You might, I don't. I've deployed this happily in production with a few
>> customer now.
>>
>> Just because you don't happen to like it yourself, please don't belittle
>> it...
> 
> I didn't mean to belittle it. 'experimental' is nothing negative. I'm 
> happy people like you are working on and with this approach.

There's no "working on", it's done, dusted and in production...

> But IMHO some details like the role of the annotated config file or if a 
> paster template would make things easier are not yet fleshed out enough 
> to make it *the* recommended scenario.

Bull. It's fine as it is, this 'death by feature request' is rediculous...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Zope-Checkins] SVN: Zope/branches/tseaver-clarify_install_docs/doc/ Split out docs for 'normal' installation from those using 'zc.buildout'.

2010-03-11 Thread Chris Withers
Marius Gedminas wrote:
> That is a curious observation.  I find it much easier to understand what
> virtualenv does and how it does it: the underlying model is simpler. 

How do I go from a checkout to a working system in virtualenv?
How do I lock down to particular versions with virtualenv?
Maybe that's the missing link for me... can you help me?

> Actually, now that I think about it more, a buildout would have one
> advantage over virtualenv: with a fixed versions.cfg your Zope 2
> installs won't start failing when somebody uploads a
> new-improved-and-incompatible version of zope.component into PyPI.

Right. This is a pretty crucial thing when it comes to Zope 2 and it's 
veritable constellation of eggs...

>> Yes, I'm much more for the latter, but when I tried to make that "the 
>> only way", someone whined, so I tried to stay neutral...
> 
> There will always be people who whine :(

Yes, but Yuppie whines even louder than I do...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Zope-Checkins] SVN: Zope/branches/2.12/doc/ Merge 'tseaver-clarify_install_docs' branch.

2010-03-11 Thread Chris Withers
Tres Seaver wrote:
>> That'll teach me to put any effort into helping with documentation and 
>> packaging...
> 
> I didn't take out the buildout docs, I just separated them out from the
> ones using virtualenv (mixing them up was hugely confusing for people).

Yeah, 'cos we all agreed that virtualenv was the one right way forward - 
Not!

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Zope-Checkins] SVN: Zope/branches/2.12/doc/ Merge 'tseaver-clarify_install_docs' branch.

2010-03-11 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris Withers wrote:
> Tres Seaver wrote:
>> Log message for revision 109858:
>>   Merge 'tseaver-clarify_install_docs' branch.
> 
> Thanks for waiting until there was consensus on this :-(

I waited a week to merge the branch.

> That'll teach me to put any effort into helping with documentation and 
> packaging...

I didn't take out the buildout docs, I just separated them out from the
ones using virtualenv (mixing them up was hugely confusing for people).



Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuY9eAACgkQ+gerLs4ltQ5E/gCeIAKHTHl0eEI7KxL1d9hhENd7
tOIAoJRyHfbFs3JfW8QBpTPaDJS7Nc7+
=H14P
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Zope Tests: 6 OK

2010-03-11 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Wed Mar 10 12:00:00 2010 UTC to Thu Mar 11 12:00:00 2010 UTC.
There were 6 messages: 6 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Mar 10 20:37:05 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-March/013714.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Mar 10 20:39:05 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-March/013715.html

Subject: OK : Zope-2.12 Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Mar 10 20:41:05 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-March/013716.html

Subject: OK : Zope-2.12-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Mar 10 20:43:05 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-March/013717.html

Subject: OK : Zope-trunk Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Mar 10 20:45:05 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-March/013718.html

Subject: OK : Zope-trunk-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Mar 10 20:47:05 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-March/013719.html

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )