Created 12-30-2015 04:30 AM
e.g. mvn -Dtest=TestHDP23StackAdvisor test
Created 01-02-2016 02:10 AM
@Lav Jain it utilizes unittest so you'd run the tests just as my examples above. https://github.com/apache/ambari/blob/trunk/ambari-server/src/test/python/stacks/2.3/common/test_sta...
Created 12-31-2015 02:19 AM
is there a specific unit test you're referring to? Ambari unit tests are written in Java using JUnit, so you'd use mvn, just like your example. Here's the development guide, https://cwiki.apache.org/confluence/display/AMBARI... and here's latest build reports https://builds.apache.org/job/Ambari-trunk-Commit/... For general python unit testing and running single tests, you can do so by referring to Python docs:
The unittest module can be used from the command line to run tests from modules, classes or even individual test methods:
python -m unittest test_module1 test_module2 python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method
Created 12-31-2015 10:00 PM
Hi Artem,
Thanks a lot for your input. I was looking to test stack advisor recommendations and validations.
e.g. ambari/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
Created 01-02-2016 02:10 AM
@Lav Jain it utilizes unittest so you'd run the tests just as my examples above. https://github.com/apache/ambari/blob/trunk/ambari-server/src/test/python/stacks/2.3/common/test_sta...
Created 01-04-2016 08:05 PM
Thanks again!
Here is what worked for me (using python 2.6.6). Still need to investigate how to run the test from ambari root directory.
$ pip install discover $ export PYTHONPATH=~/git/ambari/ambari-common/src/test/python $ cd ~/git/ambari/ambari-server/src/test/python/stacks/2.3/common $ python -m discover -v Test that HAWQSTANDBY is not recommended on a single node cluster ... ok ... ---------------------------------------------------------------------- Ran 21 tests in 0.318s OK
Created 12-22-2016 03:59 PM
Hi FYI i have used
/git/ambari/ambari-common/src/main/python as oppose to /git/ambari/ambari-common/src/test/python