Jelajahi Sumber

Temporary fix for travis build hang

nuwan_ag 10 tahun lalu
induk
melakukan
2f285b4365
2 mengubah file dengan 13 tambahan dan 1 penghapusan
  1. 11 0
      cloudbridge/__init__.py
  2. 2 1
      test/__init__.py

+ 11 - 0
cloudbridge/__init__.py

@@ -0,0 +1,11 @@
+import logging
+import sys
+
+
+def init_logging():
+    """
+    Temporary workaround for build timeouts by enabling logging to
+    stdout so that travis doesn't think the build has hung.
+    """
+    logging.basicConfig(stream=sys.stdout)
+    logging.getLogger(__name__).setLevel(logging.DEBUG)

+ 2 - 1
test/__init__.py

@@ -25,7 +25,7 @@ discovered through the ``ProviderFactory``. Test Cases must not inherit from
 discovery. (The test generator will automatically add ``unittest.TestCase``
 as a base class to each combination).
 """
-
+import cloudbridge
 from test.helpers import ProviderTestCaseGenerator
 from test.test_compute_service import ProviderComputeServiceTestCase
 from test.test_provider_image_service import ProviderImageServiceTestCase
@@ -46,4 +46,5 @@ def load_tests(loader=None, tests=None, pattern=None):
     This function is required to aid the load_tests protocol
     (https://docs.python.org/2/library/unittest.html#load-tests-protocol)
     """
+    cloudbridge.init_logging()
     return ProviderTestCaseGenerator(PROVIDER_TESTS).generate_tests()