Преглед изворни кода

HUE-2902 [tests] Skip non re-entrant tests when live cluster testing for now

Erick Tryzelaar пре 10 година
родитељ
комит
43f7f29

+ 3 - 0
apps/beeswax/src/beeswax/tests.py

@@ -753,6 +753,9 @@ for x in sys.stdin:
 
 
   def test_designs(self):
+    if is_live_cluster():
+      raise SkipTests('HUE-2902: Skipping because test is not reentrant')
+
     cli = self.client
 
     # An auto hql design should be created, and it should ignore the given name and desc

+ 4 - 1
apps/hbase/src/hbase/tests.py

@@ -173,7 +173,7 @@ class TestIntegrationWithHBase:
   def setup_class(cls):
 
     if not is_live_cluster():
-      raise SkipTest()
+      raise SkipTest('These tests can only run on a live cluster')
 
     cls.client = make_logged_in_client(username='test', is_superuser=False)
     cls.user = User.objects.get(username='test')
@@ -182,6 +182,9 @@ class TestIntegrationWithHBase:
 
 
   def test_list_tables(self):
+    if not is_live_cluster():
+      raise SkipTest('HUE-2910: Skipping because test is not reentrant')
+
     resp = self.client.post('/hbase/api/getTableList/Cluster')
     content = json.loads(resp.content)
 

+ 5 - 0
apps/jobbrowser/src/jobbrowser/tests.py

@@ -31,6 +31,7 @@ from desktop.lib.test_utils import grant_access, add_to_group
 from desktop.models import Document
 from hadoop import cluster
 from hadoop.conf import YARN_CLUSTERS
+from hadoop.pseudo_hdfs4 import is_live_cluster
 from hadoop.yarn import resource_manager_api, mapreduce_api, history_server_api
 from liboozie.oozie_api_tests import OozieServerProvider
 from oozie.models import Workflow
@@ -174,6 +175,10 @@ class TestJobBrowserWithHadoop(unittest.TestCase, OozieServerProvider):
     """
     Test jobs with genuine failure, not just killed
     """
+
+    if is_live_cluster():
+      raise SkipTest('HUE-2902: Skipping because test is not reentrant')
+
     # Create design that will fail because the script file isn't there
     INPUT_DIR = TestJobBrowserWithHadoop.home_dir + '/input'
     OUTPUT_DIR = TestJobBrowserWithHadoop.home_dir + '/output'

+ 30 - 0
apps/metastore/src/metastore/tests.py

@@ -19,6 +19,7 @@
 import logging
 import urllib
 
+from nose.plugins.skip import SkipTest
 from nose.tools import assert_true, assert_equal, assert_false
 
 from django.utils.encoding import smart_str
@@ -68,6 +69,9 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     add_permission("test", "test", "write", "metastore")
 
   def test_basic_flow(self):
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     # Default database should exist
     response = self.client.get("/metastore/databases")
     assert_true(self.db_name in response.context["databases"])
@@ -103,6 +107,9 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     assert_equal(verify_history(self.client, fragment='test'), history_cnt, 'Implicit queries should not be saved in the history')
 
   def test_describe_view(self):
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     resp = self.client.get('/metastore/table/%s/myview' % self.db_name)
     assert_equal(None, resp.context['sample'])
     assert_true(resp.context['table'].is_view)
@@ -113,6 +120,9 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     assert_true("myview" in resp.content)
 
   def test_describe_partitions(self):
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     response = self.client.get("/metastore/table/%s/test_partitions" % self.db_name)
     assert_true("Show Partitions (2)" in response.content, response.content)
 
@@ -131,6 +141,9 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     assert_true("is not partitioned." in response.content)
 
   def test_describe_partitioned_table_with_limit(self):
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     # Limit to 90
     finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("90")
     try:
@@ -141,6 +154,9 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
       finish()
 
   def test_read_partitions(self):
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     partition_spec = "baz='baz_one',boom='boom_two'"
     response = self.client.get("/metastore/table/%s/test_partitions/partitions/%s/read" % (self.db_name, partition_spec), follow=True)
     response = self.client.get(reverse("beeswax:api_watch_query_refresh_json", kwargs={'id': response.context['query'].id}), follow=True)
@@ -149,6 +165,9 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     assert_true(len(results['results']) > 0, results)
 
   def test_browse_partition(self):
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     partition_spec = "baz='baz_one',boom='boom_two'"
     response = self.client.get("/metastore/table/%s/test_partitions/partitions/%s/browse" % (self.db_name, partition_spec), follow=True)
     if is_live_cluster():
@@ -159,6 +178,10 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     assert_equal(response.request['PATH_INFO'], filebrowser_path)
 
   def test_drop_multi_tables(self):
+
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     hql = """
       CREATE TABLE test_drop_1 (a int);
       CREATE TABLE test_drop_2 (a int);
@@ -205,6 +228,10 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     These require Hadoop, because they ask the metastore
     about whether a table is partitioned.
     """
+
+    if not is_live_cluster():
+      raise SkipTest('HUE-2902: Test is not re-entrant')
+
     # Check that view works
     resp = self.client.get("/metastore/table/%s/test/load" % self.db_name, follow=True)
     assert_true('Path' in resp.content)
@@ -252,6 +279,9 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
 
 
   def test_has_write_access_backend(self):
+    if is_live_cluster():
+      raise SkipTest('HUE-2900: Needs debugging on live cluster')
+
     client = make_logged_in_client(username='write_access_backend', groupname='write_access_backend', is_superuser=False)
     grant_access("write_access_backend", "write_access_backend", "metastore")
     grant_access("write_access_backend", "write_access_backend", "beeswax")

+ 4 - 1
apps/pig/src/pig/tests.py

@@ -26,7 +26,7 @@ from nose.tools import assert_true, assert_equal, assert_false
 
 from desktop.lib.django_test_util import make_logged_in_client
 from desktop.lib.test_utils import grant_access
-from hadoop import pseudo_hdfs4
+from hadoop import pseudo_hdfs4, is_live_cluster
 from liboozie.oozie_api_tests import OozieServerProvider
 from oozie.tests import OozieBase
 
@@ -213,6 +213,9 @@ class TestWithHadoop(OozieBase):
     return pig_script_id
 
   def test_submit(self):
+    if is_live_cluster():
+      raise SkipTest('HUE-2909: Skipping because test is not reentrant')
+
     script = PigScript.objects.get(id=1100713)
     script_dict = script.dict