Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,37 @@ jobs:
name: coverage-${{ env.PKG_NAME }}
path: ./python/coverage_${{ env.PKG_NAME }}.xml

test-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run uv sync
run: |
uv sync --locked --all-extras
working-directory: ./python
- name: Run task
run: |
source ${{ github.workspace }}/python/.venv/bin/activate
poe --directory ./packages/autogen-ext test-docker
working-directory: ./python

- name: Move coverage file
run: |
mv ./packages/autogen-ext/coverage.xml coverage_autogen-ext-docker.xml
working-directory: ./python

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-autogen-ext-docker
path: ./python/coverage_autogen-ext-docker.xml

test-grpc:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -232,7 +263,7 @@ jobs:

codecov:
runs-on: ubuntu-latest
needs: [test, test-grpc]
needs: [test, test-grpc, test-docker]
strategy:
matrix:
package:
Expand All @@ -241,6 +272,7 @@ jobs:
"./packages/autogen-ext",
"./packages/autogen-agentchat",
"autogen-ext-grpc",
"autogen-ext-docker",
]
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 11 additions & 0 deletions python/packages/autogen-ext/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,25 @@ def pytest_addoption(parser):
parser.addoption(
"--grpc", action="store_true", default=False, help="run grpc tests"
)
parser.addoption(
"--docker", action="store_true", default=False, help="run docker tests"
)

def pytest_collection_modifyitems(config, items):
grpc_option_passed = config.getoption("--grpc")
docker_option_passed = config.getoption("--docker")
skip_grpc = pytest.mark.skip(reason="Need --grpc option to run")
skip_non_grpc = pytest.mark.skip(reason="Skipped since --grpc passed")
skip_docker = pytest.mark.skip(reason="Need --docker option to run")
skip_non_docker = pytest.mark.skip(reason="Skipped since --docker passed")

for item in items:
if "grpc" in item.keywords and not grpc_option_passed:
item.add_marker(skip_grpc)
elif "grpc" not in item.keywords and grpc_option_passed:
item.add_marker(skip_non_grpc)

if "docker" in item.keywords and not docker_option_passed:
item.add_marker(skip_docker)
elif "docker" not in item.keywords and docker_option_passed:
item.add_marker(skip_non_docker)
2 changes: 2 additions & 0 deletions python/packages/autogen-ext/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ minversion = "6.0"
testpaths = ["tests"]
markers = [
"grpc",
"docker",
]

[tool.poe]
Expand All @@ -196,6 +197,7 @@ test.sequence = [
]
test.default_item_type = "cmd"
test-grpc = "pytest -n 1 --cov=src --cov-report=term-missing --cov-report=xml --grpc"
test-docker = "pytest -n 1 --cov=src --cov-report=term-missing --cov-report=xml --docker"
test-windows = "pytest -n 1 --cov=src --cov-report=term-missing --cov-report=xml -m 'windows'"
mypy = "mypy --config-file ../../pyproject.toml --exclude src/autogen_ext/runtimes/grpc/protos --exclude tests/protos --ignore-missing-imports src tests"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from autogen_core.code_executor import CodeBlock
from autogen_ext.code_executors.docker import DockerCommandLineCodeExecutor

pytestmark = pytest.mark.docker


def docker_tests_enabled() -> bool:
if os.environ.get("SKIP_DOCKER", "unset").lower() == "true":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
DockerJupyterServer,
)

pytestmark = pytest.mark.docker


def docker_tests_enabled() -> bool:
if os.environ.get("SKIP_DOCKER", "unset").lower() == "true":
Expand Down