Sorry Florent, I missed your warning mail.
I have two issues with the patch:
a) Trailing slash no longer works (--libdir Products/) b) Some combinations of --libdir and --dir and symlinks no longer work on Mac OS X (HFS)
Unfortunately os.getcwd() returns different paths in the presence of symlinks on Mac and Linux (already realpath'd vs not). I don't have a good solution for this either. You have a Mac haven't you? Does it work for you across all platforms?
Thanks, Stefan
On 19. Nov 2004, at 14:49, Florent Guillaume wrote:
Update of /cvs-repository/Zope In directory cvs.zope.org:/tmp/cvs-serv20719
Modified Files: Tag: Zope-2_7-branch test.py Log Message: Fixed to work in the presence of symliked products or Products directory.
=== Zope/test.py 1.2.2.15 => 1.2.2.16 === --- Zope/test.py:1.2.2.15 Sat Oct 30 04:29:22 2004 +++ Zope/test.py Fri Nov 19 08:48:59 2004 @@ -380,11 +380,12 @@ self.cwd = os.path.realpath(os.getcwd()) # Hack again for external products. if libdir:
self.libdir = os.path.realpath(os.path.join(self.cwd,
libdir))
self.libdir = os.path.join(self.cwd, libdir) else:
self.libdir = os.path.realpath(os.path.join(self.cwd,
self.libdir))
if self.libdir not in sys.path:
sys.path.insert(0, self.libdir)
self.libdir = os.path.join(self.cwd, self.libdir)
real_libdir = os.path.realpath(self.libdir)
if real_libdir not in sys.path:
sys.path.insert(0, real_libdir) # Determine where to look for tests if test_dir: self.testdir = os.path.abspath(os.path.join(self.cwd,
test_dir))
Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/
Stefan H. Holek wrote:
Sorry Florent, I missed your warning mail.
I have two issues with the patch:
a) Trailing slash no longer works (--libdir Products/)
This is probably fixable by an explicit test.
b) Some combinations of --libdir and --dir and symlinks no longer work on Mac OS X (HFS)
Could you give detail so I can reproduce it ?
Unfortunately os.getcwd() returns different paths in the presence of symlinks on Mac and Linux (already realpath'd vs not). I don't have a good solution for this either.
You have a Mac haven't you? Does it work for you across all platforms?
The tests I did worked, but I may not have fully tested the symlinks problems (I had them and fixed them on Linux).
My Mac is at home, I'll test tonight.
Florent
Thanks, Stefan
On 19. Nov 2004, at 14:49, Florent Guillaume wrote:
Update of /cvs-repository/Zope In directory cvs.zope.org:/tmp/cvs-serv20719
Modified Files: Tag: Zope-2_7-branch test.py Log Message: Fixed to work in the presence of symliked products or Products directory.
=== Zope/test.py 1.2.2.15 => 1.2.2.16 === --- Zope/test.py:1.2.2.15 Sat Oct 30 04:29:22 2004 +++ Zope/test.py Fri Nov 19 08:48:59 2004 @@ -380,11 +380,12 @@ self.cwd = os.path.realpath(os.getcwd()) # Hack again for external products. if libdir:
self.libdir = os.path.realpath(os.path.join(self.cwd,
libdir))
self.libdir = os.path.join(self.cwd, libdir) else:
self.libdir = os.path.realpath(os.path.join(self.cwd,
self.libdir))
if self.libdir not in sys.path:
sys.path.insert(0, self.libdir)
self.libdir = os.path.join(self.cwd, self.libdir)
real_libdir = os.path.realpath(self.libdir)
if real_libdir not in sys.path:
sys.path.insert(0, real_libdir) # Determine where to look for tests if test_dir: self.testdir = os.path.abspath(os.path.join(self.cwd,
test_dir))
Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/
This one does not even need symlinks (note that I run the tests from Products):
localhost:/Users/zope/plone27/Products$ \
/Zope/bin/test.py -v -C ../etc/zope.conf --libdir . --dir CMFPlone
Running unit tests at level 1 Running unit tests from /Users/zope/plone27/Products/CMFPlone Parsing /Users/zope/plone27/etc/zope.conf
---------------------------------------------------------------------- Ran 0 tests in 0.000s
OK
I think you may at least want to abspath the libdir. Also, it seems that TestFileFinder uses libdir whereas you add real_libdir to the sys.path...
Stefan
On 22. Nov 2004, at 18:32, Florent Guillaume wrote:
b) Some combinations of --libdir and --dir and symlinks no longer work on Mac OS X (HFS)
Could you give detail so I can reproduce it ?
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/