mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: add better test coverage to individual tests, and all-tests task, gh … (#400)
* add better test coverage to individual tests, and all-tests task, gh action to surface * remove cache location * test version-file * updated uv setup for consistency * mypy fix * update naming * temporarily removed mypy from workflow
This commit is contained in:
committed by
GitHub
Unverified
parent
df9d85d1f0
commit
53866218d2
@@ -48,6 +48,11 @@ timeout = 120
|
||||
[tool.ruff]
|
||||
extend = "../../pyproject.toml"
|
||||
|
||||
[tool.coverage.run]
|
||||
omit = [
|
||||
"**/__init__.py"
|
||||
]
|
||||
|
||||
[tool.pyright]
|
||||
extend = "../../pyproject.toml"
|
||||
exclude = ['tests']
|
||||
@@ -76,6 +81,7 @@ executor.type = "uv"
|
||||
include = "../../shared_tasks.toml"
|
||||
[tool.poe.tasks]
|
||||
mypy = "mypy --config-file $POE_ROOT/pyproject.toml agent_framework_azure"
|
||||
test = "pytest --cov=agent_framework_azure --cov-report=term-missing:skip-covered tests"
|
||||
|
||||
[tool.uv.build-backend]
|
||||
module-name = "agent_framework_azure"
|
||||
|
||||
@@ -50,6 +50,11 @@ timeout = 120
|
||||
[tool.ruff]
|
||||
extend = "../../pyproject.toml"
|
||||
|
||||
[tool.coverage.run]
|
||||
omit = [
|
||||
"**/__init__.py"
|
||||
]
|
||||
|
||||
[tool.pyright]
|
||||
extend = "../../pyproject.toml"
|
||||
exclude = ['tests']
|
||||
@@ -78,6 +83,7 @@ executor.type = "uv"
|
||||
include = "../../shared_tasks.toml"
|
||||
[tool.poe.tasks]
|
||||
mypy = "mypy --config-file $POE_ROOT/pyproject.toml agent_framework_foundry"
|
||||
test = "pytest --cov=agent_framework_foundry --cov-report=term-missing:skip-covered tests"
|
||||
|
||||
[tool.uv.build-backend]
|
||||
module-name = "agent_framework_foundry"
|
||||
|
||||
@@ -61,6 +61,11 @@ asyncio_default_fixture_loop_scope = "function"
|
||||
filterwarnings = []
|
||||
timeout = 120
|
||||
|
||||
[tool.coverage.run]
|
||||
omit = [
|
||||
"**/__init__.py"
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
extend = "../../pyproject.toml"
|
||||
|
||||
@@ -92,6 +97,7 @@ executor.type = "uv"
|
||||
include = "../../shared_tasks.toml"
|
||||
[tool.poe.tasks]
|
||||
mypy = "mypy --config-file $POE_ROOT/pyproject.toml agent_framework"
|
||||
test = "pytest --cov=agent_framework --cov-report=term-missing:skip-covered tests"
|
||||
|
||||
[tool.uv.build-backend]
|
||||
module-name = "agent_framework"
|
||||
|
||||
@@ -47,6 +47,11 @@ timeout = 120
|
||||
[tool.ruff]
|
||||
extend = "../../pyproject.toml"
|
||||
|
||||
[tool.coverage.run]
|
||||
omit = [
|
||||
"**/__init__.py"
|
||||
]
|
||||
|
||||
[tool.pyright]
|
||||
extend = "../../pyproject.toml"
|
||||
exclude = ['tests']
|
||||
@@ -73,6 +78,8 @@ exclude_dirs = ["tests"]
|
||||
[tool.poe]
|
||||
executor.type = "uv"
|
||||
include = "../../shared_tasks.toml"
|
||||
[tool.poe.tasks]
|
||||
test = "pytest --cov=agent_framework_workflow --cov-report=term-missing:skip-covered tests"
|
||||
|
||||
[tool.uv.build-backend]
|
||||
module-name = "agent_framework_workflow"
|
||||
|
||||
+14
-17
@@ -123,6 +123,19 @@ convention = "google"
|
||||
notice-rgx = "^# Copyright \\(c\\) Microsoft\\. All rights reserved\\."
|
||||
min-file-size = 1
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = 'tests'
|
||||
addopts = "-ra -q -r fEX"
|
||||
asyncio_mode = "auto"
|
||||
asyncio_default_fixture_loop_scope = "function"
|
||||
filterwarnings = []
|
||||
timeout = 120
|
||||
|
||||
[tool.coverage.run]
|
||||
omit = [
|
||||
"**/__init__.py"
|
||||
]
|
||||
|
||||
[tool.pyright]
|
||||
include = ["agent_framework", "samples"]
|
||||
exclude = ["**/tests/**", "docs", "**/.venv/**"]
|
||||
@@ -172,6 +185,7 @@ build = "python run_tasks_in_packages_if_exists.py build"
|
||||
# combined checks
|
||||
check = ["fmt", "lint", "pyright", "mypy", "test", "markdown-code-lint", "samples-code-check"]
|
||||
pre-commit-check = ["fmt", "lint", "pyright", "markdown-code-lint", "samples-code-check"]
|
||||
all-tests = "pytest --cov=agent_framework --cov=agent_framework_azure --cov=agent_framework_foundry --cov=agent_framework_workflow --cov-report=term-missing:skip-covered packages/**/tests"
|
||||
|
||||
[tool.poe.tasks.venv]
|
||||
cmd = "uv venv --clear --python $python"
|
||||
@@ -184,24 +198,7 @@ sequence = [
|
||||
]
|
||||
args = [{ name = "python", default = "3.13", options = ['-p', '--python'] }]
|
||||
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["packages"]
|
||||
include = ["agent_framework**"]
|
||||
namespaces = true
|
||||
|
||||
[tool.tox]
|
||||
requires = ["tox>=4", "tox-uv>=1"]
|
||||
env_list = [ "3.13"] #, "3.12", "3.11", "3.10" ]
|
||||
|
||||
[tool.tox.env_run_base]
|
||||
no_package = true
|
||||
description = "run tests"
|
||||
dependency_groups = [
|
||||
"dev",
|
||||
]
|
||||
deps = [
|
||||
"-e packages/azure",
|
||||
"-e packages/main"
|
||||
]
|
||||
commands = [["pytest", { replace = "posargs", default = ["packages/main/tests"], extend = true }]]
|
||||
|
||||
@@ -4,4 +4,3 @@ format.ref = "fmt"
|
||||
lint = "ruff check"
|
||||
pyright = "pyright"
|
||||
build = "uv build"
|
||||
test = "pytest --cov=agent_framework --cov-report=term-missing:skip-covered tests"
|
||||
|
||||
Reference in New Issue
Block a user