aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/ci/test_run_tests.py
AgeCommit message (Collapse)AuthorFilesLines
2018-03-02Leverage on XtestingCédric Ollivier1-267/+0
It removes all the files which have moved to Xtesting. Vnf inheritances and env management will be improved in other changes. It keeps the same tree thanks to a symlink to allow publishing artifacts. Change-Id: I551bbd3f344cdab0158a50b7b09e541576695631 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-24Print env vars and env_fileCédric Ollivier1-2/+1
It simply eases detecting wrong inputs [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/796/console Change-Id: I0784c29265c69a6ba4a049226196bcdd70b0a572 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-09Read the env file only if existsCédric Ollivier1-1/+2
Change-Id: I8e718e583a5a47a089755c31e623a44732e5ba1e Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-09Unlink run_tests from constantsCédric Ollivier1-7/+5
run_tests.py doesn't read any functest config file what is mandatory for xtesting. Change-Id: I49f672c54a606acead75f573d1ce496c81fb235a Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-09Move get_dict_by_test() into run_tests.pyCédric Ollivier1-4/+17
It also removes functest_utils.get_criteria_by_test() Change-Id: I3f265642acd053755e32f8e92f1086b93517c247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-08Move source_credentials() into run_tests.pyCédric Ollivier1-5/+34
It's also renamed source_envfile(). Change-Id: I0e7c38c2def125961f86dc2bc9a63cfb6ad87c03 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-02-01Rename a common credential file for OS and K8SLinda Wang1-24/+10
Change-Id: Ib8d24be4b29ab1de00d5dd5e3442146b2437cb94 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2018-01-21Partially rewrite test_run_tests.pyCédric Ollivier1-75/+72
It mainly fixes pylint issues and leverages on decorators. It should be noted that run_tests.py is not fully covered (see xtesting requirements). Change-Id: I114b67c3c5bfe61d72d004829af513e2014ad8b8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2018-01-21Fully test and cover functest/ci/tier_*Cédric Ollivier1-9/+3
It also fixes check_deployment.py and ci unit tests which were wrong when testing exceptions. Now ci modules are rated 10/10 and fully covered. Change-Id: I30dca491b44cc54aa1abc0d0433c00b4dcabfdc4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-12-14Improve the pylint score of functest-coreLinda Wang1-13/+11
It also modifies the file list to ensure the rating of ci modules. Change-Id: Ia1e414be5364cb3da3d54882db428024ed6bd99f Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-12-12All patching config files in memoryLinda Wang1-50/+0
It adds the yaml content as Config attribute and allow patching it without modifying the file (and reimport constants or config). It also removes obsolete data in config_patch.yaml and moves several functions in the right modules (Config) JIRA: ARMBAND-334 Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: I5c9a574d3283828063154c977cdfbc2abfdc6777 Signed-off-by: Linda Wang <wangwulin@huawei.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-11-30Stop updating test_db_url in config file by env varLinda Wang1-32/+2
If TEST_DB_URL is declared in env variable, use it before considering the var in config file. Change-Id: I656ad8765287c48d60af7ab88b421805d76fb231 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-11-22Remove prepare_envJose Lausuch1-0/+80
After moving the rally installation out of prepare_env It doesn't much sense to keep this script as it doesn't do useful things any more. Change-Id: I9ab3b2dd30c8ec0fbb825ee4302a83cce80f1cbe Signed-off-by: Jose Lausuch <jalausuch@suse.com>
2017-09-18Return Functest status to JenkinsCédric Ollivier1-2/+8
It avoids mixing Functest and Features CI issues by simply exiting the status of Functest testcases. The result of third-party testcases are printed into console but are no longer taken into account into the global status. Change-Id: I040ff54780db2ddb6d81993839fee09f5e472323 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-08-16Clean run_tests.py and the related utCédric Ollivier1-97/+74
It enhances run_tests.py as proposed in [1]. It also prints all skipped tests in summary and fixes copyright headers. All the related unit tests have been updated too. [1] https://jira.opnfv.org/browse/FUNCTEST-832 JIRA: FUNCTEST-832 Change-Id: I59b96422bc7942ecd6270c45ab7a3fb603c13ccb Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-30Define create_snapshot() and clean() in TestCaseCédric Ollivier1-17/+10
They replace the former calls in run_tests which are not suitable for all test cases. Now any test case can define how to clean its resources. If the snapshot cannot be created, the test case is considered as failed. Only a message is printed if any failure during cleaning. It also defines a new class called OSGCTestCase useful for test cases which don't clean their OpenStack resources. All test cases located in opnfv_tests/openstack inherit from it to keep the global behavior unchanged. It also deletes exit instructions in openstack_clean and openstack_snapshot, removes clean flags in testcases.yaml and updates the related utils. All Docs are modified as well. JIRA: FUNCTEST-438 Change-Id: I8938e6255708012380389763a24059ace4ce45d8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-19Merge "Define Runner class"Jose Lausuch1-73/+98
2017-05-18Modify how to disable logging in unit test.Cédric Ollivier1-2/+1
Logs are only disabled when the unit tests are run from cmdline. It allows running them via pytest_suite_runner.py and printing their results to functest.log. You should notice that the unit test must disable the logger of the tested TestCase (e.g. testcase.TestCase.logger.disabled = 1). Otherwise false logs will be printed in console. Change-Id: Ic171e4575c8bab2e52db1897ae026b61a03b6247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-16Define Runner classCédric Ollivier1-73/+98
It simply converts run_tests.py's functions to Runner's methods. This proposal could be enhanced in a second step to fully leverage on object programming. It defines as instance variables the former static variables to allow multiple runs (it's mandatory for unit testing). All false positives in unit tests are fixed but run_tests.py is still not fully covered. Change-Id: I8f91c132aa8b2248041f31e46238dd5598344d34 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-16Switch from generate_report to PrettyTableCédric Ollivier1-26/+5
run_tests.py now relies on PrettyTable as most of the openstack clients. generate_report.py and its related unit tests are simply removed. It sets padding_width=5 in testcase.py too to conform with run_tests.py. Now report is printed in every case. Change-Id: Id9ce93f984503f25d6a2150482f397853fa3dd64 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-05Replace CONST.* by getattribute/setattrjose.lausuch1-6/+7
Directories affected: - ci - core and respective unit tests Change-Id: I6a3d5aa68de29fc5a37ae543a067ff797eba33e6 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
2017-03-27More Unit Tests for ci directoryashishk19941-2/+82
This patch adds more unit tests for ci/prepare_env, ci/run_tests and ci/tier_handler to reach the coverage more than 80% Change-Id: Ia3b7105542105bf8c5e3db58c898ba0569190a80 Signed-off-by: ashishk1994 <ashishk.iiit@gmail.com>
2017-03-15Added Unit Tests for ci/run_testsashishk19941-0/+192
Change-Id: I5cd900cee809b8fd935a5c8b862a9ecd6278bdf5 Signed-off-by: ashishk1994 <ashishk.iiit@gmail.com>