Skip to content
Draft
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
92 changes: 76 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,68 @@ permissions:
packages: read

jobs:
ci-complete:
tests:
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.12

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libturbojpeg0-dev portaudio19-dev build-essential \
libgl1 libgl1-mesa-dri python3-dev cyclonedds-dev
sudo rm -f /usr/bin/git-lfs

- name: Configure LCM networking
run: |
sudo ip link set lo multicast on
sudo ip route add 224.0.0.0/4 dev lo || true
sudo sysctl -w net.core.rmem_max=67108864
sudo sysctl -w net.core.rmem_default=67108864

- name: Install Python dependencies
run: uv sync --only-group tests --frozen

- name: Build C++ extensions
run: |
source .venv/bin/activate
uv pip install pybind11
python setup.py build_ext --inplace

- name: Remove pydrake stubs
run: |
find .venv/lib/*/site-packages/pydrake -name '*.pyi' -delete 2>/dev/null || true

- name: Run tests
run: |
source .venv/bin/activate
_DIMOS_COV=1 coverage run -m pytest --durations=0 && coverage html && coverage report

- name: Run mypy
if: ${{ !cancelled() }}
run: |
source .venv/bin/activate
mypy dimos

- name: Upload coverage report
if: github.event_name == 'push' && !cancelled()
uses: actions/upload-artifact@v5
with:
name: coverage-report
path: htmlcov/

slow-tests:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
timeout-minutes: 60
runs-on: [self-hosted, Linux]
Expand All @@ -36,35 +97,34 @@ jobs:
git clean -ffdx -e .venv

- name: Install Python dependencies
run: uv sync --all-extras --no-extra dds --no-extra unitree-dds --frozen
run: uv sync --only-group tests-self-hosted --frozen

- name: Remove pydrake stubs
run: |
find .venv/lib/*/site-packages/pydrake -name '*.pyi' -delete 2>/dev/null || true

- name: Run tests
if: github.event_name != 'push'
run: |
/entrypoint.sh bash -c "source .venv/bin/activate && pytest --durations=0 -m 'not (tool or mujoco)'"

- name: Run tests with coverage
if: github.event_name == 'push'
run: |
/entrypoint.sh bash -c "source .venv/bin/activate && _DIMOS_COV=1 coverage run -m pytest --durations=0 -m 'not (tool or mujoco)' && coverage combine && coverage html && coverage report"
/entrypoint.sh bash -c "source .venv/bin/activate && pytest --durations=0 -m '(slow or skipif_no_ros) and not (tool or mujoco)'"

- name: Run mypy
if: ${{ !cancelled() }}
run: |
/entrypoint.sh bash -c "source .venv/bin/activate && MYPYPATH=/opt/ros/humble/lib/python3.10/site-packages mypy dimos"

- name: Upload coverage report
if: github.event_name == 'push' && !cancelled()
uses: actions/upload-artifact@v5
with:
name: coverage-report
path: htmlcov/

- name: Check disk space
if: failure()
run: |
df -h

ci-gate:
if: always()
needs: [tests, slow-tests]
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
if [[ "${{ needs.tests.result }}" != "success" ]] || \
[[ "${{ needs.slow-tests.result }}" != "success" ]]; then
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

- name: Install dependencies
run: |
uv sync --all-extras --no-extra dds --no-extra unitree-dds --no-extra cuda --frozen
uv sync --only-group tests-self-hosted --frozen

- name: Build C++ extensions
run: |
Expand Down
4 changes: 0 additions & 4 deletions dimos/agents/mcp/test_mcp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def add(self, x: int, y: int) -> str:
return str(x + y)


