[Checkins] SVN: z3c.recipe.kgstest/trunk/s - cleaned up include/exclude even more

Wolfgang Schnerring wosc at wosc.de
Wed Jan 28 04:00:53 EST 2009


Log message for revision 95279:
   - cleaned up include/exclude even more
   - instantiate testrunner recipe
  

Changed:
  U   z3c.recipe.kgstest/trunk/setup.py
  U   z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/README.txt
  U   z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/recipe.py
  U   z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/tests.py

-=-
Modified: z3c.recipe.kgstest/trunk/setup.py
===================================================================
--- z3c.recipe.kgstest/trunk/setup.py	2009-01-28 08:16:54 UTC (rev 95278)
+++ z3c.recipe.kgstest/trunk/setup.py	2009-01-28 09:00:53 UTC (rev 95279)
@@ -23,7 +23,11 @@
       install_requires=[
           'setuptools',
           'zc.buildout',
+          'zc.recipe.testrunner',
           ],
+      extras_require=dict(test=[
+            'zope.dottedname',
+          ]),
       entry_points = {
           'zc.buildout': ['default = z3c.recipe.kgstest.recipe:Recipe'],
           },

Modified: z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/README.txt
===================================================================
--- z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/README.txt	2009-01-28 08:16:54 UTC (rev 95278)
+++ z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/README.txt	2009-01-28 09:00:53 UTC (rev 95279)
@@ -12,8 +12,10 @@
 ... exclude = .*
 ... include = zope.dottedname
 ... """)
->>> print system(buildout)
-Installing kgstest.
+>>> system(buildout).find('Installing kgstest') != -1
+True
 >>> ls('bin')
 - buildout
 - kgstest-zope.dottedname
+>>> cat('bin', 'kgstest-zope.dottedname')
+#!/...python...

Modified: z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/recipe.py
===================================================================
--- z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/recipe.py	2009-01-28 08:16:54 UTC (rev 95278)
+++ z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/recipe.py	2009-01-28 09:00:53 UTC (rev 95279)
@@ -1,6 +1,7 @@
 import os
 import popen2
 import re
+import zc.recipe.testrunner
 
 
 EXCLUDE = ['zope.agxassociation', 'zope.app.css', 'zope.app.demo', \
@@ -13,8 +14,8 @@
            'zope.release', 'zope.pytz', 'zope.timestamp', \
            'zope.tutorial', 'zope.ucol', 'zope.weakset', \
            'zope.webdev', 'zope.xmlpickle', 'zope.app.boston',]
+INCLUDE = ['zope.*', 'grokcore.*']
 
-
 def string2list(string, default):
     result = string and string.split('\n') or default
     return [item.strip() for item in result]
@@ -29,15 +30,18 @@
         self.svn_url = self.options.get('svn_url',
                                         'svn://svn.zope.org/repos/main/')
         self.exclude = string2list(self.options.get('exclude', ''), EXCLUDE)
-        self.include = string2list(self.options.get('include', ''), [])
+        self.include = string2list(self.options.get('include', ''), INCLUDE)
 
     def install(self):
+        self.update()
+
+    def update(self):
         files = []
         for project in self._wanted_projects():
-            testrunner = os.path.join(self.buildout['buildout']['bin-directory'],
-                                      'kgstest-%s' % project)
-            open(testrunner, 'w').write('foo')
-            files.append(testrunner)
+            options = dict(eggs=project)
+            recipe = zc.recipe.testrunner.TestRunner(
+                self.buildout, '%s-%s' % (self.name, project), options)
+            files.extend(recipe.install())
         return files
 
     def _wanted_projects(self):
@@ -54,12 +58,6 @@
                 if re.compile(regex).search(project):
                     skip = False
                     break
-            if skip:
-                continue
-            parts = project.split('.')
-            if parts[0] in ('zope', 'grokcore', ):
+            if not skip:
                 projects.append(project)
         return projects
-
-    def update(self):
-        return []

Modified: z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/tests.py
===================================================================
--- z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/tests.py	2009-01-28 08:16:54 UTC (rev 95278)
+++ z3c.recipe.kgstest/trunk/src/z3c/recipe/kgstest/tests.py	2009-01-28 09:00:53 UTC (rev 95279)
@@ -7,7 +7,15 @@
     zc.buildout.testing.buildoutSetUp(test)
     zc.buildout.testing.install_develop('z3c.recipe.kgstest', test)
 
+    # need to explicitly name our dependencies for the buildout test environment
+    zc.buildout.testing.install('zc.recipe.testrunner', test)
+    zc.buildout.testing.install('zc.recipe.egg', test)
+    zc.buildout.testing.install('zope.testing', test)
+    zc.buildout.testing.install('zope.interface', test)
 
+    zc.buildout.testing.install('zope.dottedname', test)
+
+
 def tearDown(test):
     zc.buildout.testing.buildoutTearDown(test)
 



More information about the Checkins mailing list