Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: uv sync --all-extras --dev

- name: Run tests
run: uv run pytest src scripts
run: uv run pytest --strict-markers -m "not manual"
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,7 @@ known-third-party = ["wandb"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.pytest.ini_options]
markers = ["manual: should be run manually."]
testpaths = ["src", "scripts", "packages"]
5 changes: 5 additions & 0 deletions src/openpi/models/exported_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

import jax
import jax.numpy as jnp
import pytest

import openpi.models.exported as exported
import openpi.models.model as _model
import openpi.models.pi0 as pi0
import openpi.training.checkpoints as _checkpoints


@pytest.mark.manual
def test_sample_actions():
model = exported.PiModel.from_checkpoint("s3://openpi-assets/exported/pi0_aloha_sim/model")
actions = model.sample_actions(jax.random.key(0), model.fake_obs(), num_steps=10)

assert actions.shape == (1, model.action_horizon, model.action_dim)


@pytest.mark.manual
def test_exported_as_pi0():
pi_model = exported.PiModel.from_checkpoint("s3://openpi-assets/exported/pi0_aloha_sim/model")
model = pi_model.set_module(pi0.Module(), param_path="decoder")
Expand All @@ -33,6 +36,7 @@ def test_exported_as_pi0():
assert diff < 10.0


@pytest.mark.manual
def test_processor_loading():
pi_model = exported.PiModel.from_checkpoint("s3://openpi-assets/exported/pi0_aloha_sim/model")
assert pi_model.processor_names() == ["huggingface_aloha_sim_transfer_cube"]
Expand All @@ -41,6 +45,7 @@ def test_processor_loading():
assert sorted(norm_stats) == ["actions", "state"]


@pytest.mark.manual
def test_convert_to_openpi(tmp_path: pathlib.Path):
output_dir = tmp_path / "output"

Expand Down
2 changes: 2 additions & 0 deletions src/openpi/models/model_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import jax
import jax.numpy as jnp
import pytest

from openpi.models import model as _model
from openpi.models import pi0
Expand Down Expand Up @@ -30,6 +31,7 @@ def test_model():
assert actions.shape == (batch_size, model.action_horizon, model.action_dim)


@pytest.mark.manual
def test_model_restore():
model = create_pi0_model()

Expand Down
3 changes: 3 additions & 0 deletions src/openpi/policies/policy_config_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import pytest

from openpi.policies import aloha_policy
from openpi.policies import policy_config as _policy_config
from openpi.training import config as _config


@pytest.mark.manual
def test_create_trained_policy():
config = _config.get_config("pi0_aloha_sim")
policy = _policy_config.create_trained_policy(config, "s3://openpi-assets/checkpoints/pi0_aloha_sim")
Expand Down
3 changes: 3 additions & 0 deletions src/openpi/policies/policy_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from openpi_client import action_chunk_broker
import pytest

from openpi.models import exported as _exported
from openpi.policies import aloha_policy
Expand All @@ -16,6 +17,7 @@ def create_policy_config() -> _policy_config.PolicyConfig:
)


@pytest.mark.manual
def test_infer():
config = create_policy_config()
policy = _policy_config.create_policy(config)
Expand All @@ -26,6 +28,7 @@ def test_infer():
assert outputs["actions"].shape == (config.model.action_horizon, 14)


@pytest.mark.manual
def test_broker():
config = create_policy_config()
policy = _policy_config.create_policy(config)
Expand Down
Loading