Author: gotcha
Date: Sun Feb 18 21:44:20 2007
New Revision: 39187

Modified:
   kukit/kss.buildout/trunk/buildout.cfg
   kukit/kss.buildout/trunk/dotests_win.py
Log:
setup elementtree egg, selenium tests creation in windows

Modified: kukit/kss.buildout/trunk/buildout.cfg
==============================================================================
--- kukit/kss.buildout/trunk/buildout.cfg       (original)
+++ kukit/kss.buildout/trunk/buildout.cfg       Sun Feb 18 21:44:20 2007
@@ -1,5 +1,4 @@
 [buildout]
-
 parts =
     javaversion
     seleniumrc
@@ -41,7 +40,10 @@
 
 [ksspy]
 recipe = zc.recipe.egg
-eggs = ${instance:eggs}
+eggs = 
+    ${instance:eggs}
+    elementtree
+
 interpreter = ksspy
 extra-paths = ${zope2:location}/lib/python
 scripts = ksspy

Modified: kukit/kss.buildout/trunk/dotests_win.py
==============================================================================
--- kukit/kss.buildout/trunk/dotests_win.py     (original)
+++ kukit/kss.buildout/trunk/dotests_win.py     Sun Feb 18 21:44:20 2007
@@ -36,12 +36,14 @@
         self.wget = "c:\\cygwin\\bin\\wget.exe"
         self.cmd = "cmd.exe"
         self.zope = os.path.join(self.here, 'bin', 'instance.exe')
+        self.instancehome = os.path.join(self.here, 'parts', 'instance')
 
     def process(self):
         self.startSeleniumRC()
         self.startZope()
         self.waitForZope()
         self.setupKSSDemoInstance()
+        self.createSeleniumTests()
         testExit = self.runTests()
         self.stopZope()
         self.stopSeleniumRC()
@@ -89,19 +91,36 @@
         exitcode = subprocess.call(command)
         if exitcode == 0:
             print "zope shutting down"
-    
+
+    def createSeleniumTests(self):
+        kssdemotests = os.path.join(self.here, 'src', 'kss.demo', 'kss', 
'demo', 'tests')
+        ksspy = os.path.join(self.here, 'bin', 'ksspy')
+        creationDir = os.path.join(kssdemotests, 'selenium_tests')
+        creationScript = os.path.join(creationDir, 'createpythontests.py')
+        command = " ".join([ksspy, creationScript])
+        os.chdir(creationDir)
+        exitcode = subprocess.call(command.split())
+        print "creation exit code", exitcode
+        os.chdir(self.here) 
     
     def runTests(self):
         environ = os.environ
         environ['SELENIUMBROWSER'] = self.seleniumbrowser 
         testsPath = os.path.join(self.here, 'src', 'kss.demo', 'kss', 'demo', 
'tests')
         zope_test = os.path.join(self.here, 'parts', 'instance', 'bin', 
'test.bat')
-        command = " ".join([self.cmd, "/C", zope_test, "test",
+        command = " ".join([zope_test, "test",
             '--package-path', testsPath,
             'kss.demo.tests', '--test-file-pattern=^seltest',
             '--tests-pattern=selenium_tests'])
         print command
-        exitcode = subprocess.call(command, env=environ)
+        dummy = subprocess.call(command, env=environ)
+        exitcodefile = os.path.join(self.instancehome, 'testsexitcode.err')
+        if '"0"' in open(exitcodefile).read():
+            exitcode = 0
+        else:
+            exitcode = 1
+        
+        print 'tests exitcode', exitcode
         return exitcode
 
     def stopSeleniumRC(self):
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to