@pytest.mark.slow
def test_can_call_tool(agent_setup):
history = agent_setup(
blueprints=[Adder.blueprint()],
Expand Down Expand Up @@ -63,7 +62,6 @@ def register_user(self, name: str) -> str:
return "User name registered successfully."


@pytest.mark.slow
def test_can_call_again_on_error(agent_setup):
history = agent_setup(
blueprints=[UserRegistration.blueprint()],
Expand Down Expand Up @@ -113,7 +111,6 @@ def go_to_location(self, description: str) -> str:
return f"Going to the {description}."


@pytest.mark.slow
def test_multiple_tool_calls_with_multiple_messages(agent_setup):
history = agent_setup(
blueprints=[MultipleTools.blueprint(), NavigationSkill.blueprint()],
Expand Down Expand Up @@ -167,7 +164,6 @@ def test_multiple_tool_calls_with_multiple_messages(agent_setup):
assert len(go_to_location_calls) == 2


@pytest.mark.slow
def test_prompt(agent_setup):
history = agent_setup(
blueprints=[],
Expand Down
3 changes: 0 additions & 3 deletions dimos/agents/skills/test_google_maps_skill_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from typing import Any

from langchain_core.messages import HumanMessage
import pytest

from dimos.agents.skills.google_maps_skill_container import GoogleMapsSkillContainer
from dimos.core.module import Module
Expand Down Expand Up @@ -71,7 +70,6 @@ def __init__(self, **kwargs: Any):
self._max_valid_distance = 20000


@pytest.mark.slow
def test_where_am_i(agent_setup) -> None:
history = agent_setup(
blueprints=[FakeGPS.blueprint(), MockedWhereAmISkill.blueprint()],
Expand All @@ -81,7 +79,6 @@ def test_where_am_i(agent_setup) -> None:
assert "bourbon" in history[-1].content.lower()


@pytest.mark.slow
def test_get_gps_position_for_queries(agent_setup) -> None:
history = agent_setup(
blueprints=[FakeGPS.blueprint(), MockedPositionSkill.blueprint()],
Expand Down
3 changes: 0 additions & 3 deletions dimos/agents/skills/test_gps_nav_skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

from langchain_core.messages import HumanMessage
import pytest

from dimos.agents.skills.gps_nav_skill import GpsNavSkillContainer
from dimos.core.core import rpc
Expand All @@ -40,7 +39,6 @@ class MockedGpsNavSkill(GpsNavSkillContainer):
_max_valid_distance = 50000


@pytest.mark.slow
def test_set_gps_travel_points(agent_setup) -> None:
history = agent_setup(
blueprints=[
Expand All @@ -59,7 +57,6 @@ def test_set_gps_travel_points(agent_setup) -> None:
assert "success" in history[-1].content.lower()


@pytest.mark.slow
def test_set_gps_travel_points_multiple(agent_setup) -> None:
history = agent_setup(
blueprints=[
Expand Down
4 changes: 0 additions & 4 deletions dimos/agents/skills/test_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from typing import Any

from langchain_core.messages import HumanMessage
import pytest

from dimos.agents.skills.navigation import NavigationSkillContainer
from dimos.core.core import rpc
Expand Down Expand Up @@ -118,7 +117,6 @@ def _navigate_using_semantic_map(self, query):
return f"Successfuly arrived at '{query}'"


@pytest.mark.slow
def test_stop_movement(agent_setup) -> None:
history = agent_setup(
blueprints=[
Expand All @@ -133,7 +131,6 @@ def test_stop_movement(agent_setup) -> None:
assert "stopped" in history[-1].content.lower()


@pytest.mark.slow
def test_start_exploration(agent_setup) -> None:
history = agent_setup(
blueprints=[
Expand All @@ -150,7 +147,6 @@ def test_start_exploration(agent_setup) -> None:
assert "explor" in history[-1].content.lower()


@pytest.mark.slow
def test_go_to_semantic_location(agent_setup) -> None:
history = agent_setup(
blueprints=[
Expand Down
2 changes: 0 additions & 2 deletions dimos/agents/skills/test_unitree_skill_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from typing import Any

from langchain_core.messages import HumanMessage
import pytest

from dimos.core.core import rpc
from dimos.core.module import Module
Expand Down Expand Up @@ -53,7 +52,6 @@ class MockedUnitreeSkill(UnitreeSkillContainer):
pass


@pytest.mark.slow
def test_pounce(agent_setup) -> None:
history = agent_setup(
blueprints=[
Expand Down
Loading
Loading