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
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,39 @@ For quick start with a router, device registry, and distributed state — see [`
### Editable install (all packages)

```bash
uv sync && source .venv/bin/activate
```

For a pip-only environment:

```bash
python3 -m venv .venv && source .venv/bin/activate
# Install all packages in editable mode
pip install -e packages/device-connect-edge
pip install -e "packages/device-connect-server[all]"
pip install -e "packages/device-connect-agent-tools[strands]"
```

### Running tests

```bash
# Run all tests
pytest -v
```

```bash
# SDK unit tests (no Docker)
cd packages/device-connect-edge && python3 -m pytest tests/ -v
pytest packages/device-connect-edge -v

# Server unit tests (no Docker)
cd packages/device-connect-server && python3 -m pytest tests/ -v
pytest packages/device-connect-server -v

# Agent-tools unit tests (no Docker)
cd packages/device-connect-agent-tools && python3 -m pytest tests/test_connection_unit.py tests/test_tools_unit.py -v
pytest packages/device-connect-agent-tools/tests/test_connection_unit.py packages/device-connect-agent-tools/tests/test_tools_unit.py -v

# Integration tests (requires Docker)
cd tests && docker compose -f docker-compose-itest.yml up -d
DEVICE_CONNECT_ALLOW_INSECURE=true python3 -m pytest tests/ -v -m "not llm"
docker compose -f tests/docker-compose-itest.yml up -d
DEVICE_CONNECT_ALLOW_INSECURE=true pytest tests/tests -v -m "not llm"
```

See [tests/README.md](tests/README.md) for the full test matrix.
Expand Down
4 changes: 0 additions & 4 deletions packages/device-connect-agent-tools/tests/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions packages/device-connect-edge/tests/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions packages/device-connect-server/tests/__init__.py

This file was deleted.

48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2024-2026, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

[project]
name = "device-connect-workspace"
version = "0.0.0"
description = "Workspace configuration for Device Connect development"
requires-python = ">=3.11"
dependencies = [
"device-connect-edge[dev,fuzz,predicate,telemetry]",
"device-connect-server[all,fuzz]",
"device-connect-agent-tools[claude,dev,fuzz,langchain,mcp,predicate,strands]",
"device-connect-integration-tests",
]

[tool.uv]
package = false

[tool.uv.sources]
device-connect-edge = { path = "packages/device-connect-edge", editable = true }
device-connect-server = { path = "packages/device-connect-server", editable = true }
device-connect-agent-tools = { path = "packages/device-connect-agent-tools", editable = true }
device-connect-integration-tests = { path = "tests", editable = true }

[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
testpaths = [
"packages/device-connect-edge/tests",
"packages/device-connect-server/tests",
"packages/device-connect-agent-tools/tests",
"tests/tests",
]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
timeout = 120
log_cli = true
log_cli_level = "INFO"
markers = [
"conformance: marks messaging backend conformance tests",
"d2d: marks device-to-device communication tests",
"integration: marks tests requiring Docker infrastructure, brokers, or registry services",
"llm: marks tests requiring a real LLM API key such as OPENAI_API_KEY or ANTHROPIC_API_KEY",
"slow: marks tests taking more than 30 seconds",
]
35 changes: 22 additions & 13 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tests/
│ └── orchestrator.py # Orchestrator fixtures (mock + real LLM)
├── conftest.py # Root conftest with session-scoped fixtures
├── docker-compose-itest.yml # NATS + etcd + registry services
├── requirements.txt # Test dependencies
├── pyproject.toml # Test dependencies
└── pytest.ini # Pytest configuration
```

Expand All @@ -58,29 +58,38 @@ cd device-connect

## Setup

Install all packages and test dependencies from the repo root:

```bash
cd tests
python -m venv .venv && source .venv/bin/activate
uv sync && source .venv/bin/activate
```

For a pip-only environment:

```bash
python3 -m venv .venv && source .venv/bin/activate
# Install all packages in editable mode
pip install -e ../packages/device-connect-edge
pip install -e "../packages/device-connect-server[all]"
pip install -e "../packages/device-connect-agent-tools[strands]"
pip install -r requirements.txt
pip install -e packages/device-connect-edge
pip install -e "packages/device-connect-server[all]"
pip install -e "packages/device-connect-agent-tools[strands]"
pip install -e tests
```

The commands below assume the virtual environment is active. From an
unactivated shell, prefix the `pytest ...` command with `uv run`.

## Running Tests

### Start infrastructure

```bash
docker compose -f docker-compose-itest.yml up -d
docker compose -f tests/docker-compose-itest.yml up -d
```

### Tier 1: Core integration tests (no LLM)

```bash
pytest tests/ -v -m "not llm" --timeout=120
pytest tests/tests -v -m "not llm" --timeout=120
```

### Tier 2: LLM tests (requires API key)
Expand All @@ -90,25 +99,25 @@ export OPENAI_API_KEY="sk-..."
# or
export ANTHROPIC_API_KEY="sk-ant-..."

pytest tests/ -v -m "llm" --timeout=120
pytest tests/tests -v -m "llm" --timeout=120
```

### Messaging conformance tests

```bash
pytest tests/test_messaging_conformance.py -v -m conformance --timeout=60
pytest tests/tests/test_messaging_conformance.py -v -m conformance --timeout=60
```

### Run everything

```bash
pytest tests/ -v --timeout=120
pytest tests/tests -v --timeout=120
```

### Tear down

```bash
docker compose -f docker-compose-itest.yml down -v --remove-orphans
docker compose -f tests/docker-compose-itest.yml down -v --remove-orphans
```

## Test Markers
Expand Down
4 changes: 2 additions & 2 deletions tests/docker-compose-itest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Dev mode: no TLS, no JWT auth. Matches DEVICE_CONNECT_ALLOW_INSECURE=true.
#
# Usage:
# docker compose -f docker-compose-itest.yml up -d
# pytest tests/ -v -m "not llm" --timeout=60
# docker compose -f tests/docker-compose-itest.yml up -d
# pytest tests/tests -v -m "not llm" --timeout=60

services:
# NATS broker with JetStream (no auth)
Expand Down
25 changes: 25 additions & 0 deletions tests/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2024-2026, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "device-connect-integration-tests"
version = "0.0.0"
description = "Cross-package integration test dependencies for Device Connect"
requires-python = ">=3.11"
dependencies = [
"pytest>=8.0",
"pytest-asyncio>=0.23",
"pytest-timeout>=2.0",
"nats-py>=2.5.0,<3",
"nkeys>=0.2.0",
"aiohttp>=3.9.0",
"strands-agents[openai,anthropic]>=1.1.0,<2",
]

[tool.setuptools]
packages = []
22 changes: 0 additions & 22 deletions tests/requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions tests/tests/__init__.py

This file was deleted.

Loading