Skip to content

Reduce local colcon test time #238

@bburda

Description

@bburda

Summary

Local colcon test takes ~20 minutes because it runs everything serially: clang-tidy (~8-10 min), unit tests (~3 min), and integration tests (~7 min). During typical feature development, most of this is wasted - developers only need fast unit test feedback.


Proposed solution (optional)

Six incremental changes:

  1. Developer convenience script (scripts/test.sh) - named presets (unit, integ, lint, tidy, all) with parallel CTest execution via --parallel-workers $(nproc)
  2. Opt-in clang-tidy - gate behind ENABLE_CLANG_TIDY=OFF (default), CI sets it ON for Jazzy linter job
  3. ccache integration - auto-detect ccache via cmake/ROS2MedkitCcache.cmake, include in all 5 C++ packages
  4. Precompiled headers - PCH for rclcpp, nlohmann/json, httplib, common STL headers in gateway_lib (~30-40% build speedup)
  5. CI ccache - persistent ccache via actions/cache for faster CI rebuilds on subsequent runs
  6. Incremental clang-tidy - pre-push hook running clang-tidy only on changed .cpp files via merged compile_commands.json

Expected result: typical dev loop (edit + unit test) drops from minutes to under a minute with warm ccache.


Additional context (optional)

  • Gateway package alone: 142 files / 38k LOC, clang-tidy TIMEOUT 1500s
  • All changes are backward-compatible - no effect when ccache is absent, clang-tidy still mandatory in CI
  • PCH can be disabled with -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions