HUE-9365 [core] Fix check config if warehouse is in S3

Review Request #15204 — Created June 1, 2020 and submitted

yingc
hue
master
HUE-9365
johan, ranade, romain
commit 62e55d832a64dc77d0f5905cb18e8460a0242f06 (HEAD -> s3-check-cofig)
Author: Ying Chen <yingchen@cloudera.com>
Date:   Mon Jun 1 13:08:20 2020 -0700

    HUE-9365 [core] Fix check config if warehouse is in S3

:100644 100644 718740a0c4... 4ce2bb5e42... M    apps/hive/src/hive/conf.py
:100644 100644 d053ec41e3... e78b200e10... M    apps/hive/src/hive/tests.py

ci test done on branch ying-test2

  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
romain
  1. Nice! Just any test?

  2. apps/hive/src/hive/conf.py (Diff revision 1)
     
     

    Is it a boolean or a function?

  3. apps/hive/src/hive/conf.py (Diff revision 1)
     
     

    Would just this work?

    fs.stats(warehouse)

    or even:

    fs.do_as_user(user, stats,warehouse)

  4. 
      
yingc
yingc
romain
  1. Nice!

  2. apps/hive/src/hive/tests.py (Diff revision 2)
     
     

    nit: adding

    s3_stat.assert_called()

    ?

    And mock

    is_s3_enabled to return True?

    1. this set_for_testing makes is_s3_enabled return true:
            reset = (
                aws.conf.AWS_ACCOUNTS['default'].ACCESS_KEY_ID.set_for_testing('access_key_id'),
                aws.conf.AWS_ACCOUNTS['default'].SECRET_ACCESS_KEY.set_for_testing('secret_access_key'),
                aws.conf.AWS_ACCOUNTS['default'].REGION.set_for_testing('us-east-1')
            )
    2. oops CI test failed for no 'default'. I think my local works because I have hue.ini configured.

  3. 
      
yingc
yingc
romain
  1. Nice one!

  2. 
      
yingc
Review request changed

Status: Closed (submitted)

Loading...