diff --git a/features/src/ros2/install.sh b/features/src/ros2/install.sh index 4ed811e..58b68a6 100755 --- a/features/src/ros2/install.sh +++ b/features/src/ros2/install.sh @@ -169,6 +169,9 @@ if [[ -n "${remote_user}" && -n "${remote_user_home}" && -d "${remote_user_home} if ! grep -Fq '[ -f /etc/profile.d/ros2.sh ] && . /etc/profile.d/ros2.sh' "${shell_init}"; then printf '\n%s\n' '[ -f /etc/profile.d/ros2.sh ] && . /etc/profile.d/ros2.sh' >> "${shell_init}" fi + if ! grep -Fq '[ -f /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash ] && . /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash' "${shell_init}"; then + printf '%s\n' '[ -f /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash ] && . /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash' >> "${shell_init}" + fi chown "${remote_user}:$(id -gn "${remote_user}")" "${shell_init}" else echo "No effective Dev Container user was provided; skipping user-specific shell configuration." diff --git a/features/test/ros2-idempotency/Dockerfile b/features/test/ros2-idempotency/Dockerfile index 02a7932..4e9b158 100644 --- a/features/test/ros2-idempotency/Dockerfile +++ b/features/test/ros2-idempotency/Dockerfile @@ -12,5 +12,7 @@ RUN /tmp/ros2-feature/install.sh RUN bash -lc 'test "${ROS_DISTRO}" = jazzy' \ && bash -lc 'command -v ros2 && command -v colcon && command -v rosdep && command -v vcs' \ + && sudo -u vscode bash -ic 'complete -p colcon >/dev/null' \ && test -f /etc/ros/rosdep/sources.list.d/20-default.list \ - && test "$(grep -Fc '[ -f /etc/profile.d/ros2.sh ] && . /etc/profile.d/ros2.sh' /home/vscode/.bashrc)" -eq 1 + && test "$(grep -Fc '[ -f /etc/profile.d/ros2.sh ] && . /etc/profile.d/ros2.sh' /home/vscode/.bashrc)" -eq 1 \ + && test "$(grep -Fc '[ -f /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash ] && . /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash' /home/vscode/.bashrc)" -eq 1 diff --git a/features/test/ros2/test.sh b/features/test/ros2/test.sh index bb8a806..4646e8a 100755 --- a/features/test/ros2/test.sh +++ b/features/test/ros2/test.sh @@ -13,5 +13,6 @@ check "ament cppcheck compatibility is enabled" bash -lc '[ "${AMENT_CPPCHECK_AL check "rosdep is initialized" test -f /etc/ros/rosdep/sources.list.d/20-default.list check "absent overlay does not break shell startup" bash -lc 'command -v ros2 >/dev/null' check "effective user bashrc sources ROS profile once" bash -lc 'test "$(grep -Fc "[ -f /etc/profile.d/ros2.sh ] && . /etc/profile.d/ros2.sh" /home/vscode/.bashrc)" -eq 1' +check "colcon completion is enabled" bash -ic 'complete -p colcon >/dev/null' reportResults