You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by xiong <ca...@126.com> on 2013/08/26 10:05:24 UTC

Unit tests are failing on Master build

when I run the command as follow, it is right.
mvn -X -B -e clean install package rpm:rpm -DskipTests -Dpython.ver="python >= 2.6"
but when I  setup the mock and  run the command to test, it is failing.
mvn -X -B -e clean test -Dpython.ver="python >= 2.6"
and the error is
[DEBUG] Executing command line: python2.6 unitTests.py
Traceback (most recent call last):
  File "unitTests.py", line 46, in <module>
    sys.exit(main())
  File "unitTests.py", line 38, in main
    modules]
  File "/usr/lib64/python2.6/unittest.py", line 575, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/home/incubator-ambari/ambari-server/src/test/python/TestAmbaryServer.py", line 23, in <module>
    from mock.mock import patch
ImportError: No module named mock
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Ambari Main ....................................... SUCCESS [0.126s]
[INFO] Apache Ambari Project POM ......................... SUCCESS [0.051s]
[INFO] Ambari Web ........................................ SUCCESS [8.625s]
[INFO] Ambari Server ..................................... FAILURE [10:21.114s]
[INFO] Ambari Agent ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:30.562s
[INFO] Finished at: Mon Aug 26 15:28:08 CST 2013
[INFO] Final Memory: 34M/367M



Re: Unit tests are failing on Master build

Posted by Siddharth Wagle <sw...@hortonworks.com>.
Hi Xiong,

This could be because you have an existing version of mock in your PATH or
PYTHONPATH environment variable.
Ambari includes the mock source under,
ambari/ambari-common/src/test/python/mock.
If you temporarily remove the default mock that python is using, you should
be able to get around this problem.

Regards,
Sid


On Mon, Aug 26, 2013 at 1:05 AM, xiong <ca...@126.com> wrote:

> when I run the command as follow, it is right.
> mvn -X -B -e clean install package rpm:rpm -DskipTests
> -Dpython.ver="python >= 2.6"
> but when I  setup the mock and  run the command to test, it is failing.
> mvn -X -B -e clean test -Dpython.ver="python >= 2.6"
> and the error is
> [DEBUG] Executing command line: python2.6 unitTests.py
> Traceback (most recent call last):
>   File "unitTests.py", line 46, in <module>
>     sys.exit(main())
>   File "unitTests.py", line 38, in main
>     modules]
>   File "/usr/lib64/python2.6/unittest.py", line 575, in loadTestsFromName
>     module = __import__('.'.join(parts_copy))
>   File
> "/home/incubator-ambari/ambari-server/src/test/python/TestAmbaryServer.py",
> line 23, in <module>
>     from mock.mock import patch
> ImportError: No module named mock
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Ambari Main ....................................... SUCCESS [0.126s]
> [INFO] Apache Ambari Project POM ......................... SUCCESS [0.051s]
> [INFO] Ambari Web ........................................ SUCCESS [8.625s]
> [INFO] Ambari Server ..................................... FAILURE
> [10:21.114s]
> [INFO] Ambari Agent ...................................... SKIPPED
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 10:30.562s
> [INFO] Finished at: Mon Aug 26 15:28:08 CST 2013
> [INFO] Final Memory: 34M/367M
>
>
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.