fix some stuff I broke
authorsalimfadhley <sal@stodge.org>
Wed, 12 Jun 2013 22:31:04 +0000 (23:31 +0100)
committersalimfadhley <sal@stodge.org>
Wed, 12 Jun 2013 22:31:04 +0000 (23:31 +0100)
jenkinsapi_tests/systests/__init__.py
jenkinsapi_tests/systests/test_parameterized_builds.py

index fb47609..52e4c9f 100644 (file)
@@ -1,13 +1,17 @@
 import os
 import time
 import shutil
+import logging
 import tempfile
 import subprocess
 
+log = logging.getLogger(__name__)
 
 class Timeout(RuntimeError):
     pass
 
+class FailedToLaunch(RuntimeError):
+    pass
 
 class JenkinsLauncher(object):
 
@@ -27,6 +31,7 @@ class JenkinsLauncher(object):
         '''
         Launches jenkins and waits while it's ready.
         '''
+        log.info("Atempting to launch Jenkins...")
         self.jenkins_home = tempfile.mkdtemp(prefix='jenkins-home-')
         os.environ['JENKINS_HOME'] = self.jenkins_home
         jenkins_command = 'java -jar jenkins.war'
@@ -36,6 +41,11 @@ class JenkinsLauncher(object):
         start_time = time.time()
         while time.time() - start_time < self.timeout:
             line = self.jenkins_process.stderr.readline().strip()
+            log.info('Jenkins: %s' % line)
+
+            if 'Winstone shutdown successfully' in line:
+                raise FailedToLaunch()
+
             if line == 'INFO: Jenkins is fully up and running':
                 return
         raise Timeout('Timeout error occured while waiting for Jenkins start.')
@@ -55,4 +65,4 @@ def setUpPackage():
 
 
 def tearDownPackage():
-    launcher.stop()
\ No newline at end of file
+    launcher.stop()
index 4009a09..48a0c2f 100644 (file)
@@ -71,9 +71,6 @@ class TestParameterizedBuilds(BaseSystemTest):
         artifacts = b.get_artifact_dict()
         self.assertIsInstance(artifacts, dict)
 
-        import ipdb
-        ipdb.set_trace()
-
         artB = artifacts['b.txt']
 
         self.assertTrue(artB.get_data().strip(), param_B)