Skip to content

Commit dccb45c

Browse files
committed
ci: consolidate test steps and update python version
Consolidate test steps in CI workflow from separate unit tests and coverage steps into a single test with coverage step. Update python version from 0.0.9 to 3.10 in mypy configuration and exclude package init file from coverage reporting. Fix typo in test file for credential model. fixes typo in credential test parameter name ci: 合并测试步骤并更新python版本 在CI工作流程中将独立的单元测试和覆盖率步骤合并为单个带覆盖率的测试步骤。 在mypy配置中将python版本从0.0.9更新为3.10,并从覆盖率报告中排除包初始化文件。 修复测试文件中凭证模型的拼写错误。 修复凭证测试参数名称中的拼写错误 Change-Id: Icc362fb12d7cb67151bde40f391e631b0c9f9567 Signed-off-by: OhYee <[email protected]>
1 parent 13bc49e commit dccb45c

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ jobs:
3030
run: |
3131
make mypy-check
3232
33-
- name: Run unit tests
34-
run: |
35-
make test-unit
36-
37-
- name: Run coverage
33+
- name: Run tests with coverage
3834
run: |
3935
make coverage
4036

agentrun/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ def __getattr__(name: str):
315315
for package_name in package_names:
316316
if package_name in error_str:
317317
raise ImportError(
318-
f"'{name}' requires the 'server' optional dependencies. "
319-
f"Install with: pip install {install_cmd}\n"
320-
f"Original error: {e}"
318+
f"'{name}' requires the 'server' optional"
319+
" dependencies. Install with: pip install"
320+
f" {install_cmd}\nOriginal error: {e}"
321321
) from e
322322
# 其他导入错误继续抛出
323323
raise

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ known_third_party = ["alibabacloud_tea_openapi", "alibabacloud_devs20230714", "a
102102
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
103103

104104
[tool.mypy]
105-
python_version = "0.0.9"
105+
python_version = "3.10"
106106
exclude = "tests/"
107107
plugins = ["pydantic.mypy"]
108108
# Start with non-strict mode, and switch to strict mode later.
@@ -125,6 +125,8 @@ source = ["agentrun"]
125125
branch = true
126126
# 排除的文件模式
127127
omit = [
128+
# 包初始化文件(主要是导出和延迟加载逻辑)
129+
"agentrun/__init__.py",
128130
# 测试文件
129131
"*/tests/*",
130132
"*_test.py",

tests/unittests/credential/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def test_outbound_tool_ak_sk(self):
174174
config = CredentialConfig.outbound_tool_ak_sk(
175175
provider="aliyun",
176176
access_key_id="ak-id",
177-
access_key_secred="ak-secret",
177+
access_key_secret="ak-secret",
178178
account_id="account-123",
179179
)
180180
assert config.credential_source_type == CredentialSourceType.TOOL

0 commit comments

Comments
 (0)