|
|
@@ -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")
|