Use caching to run tests and report coverage (#5086)

* use caching to run tests and report coverage

* fix test step dep name

* try to fix cov fname

* add working dir to mv step

* update artifact download

* fmt

* reduce concurrency on ext test

---------

Co-authored-by: Leonardo Pinheiro <lpinheiro@microsoft.com>
This commit is contained in:
Leonardo Pinheiro
2025-01-18 00:32:18 +10:00
committed by GitHub
parent ce20de9afb
commit a1fdbd9692
10 changed files with 31 additions and 46 deletions

View File

@@ -35,5 +35,4 @@ testpaths = ["tests"]
include = "../../shared_tasks.toml"
[tool.poe.tasks]
test = "pytest -n auto"
coverage = "pytest -n auto --cov=src --cov-report=term-missing --cov-report=xml"
test = "pytest -n auto --cov=src --cov-report=term-missing --cov-report=xml"

View File

@@ -106,8 +106,7 @@ mypy = [
include = "../../shared_tasks.toml"
[tool.poe.tasks]
test = "pytest -n auto"
coverage = "pytest -n auto --cov=src --cov-report=term-missing --cov-report=xml"
test = "pytest -n auto --cov=src --cov-report=term-missing --cov-report=xml"
mypy.default_item_type = "cmd"
mypy.sequence = [
"mypy --config-file ../../pyproject.toml --exclude src/autogen_core/application/protos --exclude tests/protos src tests",

View File

@@ -87,14 +87,9 @@ include = "../../shared_tasks.toml"
[tool.poe.tasks]
test.sequence = [
"playwright install",
"pytest -n auto",
"pytest -n 1 --cov=src --cov-report=term-missing --cov-report=xml",
]
test.default_item_type = "cmd"
coverage.sequence = [
"playwright install",
"pytest -n auto --cov=src --cov-report=term-missing --cov-report=xml",
]
coverage.default_item_type = "cmd"
mypy = "mypy --config-file ../../pyproject.toml --exclude src/autogen_ext/runtimes/grpc/protos --exclude tests/protos src tests"
[tool.mypy]

View File

@@ -54,15 +54,10 @@ include = "../../shared_tasks.toml"
[tool.poe.tasks]
test.sequence = [
"playwright install",
"pytest -n auto",
]
test.default_item_type = "cmd"
coverage.sequence = [
"playwright install",
"pytest -n auto --cov=src --cov-report=term-missing --cov-report=xml",
]
coverage.default_item_type = "cmd"
test.default_item_type = "cmd"
[tool.ruff]
extend = "../../pyproject.toml"

View File

@@ -88,5 +88,4 @@ ignore = ["B008"]
fmt = "ruff format"
format.ref = "fmt"
lint = "ruff check"
test = "pytest -n 0"
coverage = "pytest -n 0 --cov=autogenstudio --cov-report=term-missing"
test = "pytest -n 0 --cov=autogenstudio --cov-report=term-missing"

View File

@@ -27,4 +27,3 @@ include = "../../shared_tasks.toml"
[tool.poe.tasks]
mypy = "mypy --config-file $POE_ROOT/../../pyproject.toml src"
test = "true"
coverage = "true"

View File

@@ -39,4 +39,3 @@ include = "../../shared_tasks.toml"
[tool.poe.tasks]
mypy = "mypy --config-file $POE_ROOT/../../pyproject.toml src"
test = "true"
coverage = "true"

View File

@@ -44,4 +44,3 @@ include = "../../shared_tasks.toml"
[tool.poe.tasks]
mypy = "mypy --config-file $POE_ROOT/../../pyproject.toml src"
test = "true"
coverage = "true"

View File

@@ -90,11 +90,10 @@ lint = "python run_task_in_pkgs_if_exist.py lint"
pyright = "python run_task_in_pkgs_if_exist.py pyright"
mypy = "python run_task_in_pkgs_if_exist.py mypy"
test = "python run_task_in_pkgs_if_exist.py test"
coverage = "python run_task_in_pkgs_if_exist.py coverage"
markdown-code-lint = """python check_md_code_blocks.py ../README.md ./packages/autogen-core/docs/src/**/*.md"""
samples-code-check = """pyright ./samples"""
check = ["fmt", "lint", "pyright", "mypy", "coverage", "markdown-code-lint", "samples-code-check"]
check = ["fmt", "lint", "pyright", "mypy", "test", "markdown-code-lint", "samples-code-check"]
gen-proto = "python -m grpc_tools.protoc --python_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --grpc_python_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --mypy_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --mypy_grpc_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --proto_path ../protos/ agent_worker.proto --proto_path ../protos/ cloudevent.proto"