{
  "id": "ros2/colcon-test-missing-test-output",
  "signature": "colcon test: No test output files found in 'build/my_package/test_results'",
  "signature_zh": "colcon test：在'build/my_package/test_results'中未找到测试输出文件",
  "regex": "No test output files found in '.*?'",
  "domain": "ros2",
  "category": "test_error",
  "subcategory": null,
  "root_cause": "The test runner (e.g., pytest, gtest) did not produce output files in the expected directory because tests failed to run, were skipped, or the CMake/ament test configuration did not set up output generation correctly.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试运行器（如pytest、gtest）未在预期目录中生成输出文件，因为测试未能运行、被跳过，或CMake/ament测试配置未正确设置输出生成。",
  "versions": [
    {
      "version": "ROS2 Humble",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ROS2 Iron",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ROS2 Rolling",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Running 'colcon test' with '--event-handlers console_direct+' to see all output, but still no test results",
      "why_fails": "This only increases verbosity; it does not fix the underlying issue of tests not producing output files.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually creating the test_results directory to satisfy colcon",
      "why_fails": "The directory must contain actual test output files; an empty directory does not resolve the error.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check if the test executable exists and can run: 'colcon test --packages-select my_package' and look for error messages in the console output. If tests are C++ gtest, ensure 'add_rostest' or 'ament_add_gtest' is used in CMakeLists.txt.",
      "success_rate": 0.85,
      "how": "Check if the test executable exists and can run: 'colcon test --packages-select my_package' and look for error messages in the console output. If tests are C++ gtest, ensure 'add_rostest' or 'ament_add_gtest' is used in CMakeLists.txt.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Rebuild the package with '--cmake-args -DBUILD_TESTING=ON' and then run tests again. This ensures test targets are built.",
      "success_rate": 0.9,
      "how": "Rebuild the package with '--cmake-args -DBUILD_TESTING=ON' and then run tests again. This ensures test targets are built.",
      "condition": "",
      "sources": []
    },
    {
      "action": "For Python packages, ensure 'setup.py' or 'setup.cfg' has a 'test' section pointing to the correct test directory, and run 'colcon test' from the workspace root.",
      "success_rate": 0.8,
      "how": "For Python packages, ensure 'setup.py' or 'setup.cfg' has a 'test' section pointing to the correct test directory, and run 'colcon test' from the workspace root.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "检查测试可执行文件是否存在并可运行：'colcon test --packages-select my_package'，并在控制台输出中查找错误消息。如果是C++ gtest，确保在CMakeLists.txt中使用了'add_rostest'或'ament_add_gtest'。",
    "使用'--cmake-args -DBUILD_TESTING=ON'重新构建包，然后重新运行测试。这确保测试目标被构建。",
    "对于Python包，确保'setup.py'或'setup.cfg'中有指向正确测试目录的'test'部分，并从工作区根目录运行'colcon test'。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.ros.org/en/humble/Tutorials/Intermediate/Testing/Testing.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}