From 925e24525a2e81cc121e0836651c7eecd90ff5c2 Mon Sep 17 00:00:00 2001 From: Victor Kuznetsov Date: Mon, 15 Nov 2021 14:18:16 +0300 Subject: [PATCH] Move unit_tests from test_pkg/tools to test_pkg/tests (#8548) * add performance hint to time infer * move unit_tests to tests pkg * change unit_tests path in azure lin * change path to mo in bom test * fix tests_path * change mo dir path --- .ci/azure/linux.yml | 2 +- model-optimizer/CMakeLists.txt | 6 +++--- model-optimizer/unit_tests/mo/bom_test.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.ci/azure/linux.yml b/.ci/azure/linux.yml index 9594b4a2c26..57c018946e3 100644 --- a/.ci/azure/linux.yml +++ b/.ci/azure/linux.yml @@ -217,7 +217,7 @@ jobs: - script: | export MO_ROOT=$(INSTALL_DIR)/tools/model_optimizer - . $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_DIR)/tools/model_optimizer/unit_tests --junitxml=TEST-ModelOptimizer.xml + . $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_DIR)/tests/model_optimizer/unit_tests --junitxml=TEST-ModelOptimizer.xml displayName: 'Model Optimizer UT' continueOnError: false diff --git a/model-optimizer/CMakeLists.txt b/model-optimizer/CMakeLists.txt index 0f7f2bffa62..f6e44fd82fe 100644 --- a/model-optimizer/CMakeLists.txt +++ b/model-optimizer/CMakeLists.txt @@ -46,17 +46,17 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ ) install(FILES requirements_dev.txt - DESTINATION tools/model_optimizer + DESTINATION tests/model_optimizer COMPONENT tests EXCLUDE_FROM_ALL) install(DIRECTORY unit_tests - DESTINATION tools/model_optimizer + DESTINATION tests/model_optimizer COMPONENT tests EXCLUDE_FROM_ALL) install(DIRECTORY automation - DESTINATION tools/model_optimizer + DESTINATION tests/model_optimizer COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/model-optimizer/unit_tests/mo/bom_test.py b/model-optimizer/unit_tests/mo/bom_test.py index 454be1912c9..11511deaf6c 100644 --- a/model-optimizer/unit_tests/mo/bom_test.py +++ b/model-optimizer/unit_tests/mo/bom_test.py @@ -28,13 +28,15 @@ class TestBOMFile(unittest.TestCase): def setUpClass(cls): cls.existing_files = [] cur_path = os.path.join(os.path.realpath(__file__), os.pardir) - cls.output_dir = os.path.abspath(os.path.join(cur_path, os.pardir, os.pardir)) - with open(os.path.join(cls.output_dir, 'automation', 'package_BOM.txt'), 'r') as bom_file: + mo_path = os.path.abspath(os.path.join(cur_path, os.pardir, os.pardir)) + with open(os.path.join(mo_path, 'automation', 'package_BOM.txt'), 'r') as bom_file: if platform.system() == 'Windows': cls.existing_files = [name.rstrip().replace('/', '\\') for name in bom_file.readlines()] else: cls.existing_files = [name.rstrip() for name in bom_file.readlines()] + # output_dir is the model_optimizer directory that is located in 'pkg/tools' + cls.output_dir = mo_path.replace('tests', 'tools') cls.expected_header = [re.compile(pattern) for pattern in [ r'^# Copyright \([cC]\) [0-9\-]+ Intel Corporation$', r'^# SPDX-License-Identifier: Apache-2.0$',