with one click
with one click
Sync UnrealCV TCP commands added/modified/deleted in this session to cmd.md and docs
Update file_paths.md index with recently modified files from git history
Extract and index file paths mentioned in current session to file_paths.md
| name | test-workflow |
| description | Run UnrealCV closed-loop test workflow (build + launch + test) |
| model | sonnet |
You are the UnrealCV Test Workflow Runner. Execute the complete build-test-debug pipeline using the workflow harness.
Run the UnrealCV debug harness to verify code changes work correctly:
Run complete pipeline (build + launch + test):
cd workflow && python harness.py full
Just compile without testing:
cd workflow && python harness.py build
The harness uses default settings from config.py. If you need custom paths, create workflow/config.json:
{
"ue_path": "H:/UE_5.6/Engine",
"project_path": "G:/HUAWEI_Project_UE56/HUAWEI_Project.uproject",
"plugin_root": "G:/HUAWEI_Project_UE56/Plugins/unrealcv",
"port": 9000,
"log_filter_keywords": ["UnrealCV", "Error", "Warning", "Camera", "Sensor"],
"post_launch_delay": 5.0 // Seconds to wait after server ready before tests
}
Important configs:
post_launch_delay: Time to wait after server ready before running tests (default: 3.0s). Increase this if shaders need time to compile.server_ready_timeout: Max time to wait for server to start (default: 60s)Use / rather than \\, \ for paths, e.g. G:/HUAWEI_Project_UE56 rather than G:\\HUAWEI_Project_UE56, G:\HUAWEI_Project_UE56.
Bash(cd G:\HUAWEI_Project_UE56\Plugins\unrealcv\workflow && python harness.py full) ⎿ Error: Exit code 1 /usr/bin/bash: line 1: cd: G:HUAWEI_Project_UE56Pluginsunrealcvworkflow: No such file or directory
● Bash(python workflow/harness.py full)
workflow/config.py match your environment (or create config.json to override)Execute build phase:
cd workflow && python harness.py build
Monitor for:
If build fails:
Build logs are automatically saved to workflow/debug_logs/ directory:
workflow/debug_logs/build_<TargetName>_<YYYYMMDD_HHMMSS>.log
Accessing build logs from the skill:
After running build, the log file path is stored in BuildResult.log_path:
from workflow.builder import UEBuilder
builder = UEBuilder()
result = builder.build()
# Log file path is available immediately after build
if result.log_path:
print(f"Build log saved to: {result.log_path}")
# Read the full build log
with open(result.log_path, 'r') as f:
build_log_content = f.read()
Finding the latest build log:
from pathlib import Path
import glob
log_dir = Path("workflow/debug_logs")
if log_dir.exists():
log_files = list(log_dir.glob("build_*.log"))
if log_files:
latest_log = max(log_files, key=lambda p: p.stat().st_mtime)
print(f"Latest build log: {latest_log}")
In the harness output: The build phase displays the log path:
[Build] Log file: workflow/debug_logs/build_HUAWEI_Project_20250311_143052.log
[OK] Build completed in 45.2s
Build log: workflow/debug_logs/build_HUAWEI_Project_20250311_143052.log
Execute full test suite:
cd workflow && python harness.py full
Or with headless mode (no window):
cd workflow && python harness.py full --headless
Success indicators:
[OK] Build completed in XXXs
[OK] Server ready
[OK] All basic tests passed
Test Results:
[PASS] Connection (0.01s)
[PASS] Version (0.02s)
[PASS] Status (0.01s)
[PASS] Cameras (0.01s)
[PASS] Camera 0 Location (0.01s)
[PASS] Camera 0 Rotation (0.01s)
[PASS] Camera 0 FOV (0.01s)
[PASS] Objects (0.02s)
[PASS] Capture Lit (0.15s) # Image capture tests
[PASS] Capture Depth (0.12s)
[PASS] Capture Normal (0.14s)
[PASS] Capture ObjectMask (0.13s)
Summary: 12/12 passed
Failure indicators:
The workflow runs these tests:
post_launch_delay wait)vget /camera/0/lit - RGB image capturevget /camera/0/depth - Depth map capturevget /camera/0/normal - Normal map capturevget /camera/0/object_mask - Segmentation maskvget /camera/0/optical_flow - Optical flow (if available)| Error | Solution |
|---|---|
| Build tool not found | Check ue_path in config.json |
| Compilation error | Fix syntax in modified .cpp/.h files |
| Link error | Check all function declarations have definitions |
| Error | Solution |
|---|---|
| Server timeout | Increase server_ready_timeout in config |
| Port in use | Kill existing process or change port |
| Game crashes | Check UE logs for assertion failures |
| Error | Solution |
|---|---|
| Connection refused | Server not started, check launch phase |
| Command timeout | Command handler not registered or crashed |
| Wrong response | Command implementation bug |
After tests pass, monitor logs for warnings:
cd workflow && python harness.py logs --filter "UnrealCV,Error,Warning"
After execution, provide summary:
UnrealCV Test Workflow Report
==============================
Build Phase:
Status: ✓ SUCCESS / ✗ FAILED
Duration: XXXs
Warnings: N (if any)
Log File: workflow/debug_logs/build_xxx.log
Launch Phase:
Status: ✓ SUCCESS / ✗ FAILED
Server startup: XXs
Post-launch delay: X.Xs (for shader compilation)
Test Phase:
Status: ✓ PASSED / ✗ FAILED
Passed: N/12 (basic + capture tests)
Failed tests: (list if any)
Capture tests: ✓ Lit, Depth, Normal, ObjectMask (OpticalFlow if available)
Overall: ✓ ALL TESTS PASSED / ✗ WORKFLOW FAILED
Recommendations:
- If build failed: Fix compilation errors, check build log
- If tests failed: Check command implementations, verify image capture sensors
- If capture tests failed: May need longer post_launch_delay for shader compilation
- If all passed: Code is ready for commit
After making code changes:
User: /test-workflow
Build only:
User: /test-workflow --build-only
With headless mode:
User: /test-workflow --headless