Browse Source

[core] Fix several broken and hanging tests

Fix metastore tests that were out of sync
Disable dynamic fields
Change port of Oozie test server has it is conflicting with Spark master.
Move config_validator dependencies into the function to avoid conflicts.
Romain Rigaux 11 years ago
parent
commit
6860085c55

+ 1 - 1
apps/beeswax/src/beeswax/conf.py

@@ -21,7 +21,6 @@ import sys
 from django.utils.translation import ugettext_lazy as _t, ugettext as _
 
 from desktop.lib.conf import ConfigSection, Config, coerce_bool
-from hadoop import cluster
 
 from beeswax.settings import NICE_NAME
 
@@ -135,6 +134,7 @@ def config_validator(user):
     res.append((NICE_NAME, _("The application won't work without a running HiveServer2.")))
 
   try:
+    from hadoop import cluster
     warehouse = '/user/hive/warehouse'
     fs = cluster.get_hdfs()
     fs.stats(warehouse)

+ 9 - 10
apps/metastore/src/metastore/tests.py

@@ -231,22 +231,21 @@ class TestMetastoreWithHadoop(BeeswaxSampleProvider):
     grant_access("write_access_backend", "write_access_backend", "beeswax")
     user = User.objects.get(username='write_access_backend')
 
-    def check(client, http_code):
-      resp = _make_query(client, 'CREATE TABLE test_perm_1 (a int);')
-      resp = wait_for_query_to_finish(client, resp, max=30.0)
+    resp = _make_query(client, 'CREATE TABLE test_perm_1 (a int);') # Only fails if we were using Sentry and won't allow SELECT to user
+    resp = wait_for_query_to_finish(client, resp, max=30.0)
 
-      resp = client.get('/metastore/tables/drop/default', follow=True)
-      #assert_true('want to delete' in resp.content, resp.content)
-      assert_equal(resp.status_code, http_code, resp.content)
+    def check(client, http_codes):
+      resp = client.get('/metastore/tables/drop/default')
+      assert_true(resp.status_code in http_codes, resp.content)
 
-      resp = client.post('/metastore/tables/drop/default', {u'table_selection': [u'test_perm_1']}, follow=True)
-      assert_equal(resp.status_code, http_code, resp.content)
+      resp = client.post('/metastore/tables/drop/default', {u'table_selection': [u'test_perm_1']})
+      assert_true(resp.status_code in http_codes, resp.content)
 
-    check(client, 500)
+    check(client, [301]) # Denied
 
     # Add access
     group, created = Group.objects.get_or_create(name='write_access_backend')
     perm, created = HuePermission.objects.get_or_create(app='metastore', action='write')
     GroupPermission.objects.get_or_create(group=group, hue_permission=perm)
 
-    check(client, 200)
+    check(client, [200, 302]) # Ok

+ 3 - 2
apps/search/src/search/models.py

@@ -286,8 +286,9 @@ class Collection(models.Model):
     schema_fields = SolrApi(SOLR_URL.get(), user).fields(self.name)
     schema_fields = schema_fields['schema']['fields']
 
-    dynamic_fields = SolrApi(SOLR_URL.get(), user).fields(self.name, dynamic=True)
-    dynamic_fields = dynamic_fields['fields']
+    dynamic_fields = []
+#    dynamic_fields = SolrApi(SOLR_URL.get(), user).fields(self.name, dynamic=True)
+#    dynamic_fields = dynamic_fields['fields']
 
     schema_fields.update(dynamic_fields)
 

File diff suppressed because it is too large
+ 0 - 0
apps/search/src/search/tests.py


+ 1 - 1
desktop/libs/liboozie/src/liboozie/oozie_api_tests.py

@@ -44,7 +44,7 @@ class OozieServerProvider(object):
   """
   Setup a Oozie server.
   """
-  OOZIE_TEST_PORT = '18080'
+  OOZIE_TEST_PORT = '18001'
   OOZIE_HOME = get_run_root('ext/oozie/oozie')
 
   requires_hadoop = True

Some files were not shown because too many files changed in this diff