You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Newton Alex (JIRA)" <ji...@apache.org> on 2016/02/22 19:33:18 UTC

[jira] [Commented] (AMBARI-14821) Unit tests doesn't export scripts from common-services folder into PYTHONPATH

    [ https://issues.apache.org/jira/browse/AMBARI-14821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15157434#comment-15157434 ] 

Newton Alex commented on AMBARI-14821:
--------------------------------------

The unit tests passed

```
test_validationMinMax (test_stack_advisor.TestHDP206StackAdvisor) ... ok
test_validationNamenodeAndSecondaryNamenode2Hosts_noMessagesForSameHost (test_stack_advisor.TestHDP206StackAdvisor) ... ok
test_validationWarnMessagesIfLessThanDefault (test_stack_advisor.TestHDP206StackAdvisor) ... ok
test_validatorEnoughDiskSpace (test_stack_advisor.TestHDP206StackAdvisor) ... ok

----------------------------------------------------------------------
Ran 37 tests in 0.077s
...

OK
Running tests for stack:2.0.6 service:before-INSTALL
test_hook_default (test_before_install.TestHookBeforeInstall) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.023s

OK
Running tests for stack:2.0.6 service:before-START
test_hook_default (test_before_start.TestHookBeforeStart) ... 2016-02-19 23:10:10,842 - Using hadoop conf dir: /etc/hadoop/conf
ok
test_hook_default_hdfs (test_before_start.TestHookBeforeStart) ... 2016-02-19 23:10:10,907 - Using hadoop conf dir: /etc/hadoop/conf
ok
test_hook_refresh_topology_custom_directories (test_before_start.TestHookBeforeStart) ... 2016-02-19 23:10:10,969 - Using hadoop conf dir: /etc/hadoop/conf
ok
test_hook_secured (test_before_start.TestHookBeforeStart) ... 2016-02-19 23:10:11,028 - Using hadoop conf dir: /etc/hadoop/conf
ok

----------------------------------------------------------------------
Ran 4 tests in 0.254s

OK...

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Ambari Main ....................................... SUCCESS [7.680s]
[INFO] Apache Ambari Project POM ......................... SUCCESS [0.244s]
[INFO] Ambari Web ........................................ SUCCESS [1:41.096s]
[INFO] Ambari Views ...................................... SUCCESS [10.076s]
[INFO] Ambari Admin View ................................. SUCCESS [15.339s]
[INFO] ambari-metrics .................................... SUCCESS [0.737s]
[INFO] Ambari Metrics Common ............................. SUCCESS [3.933s]
[INFO] Ambari Metrics Hadoop Sink ........................ SUCCESS [6.933s]
[INFO] Ambari Metrics Flume Sink ......................... SUCCESS [4.318s]
[INFO] Ambari Metrics Kafka Sink ......................... SUCCESS [5.493s]
[INFO] Ambari Metrics Storm Sink ......................... SUCCESS [3.808s]
[INFO] Ambari Metrics Collector .......................... SUCCESS [6:51.190s]
[INFO] Ambari Metrics Monitor ............................ SUCCESS [3.405s]
[INFO] Ambari Metrics Grafana ............................ SUCCESS [47.021s]
[INFO] Ambari Metrics Assembly ........................... SUCCESS [7:08.869s]
[INFO] Ambari Server ..................................... SUCCESS [1:15:01.678s]
[INFO] Ambari Functional Tests ........................... SUCCESS [3.113s]
[INFO] Ambari Agent ...................................... SUCCESS [1:16.953s]
[INFO] Ambari Client ..................................... SUCCESS [0.212s]
[INFO] Ambari Python Client .............................. SUCCESS [3.408s]
[INFO] Ambari Groovy Client .............................. SUCCESS [13.774s]
[INFO] Ambari Shell ...................................... SUCCESS [0.223s]
[INFO] Ambari Python Shell ............................... SUCCESS [1.037s]
[INFO] Ambari Groovy Shell ............................... SUCCESS [10.407s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:34:21.847s
[INFO] Finished at: Fri Feb 19 23:16:29 UTC 2016
[INFO] Final Memory: 301M/1243M
[INFO] ------------------------------------------------------------------------

```

> Unit tests doesn't export scripts from common-services folder into PYTHONPATH
> -----------------------------------------------------------------------------
>
>                 Key: AMBARI-14821
>                 URL: https://issues.apache.org/jira/browse/AMBARI-14821
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Newton Alex
>            Assignee: Newton Alex
>            Priority: Minor
>         Attachments: AMBARI-14821_trunk.patch
>
>
> When running unit tests with mocks like
> ---------------
>   @patch ('hawqmaster.common.__set_osparams')
>   @patch ('hawqmaster.master_helper.__is_active_master')
>   @patch ('hawqmaster.master_helper.__is_local_initialized')
>   def test_start_default(self, is_local_initialized_mock, active_master_mock, set_osparams_mock):
> ...
> ----------------
> the unit tests fail with the following msg:
> --------
> Failed tests:
> ERROR: test_configure_default (test_hawqmaster.TestHawqMaster)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/jenkins/jenkins-slave/workspace/Ambari-trunk-test-patch/ambari/ambari-common/src/test/python/mock/mock.py", line 1191, in patched
>     arg = patching.__enter__()
>   File "/home/jenkins/jenkins-slave/workspace/Ambari-trunk-test-patch/ambari/ambari-common/src/test/python/mock/mock.py", line 1250, in __enter__
>     self.target = self.getter()
>   File "/home/jenkins/jenkins-slave/workspace/Ambari-trunk-test-patch/ambari/ambari-common/src/test/python/mock/mock.py", line 1412, in <lambda>
>     getter = lambda: _importer(target)
>   File "/home/jenkins/jenkins-slave/workspace/Ambari-trunk-test-patch/ambari/ambari-common/src/test/python/mock/mock.py", line 1096, in _importer
>     thing = __import__(import_path)
> ImportError: No module named hawqmaster
> ---------
> the source scripts from common-services are not getting exported into PYTHONPATH during unittest execution.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)