From 1d0ac0f7dc3567634ebbccb0557bdaa181adcaaf Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Tue, 6 Sep 2022 13:59:33 +0530 Subject: [PATCH] Moved the feature_tests folder into the regression folder. --- web/pgadmin/utils/route.py | 8 +++++- .../feature_tests/__init__.py | 0 .../feature_tests/browser_tool_bar_test.py | 0 ...opy_selected_query_results_feature_test.py | 0 .../feature_tests/datatype_test.json | 0 .../feature_tests/file_manager_test.py | 0 .../feature_tests/keyboard_shortcut_test.py | 0 .../pg_datatype_validation_test.py | 0 .../pg_utilities_backup_restore_test.py | 0 .../pg_utilities_maintenance_test.py | 0 .../query_tool_auto_complete_tests.py | 0 .../feature_tests/query_tool_journey_test.py | 0 .../feature_tests/query_tool_tests.py | 0 .../feature_tests/table_ddl_feature_test.py | 0 .../test_copy_sql_to_query_tool.py | 0 .../feature_tests/test_data.json | 0 .../feature_tests/view_data_dml_queries.py | 0 .../xss_checks_panels_and_query_tool_test.py | 0 .../xss_checks_pgadmin_debugger_test.py | 0 .../xss_checks_roles_control_test.py | 0 .../python_test_utils/test_utils.py | 4 +-- web/regression/runtests.py | 28 +++++++++++-------- 22 files changed, 26 insertions(+), 14 deletions(-) rename web/{pgadmin => regression}/feature_tests/__init__.py (100%) rename web/{pgadmin => regression}/feature_tests/browser_tool_bar_test.py (100%) rename web/{pgadmin => regression}/feature_tests/copy_selected_query_results_feature_test.py (100%) rename web/{pgadmin => regression}/feature_tests/datatype_test.json (100%) rename web/{pgadmin => regression}/feature_tests/file_manager_test.py (100%) rename web/{pgadmin => regression}/feature_tests/keyboard_shortcut_test.py (100%) rename web/{pgadmin => regression}/feature_tests/pg_datatype_validation_test.py (100%) rename web/{pgadmin => regression}/feature_tests/pg_utilities_backup_restore_test.py (100%) rename web/{pgadmin => regression}/feature_tests/pg_utilities_maintenance_test.py (100%) rename web/{pgadmin => regression}/feature_tests/query_tool_auto_complete_tests.py (100%) rename web/{pgadmin => regression}/feature_tests/query_tool_journey_test.py (100%) rename web/{pgadmin => regression}/feature_tests/query_tool_tests.py (100%) rename web/{pgadmin => regression}/feature_tests/table_ddl_feature_test.py (100%) rename web/{pgadmin => regression}/feature_tests/test_copy_sql_to_query_tool.py (100%) rename web/{pgadmin => regression}/feature_tests/test_data.json (100%) rename web/{pgadmin => regression}/feature_tests/view_data_dml_queries.py (100%) rename web/{pgadmin => regression}/feature_tests/xss_checks_panels_and_query_tool_test.py (100%) rename web/{pgadmin => regression}/feature_tests/xss_checks_pgadmin_debugger_test.py (100%) rename web/{pgadmin => regression}/feature_tests/xss_checks_roles_control_test.py (100%) diff --git a/web/pgadmin/utils/route.py b/web/pgadmin/utils/route.py index 1dc4dfaef..09e50b066 100644 --- a/web/pgadmin/utils/route.py +++ b/web/pgadmin/utils/route.py @@ -58,7 +58,7 @@ class TestsGeneratorRegistry(ABCMeta): ABCMeta.__init__(self, name, bases, d) @classmethod - def load_generators(cls, pkg_root, exclude_pkgs, for_modules=[], + def load_generators(cls, pkg_args, pkg_root, exclude_pkgs, for_modules=[], is_resql_only=False): cls.registry = dict() @@ -71,6 +71,12 @@ class TestsGeneratorRegistry(ABCMeta): # Append reverse engineered test case module all_modules.append('regression.re_sql.tests.test_resql') + if (pkg_args is None or pkg_args == "all") and \ + 'feature_tests' not in exclude_pkgs: + # Append feature tests module + all_modules += find_modules( + 'regression.feature_tests', False, True) + # If specific modules are to be tested, exclude others # for modules are handled differently for resql if not is_resql_only and len(for_modules) > 0: diff --git a/web/pgadmin/feature_tests/__init__.py b/web/regression/feature_tests/__init__.py similarity index 100% rename from web/pgadmin/feature_tests/__init__.py rename to web/regression/feature_tests/__init__.py diff --git a/web/pgadmin/feature_tests/browser_tool_bar_test.py b/web/regression/feature_tests/browser_tool_bar_test.py similarity index 100% rename from web/pgadmin/feature_tests/browser_tool_bar_test.py rename to web/regression/feature_tests/browser_tool_bar_test.py diff --git a/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py b/web/regression/feature_tests/copy_selected_query_results_feature_test.py similarity index 100% rename from web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py rename to web/regression/feature_tests/copy_selected_query_results_feature_test.py diff --git a/web/pgadmin/feature_tests/datatype_test.json b/web/regression/feature_tests/datatype_test.json similarity index 100% rename from web/pgadmin/feature_tests/datatype_test.json rename to web/regression/feature_tests/datatype_test.json diff --git a/web/pgadmin/feature_tests/file_manager_test.py b/web/regression/feature_tests/file_manager_test.py similarity index 100% rename from web/pgadmin/feature_tests/file_manager_test.py rename to web/regression/feature_tests/file_manager_test.py diff --git a/web/pgadmin/feature_tests/keyboard_shortcut_test.py b/web/regression/feature_tests/keyboard_shortcut_test.py similarity index 100% rename from web/pgadmin/feature_tests/keyboard_shortcut_test.py rename to web/regression/feature_tests/keyboard_shortcut_test.py diff --git a/web/pgadmin/feature_tests/pg_datatype_validation_test.py b/web/regression/feature_tests/pg_datatype_validation_test.py similarity index 100% rename from web/pgadmin/feature_tests/pg_datatype_validation_test.py rename to web/regression/feature_tests/pg_datatype_validation_test.py diff --git a/web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py b/web/regression/feature_tests/pg_utilities_backup_restore_test.py similarity index 100% rename from web/pgadmin/feature_tests/pg_utilities_backup_restore_test.py rename to web/regression/feature_tests/pg_utilities_backup_restore_test.py diff --git a/web/pgadmin/feature_tests/pg_utilities_maintenance_test.py b/web/regression/feature_tests/pg_utilities_maintenance_test.py similarity index 100% rename from web/pgadmin/feature_tests/pg_utilities_maintenance_test.py rename to web/regression/feature_tests/pg_utilities_maintenance_test.py diff --git a/web/pgadmin/feature_tests/query_tool_auto_complete_tests.py b/web/regression/feature_tests/query_tool_auto_complete_tests.py similarity index 100% rename from web/pgadmin/feature_tests/query_tool_auto_complete_tests.py rename to web/regression/feature_tests/query_tool_auto_complete_tests.py diff --git a/web/pgadmin/feature_tests/query_tool_journey_test.py b/web/regression/feature_tests/query_tool_journey_test.py similarity index 100% rename from web/pgadmin/feature_tests/query_tool_journey_test.py rename to web/regression/feature_tests/query_tool_journey_test.py diff --git a/web/pgadmin/feature_tests/query_tool_tests.py b/web/regression/feature_tests/query_tool_tests.py similarity index 100% rename from web/pgadmin/feature_tests/query_tool_tests.py rename to web/regression/feature_tests/query_tool_tests.py diff --git a/web/pgadmin/feature_tests/table_ddl_feature_test.py b/web/regression/feature_tests/table_ddl_feature_test.py similarity index 100% rename from web/pgadmin/feature_tests/table_ddl_feature_test.py rename to web/regression/feature_tests/table_ddl_feature_test.py diff --git a/web/pgadmin/feature_tests/test_copy_sql_to_query_tool.py b/web/regression/feature_tests/test_copy_sql_to_query_tool.py similarity index 100% rename from web/pgadmin/feature_tests/test_copy_sql_to_query_tool.py rename to web/regression/feature_tests/test_copy_sql_to_query_tool.py diff --git a/web/pgadmin/feature_tests/test_data.json b/web/regression/feature_tests/test_data.json similarity index 100% rename from web/pgadmin/feature_tests/test_data.json rename to web/regression/feature_tests/test_data.json diff --git a/web/pgadmin/feature_tests/view_data_dml_queries.py b/web/regression/feature_tests/view_data_dml_queries.py similarity index 100% rename from web/pgadmin/feature_tests/view_data_dml_queries.py rename to web/regression/feature_tests/view_data_dml_queries.py diff --git a/web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py b/web/regression/feature_tests/xss_checks_panels_and_query_tool_test.py similarity index 100% rename from web/pgadmin/feature_tests/xss_checks_panels_and_query_tool_test.py rename to web/regression/feature_tests/xss_checks_panels_and_query_tool_test.py diff --git a/web/pgadmin/feature_tests/xss_checks_pgadmin_debugger_test.py b/web/regression/feature_tests/xss_checks_pgadmin_debugger_test.py similarity index 100% rename from web/pgadmin/feature_tests/xss_checks_pgadmin_debugger_test.py rename to web/regression/feature_tests/xss_checks_pgadmin_debugger_test.py diff --git a/web/pgadmin/feature_tests/xss_checks_roles_control_test.py b/web/regression/feature_tests/xss_checks_roles_control_test.py similarity index 100% rename from web/pgadmin/feature_tests/xss_checks_roles_control_test.py rename to web/regression/feature_tests/xss_checks_roles_control_test.py diff --git a/web/regression/python_test_utils/test_utils.py b/web/regression/python_test_utils/test_utils.py index f94c20ab0..c89070017 100644 --- a/web/regression/python_test_utils/test_utils.py +++ b/web/regression/python_test_utils/test_utils.py @@ -1427,8 +1427,8 @@ def get_parallel_sequential_module_list(module_list): # list of files consisting tests that needs to be # executed sequentially sequential_tests_file = [ - 'pgadmin.feature_tests.pg_utilities_backup_restore_test', - 'pgadmin.feature_tests.pg_utilities_maintenance_test'] + 'regression.feature_tests.pg_utilities_backup_restore_test', + 'regression.feature_tests.pg_utilities_maintenance_test'] # list of tests can be executed in parallel parallel_tests = list(module_list) diff --git a/web/regression/runtests.py b/web/regression/runtests.py index a008c3119..d7bb61e8f 100644 --- a/web/regression/runtests.py +++ b/web/regression/runtests.py @@ -315,22 +315,28 @@ def load_modules(arguments, exclude_pkgs): """ from pgadmin.utils.route import TestsGeneratorRegistry # Load the test modules which are in given package(i.e. in arguments.pkg) + for_modules = [] + if arguments['modules'] is not None: + for_modules = arguments['modules'].split(',') + if arguments['pkg'] is None or arguments['pkg'] == "all": - TestsGeneratorRegistry.load_generators('pgadmin', exclude_pkgs) + TestsGeneratorRegistry.load_generators(arguments['pkg'], + 'pgadmin', exclude_pkgs) elif arguments['pkg'] is not None and arguments['pkg'] == "resql": - for_modules = [] - if arguments['modules'] is not None: - for_modules = arguments['modules'].split(',') - # Load the reverse engineering sql test module - TestsGeneratorRegistry.load_generators('pgadmin', exclude_pkgs, + TestsGeneratorRegistry.load_generators(arguments['pkg'], + 'pgadmin', exclude_pkgs, for_modules, is_resql_only=True) + elif arguments['pkg'] is not None and arguments['pkg'] == "feature_tests": + # Load the feature test module + TestsGeneratorRegistry.load_generators(arguments['pkg'], + 'regression.%s' % + arguments['pkg'], + exclude_pkgs, + for_modules) else: - for_modules = [] - if arguments['modules'] is not None: - for_modules = arguments['modules'].split(',') - - TestsGeneratorRegistry.load_generators('pgadmin.%s' % + TestsGeneratorRegistry.load_generators(arguments['pkg'], + 'pgadmin.%s' % arguments['pkg'], exclude_pkgs, for_modules)