{
  "id": "ros2/colcon-test-failure-test-dependencies-not-installed",
  "signature": "colcon test: Failed to find test dependencies: 'python3-pytest', 'ros_testing' not installed",
  "signature_zh": "colcon test: 找不到测试依赖项：'python3-pytest'、'ros_testing'未安装",
  "regex": "colcon test.*Failed to find test dependencies|test dependencies.*not installed|Could not find.*test_depend",
  "domain": "ros2",
  "category": "test_error",
  "subcategory": null,
  "root_cause": "colcon test requires test dependencies specified in package.xml (under <test_depend>) to be installed in the workspace. Missing system or ROS packages cause test execution to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "colcon test需要安装package.xml中指定的测试依赖项（位于<test_depend>下）。缺少系统或ROS包会导致测试执行失败。",
  "versions": [
    {
      "version": "Humble",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Iron",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Rolling",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The error will still occur for the selected package if dependencies are missing. The --packages-select flag doesn't bypass dependency resolution.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This command by default skips test dependencies unless --rosdistro and --include-test-dependencies are specified.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install test dependencies explicitly: rosdep install --from-paths src --ignore-src -r -y --rosdistro humble --include-test-dependencies. Then run colcon test again.",
      "success_rate": 0.9,
      "how": "Install test dependencies explicitly: rosdep install --from-paths src --ignore-src -r -y --rosdistro humble --include-test-dependencies. Then run colcon test again.",
      "condition": "",
      "sources": []
    },
    {
      "action": "For missing system packages like python3-pytest, install manually: sudo apt-get install python3-pytest. For ROS packages like ros_testing: sudo apt-get install ros-humble-ros-testing.",
      "success_rate": 0.85,
      "how": "For missing system packages like python3-pytest, install manually: sudo apt-get install python3-pytest. For ROS packages like ros_testing: sudo apt-get install ros-humble-ros-testing.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If test dependencies are optional, temporarily remove them from package.xml and run colcon test with --packages-skip-build-failed to skip problematic packages.",
      "success_rate": 0.7,
      "how": "If test dependencies are optional, temporarily remove them from package.xml and run colcon test with --packages-skip-build-failed to skip problematic packages.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Install test dependencies explicitly: rosdep install --from-paths src --ignore-src -r -y --rosdistro humble --include-test-dependencies. Then run colcon test again.",
    "For missing system packages like python3-pytest, install manually: sudo apt-get install python3-pytest. For ROS packages like ros_testing: sudo apt-get install ros-humble-ros-testing.",
    "If test dependencies are optional, temporarily remove them from package.xml and run colcon test with --packages-skip-build-failed to skip problematic packages."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.ros.org/en/rolling/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Package.html#test-your-package",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}