cloudera / hue

Open source SQL Query Assistant service for Databases/Warehouses
https://cloudera.com
Apache License 2.0
1.16k stars 364 forks source link

During `test all`, FAIL: metastore.tests.TestApi.test_show_tables #1157

Closed sungpeo closed 4 years ago

sungpeo commented 4 years ago

Describe the bug:

During ./build/env/bin/hue test all, metastore.tests.TestApi.test_show_tables fails like below.

======================================================================
FAIL: metastore.tests.TestApi.test_show_tables
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/deploy/hadoopeng/hue/build/env/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/deploy/hadoopeng/hue/apps/metastore/src/metastore/tests.py", line 96, in test_show_tables
    get.assert_called()
  File "/home/deploy/hadoopeng/hue/build/env/lib/python2.7/site-packages/mock-3.0.5-py2.7.egg/mock/mock.py", line 908, in assert_called
    raise AssertionError(msg)
AssertionError: Expected 'get' to have been called.

Steps to reproduce it?

./build/env/bin/hue test all

These tests fails only during integration test. Those succeed when it triggered by test specific

Hue version or source? (e.g. open source 4.5, CDH 5.16, CDP 1.0...). System info (e.g. OS, Browser...).

open source 4.7.0 CentOS Linux release 7.7.1908 OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)

sungpeo commented 4 years ago

I'm debugging it. The test user need to have permission to access the Metastore application.

I can fix this test using is_admin=True. But I'm not sure if it is right. Is there a common way to add hue permissions to the test users?

Content-Length: 159
x-xss-protection: 1; mode=block
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' *.google-analytics.com *.doubleclick.net data:;img-src 'self' *.google-analytics.com *.doubleclick.net http://*.tile.osm.org *.tile.osm.org *.gstatic.com data:;style-src 'self' 'unsafe-inline' fonts.googleapis.com;connect-src 'self';frame-src *;child-src 'self' data: *.vimeo.com;object-src 'none'
x-content-type-options: nosniff
Content-Language: en-us
Vary: Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: text/javascript

{
"message": "You do not have permission to access the Metastore application.",
"traceback": [],
"detail": null,
"is_embeddable": false,
"title": "Error"
}