bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwmon...@apache.org
Subject [1/2] bigtop git commit: BIGTOP-2712: Juju CI driven updates (closes #189)
Date Tue, 28 Mar 2017 04:19:06 GMT
Repository: bigtop
Updated Branches:
  refs/heads/master 895ecd5de -> 4a24c4bd9


http://git-wip-us.apache.org/repos/asf/bigtop/blob/4a24c4bd/bigtop-packages/src/charm/mahout/layer-mahout/reactive/mahout.py
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/charm/mahout/layer-mahout/reactive/mahout.py b/bigtop-packages/src/charm/mahout/layer-mahout/reactive/mahout.py
index e8e68ca..d6f3b4b 100644
--- a/bigtop-packages/src/charm/mahout/layer-mahout/reactive/mahout.py
+++ b/bigtop-packages/src/charm/mahout/layer-mahout/reactive/mahout.py
@@ -15,7 +15,7 @@
 
 from jujubigdata import utils
 from charms.reactive import when, when_not, set_state
-from charms.layer.apache_bigtop_base import Bigtop
+from charms.layer.apache_bigtop_base import Bigtop, get_package_version
 from charmhelpers.core import hookenv
 
 
@@ -33,5 +33,8 @@ def install_mahout():
     with utils.environment_edit_in_place('/etc/environment') as env:
         env['MAHOUT_HOME'] = '/usr/lib/mahout'
 
-    hookenv.status_set('active', 'ready')
     set_state('mahout.installed')
+    hookenv.status_set('active', 'ready')
+    # set app version string for juju status output
+    mahout_version = get_package_version('mahout') or 'unknown'
+    hookenv.application_version_set(mahout_version)

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4a24c4bd/bigtop-packages/src/charm/pig/layer-pig/tests/01-deploy.py
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/charm/pig/layer-pig/tests/01-deploy.py b/bigtop-packages/src/charm/pig/layer-pig/tests/01-deploy.py
index c24617d..53364c1 100755
--- a/bigtop-packages/src/charm/pig/layer-pig/tests/01-deploy.py
+++ b/bigtop-packages/src/charm/pig/layer-pig/tests/01-deploy.py
@@ -27,7 +27,7 @@ class TestDeploy(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
         cls.d = amulet.Deployment(series='xenial')
-        cls.d.add('pig', 'pig')
+        cls.d.add('pig', 'cs:xenial/pig')
 
         cls.d.setup(timeout=1800)
         cls.d.sentry.wait_for_messages({'pig': re.compile('ready')}, timeout=1800)

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4a24c4bd/bigtop-packages/src/charm/spark/layer-spark/tests/03-scale-standalone.py
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/charm/spark/layer-spark/tests/03-scale-standalone.py b/bigtop-packages/src/charm/spark/layer-spark/tests/03-scale-standalone.py
index 7d8f4cd..33479f3 100755
--- a/bigtop-packages/src/charm/spark/layer-spark/tests/03-scale-standalone.py
+++ b/bigtop-packages/src/charm/spark/layer-spark/tests/03-scale-standalone.py
@@ -31,10 +31,17 @@ class TestScaleStandalone(unittest.TestCase):
         cls.d.setup(timeout=3600)
         cls.d.sentry.wait(timeout=3600)
 
-    # Disable tearDown until amulet supports it
-    # @classmethod
-    # def tearDownClass(cls):
-    #     cls.d.remove_service('spark-test-scale')
+    @classmethod
+    def tearDownClass(cls):
+        # NB: seems to be a remove_service issue with amulet. However, the
+        # unit does still get removed. Pass OSError for now:
+        #  OSError: juju command failed ['remove-application', 'zk-test']:
+        #  ERROR allocation for service ...zk-test... owned by ... not found
+        try:
+            cls.d.remove_service('spark-test-scale')
+        except OSError as e:
+            print("IGNORE: Amulet remove_service failed: {}".format(e))
+            pass
 
     def test_scaleup(self):
         """

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4a24c4bd/bigtop-packages/src/charm/spark/layer-spark/tests/10-test-ha.py
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/charm/spark/layer-spark/tests/10-test-ha.py b/bigtop-packages/src/charm/spark/layer-spark/tests/10-test-ha.py
index f8a09a6..99c604f 100755
--- a/bigtop-packages/src/charm/spark/layer-spark/tests/10-test-ha.py
+++ b/bigtop-packages/src/charm/spark/layer-spark/tests/10-test-ha.py
@@ -30,15 +30,24 @@ class TestDeployment(unittest.TestCase):
         cls.d = amulet.Deployment(series='xenial')
         cls.d.add('spark-test-ha', 'cs:xenial/spark', units=3)
         cls.d.add('zk-test', 'cs:xenial/zookeeper')
+
         cls.d.relate('zk-test:zookeeper', 'spark-test-ha:zookeeper')
         cls.d.expose('spark-test-ha')
+
         cls.d.setup(timeout=3600)
         cls.d.sentry.wait(timeout=3600)
 
-    # Disable tearDown until amulet supports it
-    # @classmethod
-    # def tearDownClass(cls):
-    #     cls.d.remove_service('spark-test-ha')
+    @classmethod
+    def tearDownClass(cls):
+        # NB: seems to be a remove_service issue with amulet. However, the
+        # unit does still get removed. Pass OSError for now:
+        #  OSError: juju command failed ['remove-application', 'zk-test']:
+        #  ERROR allocation for service ...zk-test... owned by ... not found
+        try:
+            cls.d.remove_service('spark-test-ha', 'zk-test')
+        except OSError as e:
+            print("IGNORE: Amulet remove_service failed: {}".format(e))
+            pass
 
     def test_master_selected(self):
         """

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4a24c4bd/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/01-deploy-smoke.py
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/01-deploy-smoke.py
b/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/01-deploy-smoke.py
index 1ef64d8..f9a008a 100755
--- a/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/01-deploy-smoke.py
+++ b/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/01-deploy-smoke.py
@@ -16,10 +16,9 @@
 # limitations under the License.
 
 import amulet
+import re
 import unittest
 
-TIMEOUT = 1800
-
 
 class TestDeploy(unittest.TestCase):
     """
@@ -30,11 +29,11 @@ class TestDeploy(unittest.TestCase):
     def setUpClass(cls):
         cls.d = amulet.Deployment(series='xenial')
 
-        cls.d.add('zookeeper', charm='zookeeper', units=3)
+        cls.d.add('zookeeper', charm='cs:xenial/zookeeper', units=3)
 
-        cls.d.setup(timeout=TIMEOUT)
-        cls.d.sentry.wait_for_messages({'zookeeper': 'ready (3 units)'},
-                                       timeout=TIMEOUT)
+        cls.d.setup(timeout=1800)
+        cls.d.sentry.wait_for_messages({'zookeeper': re.compile('ready')},
+                                       timeout=1800)
         cls.unit = cls.d.sentry['zookeeper'][0]
 
     def test_deploy(self):

http://git-wip-us.apache.org/repos/asf/bigtop/blob/4a24c4bd/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/10-bind-address.py
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/10-bind-address.py
b/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/10-bind-address.py
index 8fa2bb7..17ef3a2 100755
--- a/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/10-bind-address.py
+++ b/bigtop-packages/src/charm/zookeeper/layer-zookeeper/tests/10-bind-address.py
@@ -28,18 +28,29 @@ class TestBindClientPort(unittest.TestCase):
     Test to verify that we can bind to listen for client connections
     on a specific interface.
     """
-
     @classmethod
     def setUpClass(cls):
         cls.d = amulet.Deployment(series='xenial')
 
-        cls.d.add('zk-test', charm='zookeeper')
+        cls.d.add('zk-test', charm='cs:xenial/zookeeper')
 
         cls.d.setup(timeout=TIMEOUT)
-        cls.d.sentry.wait_for_messages({'zk-test': re.compile('ready')},
+        cls.d.sentry.wait_for_messages({'zk-test': re.compile('^ready')},
                                        timeout=TIMEOUT)
         cls.unit = cls.d.sentry['zk-test'][0]
 
+    @classmethod
+    def tearDownClass(cls):
+        # NB: seems to be a remove_service issue with amulet. However, the
+        # unit does still get removed. Pass OSError for now:
+        #  OSError: juju command failed ['remove-application', 'zk-test']:
+        #  ERROR allocation for service ...zk-test... owned by ... not found
+        try:
+            cls.d.remove_service('zk-test')
+        except OSError as e:
+            print("IGNORE: Amulet remove_service failed: {}".format(e))
+            pass
+
     def test_bind_port(self):
         """
         Verify that we update client port bindings successfully.
@@ -73,13 +84,15 @@ class TestBindClientPort(unittest.TestCase):
             "^clientPortAddress=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}.*")
         self.assertTrue(matcher.match(ret))
 
-        # Verify that smoke tests still run
+        # Verify that smoke tests still run and the unit returns to 'ready'
         smk_uuid = self.unit.run_action('smoke-test')
         # 'zookeeper' smoke takes a while (bigtop tests are slow)
         result = self.d.action_fetch(smk_uuid, timeout=1800, full_output=True)
         # actions set status=completed on success
         if (result['status'] != "completed"):
             self.fail('Zookeeper smoke-test failed: %s' % result)
+        self.d.sentry.wait_for_messages({'zk-test': re.compile('^ready')},
+                                        timeout=TIMEOUT)
 
     def test_reset_bindings(self):
         """
@@ -96,13 +109,15 @@ class TestBindClientPort(unittest.TestCase):
         matcher = re.compile("^clientPortAddress=0\.0\.0\.0.*")
         self.assertTrue(matcher.match(ret))
 
-        # Verify that smoke tests still run
+        # Verify that smoke tests still run and the unit returns to 'ready'
         smk_uuid = self.unit.run_action('smoke-test')
         # 'zookeeper' smoke takes a while (bigtop tests are slow)
         result = self.d.action_fetch(smk_uuid, timeout=1800, full_output=True)
         # actions set status=completed on success
         if (result['status'] != "completed"):
             self.fail('Zookeeper smoke-test failed: %s' % result)
+        self.d.sentry.wait_for_messages({'zk-test': re.compile('^ready')},
+                                        timeout=TIMEOUT)
 
 
 if __name__ == '__main__':


Mime
View raw message