You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,6 @@ If you want to contribute to LinkForge or use the latest source code:
118
118
119
119
Complete examples in `examples/` directory:
120
120
121
-
-`roundtrip_test_robot.urdf`: A comprehensive robot containing ALL 6 URDF joint types (fixed, revolute, continuous, prismatic, planar, floating), plus sensors. Perfect for testing full roundtrip capabilities.
122
121
-`mobile_robot.urdf`: A simple mobile robot base.
123
122
-`diff_drive_robot.urdf`: A differential drive robot with wheels.
124
123
-`quadruped_robot.urdf`: A 4-legged robot demonstrating complex kinematic chains and multi-link assemblies.
@@ -136,7 +135,6 @@ Complete examples in `examples/` directory:
136
135
### Setup
137
136
```bash
138
137
# 1. Install 'just' command runner (see Contributing Guide for OS-specific instructions)
Copy file name to clipboardExpand all lines: tests/README.md
+27-7Lines changed: 27 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,29 +8,49 @@ The test suite separates pure logic from platform-specific behavior:
8
8
9
9
### 1. `unit/`
10
10
Isolated tests for individual components avoiding external dependencies.
11
-
-**`unit/core/`**: Tests for robot models, parsers, and physics utilities. Runs in standard Python.
12
-
-**`unit/platforms/blender/`**: Tests for Blender utilities (scene helpers, visualization, operators). Requires a Blender runtime.
11
+
-**`unit/core/`**: Tests for robot models, parsers, and physics utilities.
12
+
-**`unit/platforms/blender/`**: Tests for Blender utilities (scene helpers, visualization).
13
13
14
14
### 2. `integration/`
15
15
End-to-end tests verifying the interaction between multiple components.
16
-
-**`integration/core/`**: Verifies complex URDF parsing, Xacro expansion scenarios, and validation features like Inertia calculations.
17
-
-**`integration/platforms/blender/`**: Verifies the complete roundtrip process (Import → Scene Setup → Export).
16
+
-**`integration/core/`**: Verifies complex URDF/SRDF parsing and validation.
17
+
-**`integration/platforms/blender/`**: Verifies the complete roundtrip process.
18
+
19
+
### 3. Infrastructure
20
+
-`blender_launcher.py` (Root): CLI tool to run tests inside a Blender environment.
21
+
-`mock_bpy_env.py`: Comprehensive mock of the Blender API for fast logic testing.
22
+
-`conftest.py`, `core_test_utils.py`, `blender_test_utils.py`: Shared fixtures and assertions.
18
23
19
24
## How to Run Tests
20
25
21
26
### Standard Python Tests
22
27
To run core unit tests and core integration tests:
23
28
```bash
24
-
pytest tests/unit/core tests/integration/core
29
+
just test-core
25
30
```
26
31
27
32
### Blender-Dependent Tests
28
-
To run tests that require the Blender Python API (`bpy`), use the launcher from the project root:
33
+
#### A. Fast Logic Testing (No Blender Required)
34
+
Tests the Blender integration logic using a comprehensive mock environment. This is very fast and runs in standard Python.
35
+
```bash
36
+
just test-blender-logic
37
+
```
38
+
39
+
#### B. Full Integration Testing (Requires Real Blender)
40
+
Runs tests inside a real Blender instance to verify UI, visualization, and roundtrip fidelity.
29
41
```bash
30
-
python blender_launcher.py
42
+
just test-blender
31
43
```
32
44
*Note: Ensure your `BLENDER_PATH` environment variable is set or Blender is installed at its default location.*
33
45
46
+
## 📊 Test Coverage
47
+
48
+
To run the entire suite and generate a combined coverage report (HTML):
49
+
```bash
50
+
just coverage
51
+
```
52
+
The report will be available at `htmlcov/index.html`.
53
+
34
54
## Best Practices for Contributors
35
55
36
56
1.**Use Fixtures**: Place shared test resources (mock robots, custom builders) in `tests/conftest.py`. Prefer self-contained tests (inline strings or programmatic construction) over external file dependencies.
0 commit comments