From d58cac162560ed11de9779485c08eff012ef09b5 Mon Sep 17 00:00:00 2001 From: yinjiaqi Date: Fri, 20 Dec 2024 12:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BF=87=E9=83=A8=E5=88=86=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/tests/component_collector.py | 12 ++++++++---- python/tests/test_all_components.py | 2 +- python/tests/test_asr.py | 2 +- python/tests/test_tts.py | 2 +- python/tests/test_v2_asr.py | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/python/tests/component_collector.py b/python/tests/component_collector.py index 445dcee5d..b6887446d 100644 --- a/python/tests/component_collector.py +++ b/python/tests/component_collector.py @@ -18,6 +18,10 @@ SKIP_COMPONENTS = [ ] +V2_SKIP_COMPONENTS = [ + "ASR", +] + # 白名单中的组件因历史原因,检查失败,但可以正常使用,因此加入白名单 COMPONENT_WHITE_LIST = [ "RagWithBaiduSearchPro", @@ -75,10 +79,10 @@ def get_component_white_list(): return COMPONENT_WHITE_LIST -def get_components(components_list, import_prefix): +def get_components(components_list, import_prefix, skip_components): components = {} for component in components_list: - if component in SKIP_COMPONENTS: + if component.__name__ in skip_components: continue try: @@ -98,12 +102,12 @@ def get_components(components_list, import_prefix): def get_all_components(): from appbuilder import __COMPONENTS__ - all_components = get_components(__COMPONENTS__, "appbuilder.") + all_components = get_components(__COMPONENTS__, "appbuilder.", SKIP_COMPONENTS) return all_components def get_v2_components(): from appbuilder.core.components.v2 import __V2_COMPONENTS__ - v2_components = get_components(__V2_COMPONENTS__, "appbuilder.core.components.v2.") + v2_components = get_components(__V2_COMPONENTS__, "appbuilder.core.components.v2.", V2_SKIP_COMPONENTS) return v2_components if __name__ == '__main__': diff --git a/python/tests/test_all_components.py b/python/tests/test_all_components.py index 83c605e1e..00dc956cd 100644 --- a/python/tests/test_all_components.py +++ b/python/tests/test_all_components.py @@ -85,7 +85,7 @@ def write_error_data(txt_file_path, error_df, error_stats): file.write(f"错误信息: {error}, 出现次数: {count}\n") print(f"\n错误信息已写入: {txt_file_path}") -@unittest.skipUnless(os.getenv("TEST_CASE", "UNKNOWN") == "CPU_PARALLEL", "") +@unittest.skipUnless(os.getenv("TEST_CASE", "UNKNOWN") == "CPU_SERIAL", "") class TestComponentManifestsAndToolEval(unittest.TestCase): """ 组件manifests和tool_eval入参测试类 diff --git a/python/tests/test_asr.py b/python/tests/test_asr.py index fc9cca4ed..3791e2678 100644 --- a/python/tests/test_asr.py +++ b/python/tests/test_asr.py @@ -8,7 +8,7 @@ from appbuilder.core.components.asr.model import ShortSpeechRecognitionRequest, ShortSpeechRecognitionResponse import os -@unittest.skipUnless(os.getenv("TEST_CASE", "UNKNOWN") == "CPU_PARALLEL", "") +@unittest.skip("测试API超限,暂时跳过") class TestASRComponent(unittest.TestCase): def setUp(self): """ diff --git a/python/tests/test_tts.py b/python/tests/test_tts.py index 3fd2dd7ba..14f704d98 100644 --- a/python/tests/test_tts.py +++ b/python/tests/test_tts.py @@ -16,7 +16,7 @@ from appbuilder.core._exception import InvalidRequestArgumentError import os -@unittest.skipUnless(os.getenv("TEST_CASE", "UNKNOWN") == "CPU_PARALLEL", "") +@unittest.skip("测试API超限,暂时跳过") class TestTTS(unittest.TestCase): def setUp(self): self.tts = appbuilder.TTS() diff --git a/python/tests/test_v2_asr.py b/python/tests/test_v2_asr.py index 585e4e5df..62a419ca2 100644 --- a/python/tests/test_v2_asr.py +++ b/python/tests/test_v2_asr.py @@ -23,7 +23,7 @@ from appbuilder.core.components.v2 import ASR from appbuilder.core.components.v2.asr.component import _convert as convert -@unittest.skipUnless(os.getenv("TEST_CASE", "UNKNOWN") == "CPU_PARALLEL", "") +@unittest.skip("测试API超限,暂时跳过") class TestASR(unittest.TestCase): def setUp(self): self.audio_file_url = "https://bj.bcebos.com/v1/appbuilder/asr_test.pcm?authorization=bce-auth-v1" \