[Zope-dev] Re: Zope Test Summaries 2006-04-05

Tres Seaver tseaver at palladion.com
Thu Apr 6 18:04:11 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Winkler wrote:
> On Thu, Apr 06, 2006 at 12:06:25PM -0400, Paul Winkler wrote:
> 
>>On Thu, Apr 06, 2006 at 10:45:11AM +0200, Stefan H. Holek wrote:
>>
>>>The VHM tests in Zope 2.9 and trunk broke last night:
>>>
>>>http://mail.zope.org/pipermail/zope-tests/2006-April/004648.html
>>>http://mail.zope.org/pipermail/zope-tests/2006-April/004649.html
>>
>>I'm assuming this was me, but I ran test.py -q -all before checking in
>>so I'm not sure how that happened. Investigating.
> 
> 
> Must've run the tests in the wrong sandbox :-\
> 
> This failure was a side-effect of the changes I made:
> 
> - The unit tests in Products/Session were polluting os.environ
>   with SERVER_NAME and SERVER_PORT keys.
> 
> - The unit tests in Products/SiteAccess were relying on the old
>   behavior of Testing.makerequest to unconditionally set those
>   keys in the request.
> 
> - My change allowed the values from the Sessions tests to show up
>   in the SiteAccess tests.
> 
> I've fixed the Sessions tests to use a dict instead of os.environ.
> 
> But I'm also concerned that similarly indirect breakage might happen
> in other projects if they use os.environ carelessly.
> 
> This part of my change was an effort to remove redundancy,
> not a bugfix; so on second thought, given the demonstrated
> potential for breakage in other test suites, it doesn't
> belong on the stable 2.9 branch and I'll revert that change there.
> But I'll leave it on the trunk.

+1 for getting rid of *anything* in Testing which does something as
Utterly Evil (tm) as scribbling on 'os.environ'.

Any tests which break on that account should be fixed, not covered over.
 You don't risk breaking production code, only tests, and those *need*
to be fixed, even when running against the "stable" tree (I would even
think backporting to 2.8 was worthwhile, just for the  testing bugs it
would expose).


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFENZBb+gerLs4ltQ4RAntpAJ9iRnL8zZPMtaNGrQrKxAhxD7L7JgCgmC3O
K/mIjFr++qV6xpo2L+x60vg=
=1xn+
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list