Skip to content

Commit

Permalink
跳过部分单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
yinjiaqi authored and yinjiaqi committed Dec 20, 2024
1 parent 9a95c5e commit d58cac1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions python/tests/component_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
SKIP_COMPONENTS = [
]

V2_SKIP_COMPONENTS = [
"ASR",
]

# 白名单中的组件因历史原因,检查失败,但可以正常使用,因此加入白名单
COMPONENT_WHITE_LIST = [
"RagWithBaiduSearchPro",
Expand Down Expand Up @@ -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:
Expand All @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_all_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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入参测试类
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_v2_asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down

0 comments on commit d58cac1

Please sign in to comment.