Skip to content

Commit 35acee9

Browse files
move slow tests to integration (#1063)
* move slow tests to integration * run integration tests too * remove fast * fix dimos/control/test_control.py
1 parent 5b3df27 commit 35acee9

File tree

20 files changed

+58
-5
lines changed

20 files changed

+58
-5
lines changed

.github/workflows/docker.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,21 @@ jobs:
205205
cmd: "pytest -m lcm"
206206
dev-image: dev:${{ (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true') && needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
207207

208+
run-integration-tests:
209+
needs: [check-changes, dev]
210+
if: always()
211+
uses: ./.github/workflows/tests.yml
212+
secrets: inherit
213+
with:
214+
should-run: ${{
215+
needs.check-changes.result == 'success' &&
216+
((needs.dev.result == 'success') ||
217+
(needs.dev.result == 'skipped' &&
218+
needs.check-changes.outputs.tests == 'true'))
219+
}}
220+
cmd: "pytest -m integration"
221+
dev-image: dev:${{ (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true') && needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
222+
208223
run-mypy:
209224
needs: [check-changes, ros-dev]
210225
if: always()

bin/pytest-slow

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
. .venv/bin/activate
6+
exec pytest "$@" -m 'not (tool or cuda or gpu or module or temporal)' dimos

dimos/agents/skills/test_navigation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import pytest
1516

1617
from dimos.msgs.geometry_msgs import PoseStamped, Vector3
1718
from dimos.utils.transform_utils import euler_to_quaternion
1819

1920

20-
# @pytest.mark.skip
2121
def test_stop_movement(create_navigation_agent, navigation_skill_container, mocker) -> None:
2222
cancel_goal_mock = mocker.Mock()
2323
stop_exploration_mock = mocker.Mock()
@@ -35,6 +35,7 @@ def test_stop_movement(create_navigation_agent, navigation_skill_container, mock
3535
stop_exploration_mock.assert_called_once_with()
3636

3737

38+
@pytest.mark.integration
3839
def test_take_a_look_around(create_navigation_agent, navigation_skill_container, mocker) -> None:
3940
explore_mock = mocker.Mock()
4041
is_exploration_active_mock = mocker.Mock()

dimos/agents/test_agent_fake.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import pytest
1516

17+
18+
@pytest.mark.integration
1619
def test_what_is_your_name(create_potato_agent) -> None:
1720
agent = create_potato_agent(fixture="test_what_is_your_name.json")
1821
response = agent.query("hi there, please tell me what's your name?")
1922
assert "Mr. Potato" in response
2023

2124

25+
@pytest.mark.integration
2226
def test_how_much_is_124181112_plus_124124(create_potato_agent) -> None:
2327
agent = create_potato_agent(fixture="test_how_much_is_124181112_plus_124124.json")
2428

@@ -29,6 +33,7 @@ def test_how_much_is_124181112_plus_124124(create_potato_agent) -> None:
2933
assert "999000000" in response.replace(",", "")
3034

3135

36+
@pytest.mark.integration
3237
def test_what_do_you_see_in_this_picture(create_potato_agent) -> None:
3338
agent = create_potato_agent(fixture="test_what_do_you_see_in_this_picture.json")
3439

dimos/agents/test_mock_agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from dimos.robot.unitree_webrtc.type.lidar import LidarMessage
3131

3232

33+
@pytest.mark.integration
3334
def test_tool_call() -> None:
3435
"""Test agent initialization and tool call execution."""
3536
# Create a fake model that will respond with tool calls
@@ -74,6 +75,7 @@ def test_tool_call() -> None:
7475
agent.stop()
7576

7677

78+
@pytest.mark.integration
7779
def test_image_tool_call() -> None:
7880
"""Test agent with image tool call execution."""
7981
dimos = start(2)

dimos/control/test_control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
TrajectoryState,
3737
)
3838
from dimos.control.tick_loop import TickLoop
39+
from dimos.hardware.manipulators.spec import ManipulatorBackend
3940
from dimos.msgs.trajectory_msgs import JointTrajectory, TrajectoryPoint
4041

4142
# =============================================================================
@@ -46,9 +47,8 @@
4647
@pytest.fixture
4748
def mock_backend():
4849
"""Create a mock manipulator backend."""
49-
backend = MagicMock()
50+
backend = MagicMock(spec=ManipulatorBackend)
5051
backend.get_dof.return_value = 6
51-
backend.get_joint_names.return_value = [f"joint{i + 1}" for i in range(6)]
5252
backend.read_joint_positions.return_value = [0.0] * 6
5353
backend.read_joint_velocities.return_value = [0.0] * 6
5454
backend.read_joint_efforts.return_value = [0.0] * 6

dimos/core/test_blueprints.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def test_global_config() -> None:
162162
assert blueprint_set.global_config_overrides["option2"] == 42
163163

164164

165+
@pytest.mark.integration
165166
def test_build_happy_path() -> None:
166167
pubsub.lcm.autoconf()
167168

@@ -272,6 +273,7 @@ class Module3(Module):
272273
blueprint_set_remapped._verify_no_name_conflicts()
273274

274275

276+
@pytest.mark.integration
275277
def test_remapping() -> None:
276278
"""Test that remapping connections works correctly."""
277279
pubsub.lcm.autoconf()
@@ -351,6 +353,7 @@ def test_future_annotations_support() -> None:
351353
)
352354

353355

356+
@pytest.mark.integration
354357
def test_future_annotations_autoconnect() -> None:
355358
"""Test that autoconnect works with modules using `from __future__ import annotations`."""
356359

dimos/e2e_tests/test_control_orchestrator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434

3535
@pytest.mark.skipif(bool(os.getenv("CI")), reason="LCM doesn't work in CI.")
36+
@pytest.mark.e2e
3637
class TestControlOrchestratorE2E:
3738
"""End-to-end tests for ControlOrchestrator."""
3839

dimos/e2e_tests/test_dimos_cli_e2e.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
@pytest.mark.skipif(bool(os.getenv("CI")), reason="LCM spy doesn't work in CI.")
2121
@pytest.mark.skipif(not os.getenv("OPENAI_API_KEY"), reason="OPENAI_API_KEY not set.")
22+
@pytest.mark.e2e
2223
def test_dimos_skills(lcm_spy, start_blueprint, human_input) -> None:
2324
lcm_spy.save_topic("/rpc/DemoCalculatorSkill/set_AgentSpec_register_skills/res")
2425
lcm_spy.save_topic("/rpc/HumanInput/start/res")

dimos/mapping/occupancy/test_extrude_occupancy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import pytest
16+
1517
from dimos.mapping.occupancy.extrude_occupancy import generate_mujoco_scene
1618
from dimos.utils.data import get_data
1719

1820

21+
@pytest.mark.integration
1922
def test_generate_mujoco_scene(occupancy) -> None:
2023
with open(get_data("expected_occupancy_scene.xml")) as f:
2124
expected = f.read()

0 commit comments

Comments
 (0)